Well, good question. As you guessed from my code, things are not suited for mixing the submission of opaque and transparent polys.GyroVorbis wrote:Another thing I'm wondering is how you are planning to handle glEnable(GL_BLEND) and glDisable(GL_BLEND) to switch between TR and OP polys.
Since you are using direct rendering, you have to submit all OP polys then all TR polys and you can't mix them. If you want to be able to submit OP or TR polys whenever, aren't you also going to need to use a buffered approach anyway?
I guess that is because I have been testing using code that I wrote for the KGL API that came with KOS that expects the user to submit OP polys first, then flush that list before submitting TR polys.
viewtopic.php?f=29&t=102059#p1032695
So that brings me to the question I mentioned I wanted to ask you, about a post you made hereGyroVorbis wrote:Then you fill up two buffers in RAM (OP and TR lists) and have KOS DMA them over to the PVR when the scene ends.
At least that's the approach I'm using. I am also writing an API kind of like this. It is not quite as multipurpose as yours, but it is an abstraction away from the PVR that our engine is using. I find this topic very interesting, because these are all things I'm considering/wondering in my own API.
http://elysianshadows.com/dev/community ... -dreamcast
Thank you for that information by the way.
My question, is how is that actually using the DMA channels to transfer the vertex data to the PVR?
From what I can see there, every vertex is transferred through the store queues, although I admit I have not looked at any of the pvr_set_vertbuf stuff in kos yet.
Any further info on that appreciated
So, to actually enable a GL API that can handle the submission of mixed lists, I dont think we can get away with using mat_transform_sq.
( But that is not a loss, from my testing it operates at the same throughput of using mat_transform_single anyway )
The way that first comes to mind, will be waiting untill the entire scene has been submitted to the vertex buffer before sending the vertices to the PVR.
The problem with using mat_transform_sq is that if we wait untill the entire scene has been submitted before transforming the vertices, the matrix in the registers will most likely have changed since the vertex was actually submitted to the GL pipeline.
So, we could mat_transform_single every vertex recieved by the GL pipeline into a Vertex Buffer, waiting untill the scene is finished before transferring the Vertex Buffer via DMA.
It would be best to use a double-buffer in this approach, so that one buffer can be transferred to the PVR while the other buffer is being created.