Spellcaster Studios

Make it happen…

VBO and Alpha

Spent sometime today working with interleaved VBOs and indexed primitives in OpenGL…

screen335

The way OpenGL seems to handle the VBOs is weird for me…

For example, in D3D, I can say when I create a vertex buffer that I don’t care about the actual contents of the data I’m loading… That means I can write to a VB, render it, and while the GPU is busy rendering it, lock it again and fill it with some more data and ask it to re-render.

In OpenGL, this seems to cause a pipeline stall… I understand why it happens and how D3D avoids it (because there’s an abstraction layer between the actual VB in VRAM and the data I’m using), but it seems more “explicit” in D3D (although it actually isn’t)…

This means that my abstraction is in the wrong place for the porting, which sucks big time! Sad smile I always assumed that OpenGL would treat VBOs in the same way…

screen336

On the bright side, alpha-blending works exactly as I expected it to, which is great! Smile

Also looked at some tutorials on render to texture, but I’ll implement directly on my system, since it requires a lot of boilerplate that I don’t want to do on my sample application!

Next step is to load a HLSL shader into OpenGL (using hlsl2glsl, if all goes well), and see how well that behaves… I dislike the syntax of GLSL (the declaration part), so writing shaders in HLSL would be great!

Now listening to “Blade OST”

Comment