16 May 2009

OK. ATI's OpenGL drivers suck, like the legend says.

Why does
for(int i=0; i«nstrips; ++i)
glDrawElements(GL_TRIANGLE_STRIP, (GLsizei)count[i], GL_UNSIGNED_SHORT, (const void*)indices[i]);

work, and
glMultiDrawElements(GL_TRIANGLE_STRIP, (const GLsizei*)count, GL_UNSIGNED_SHORT, (const void**)indices, nstrips);
doesn't?

Labels:

xernobyl @ 02:59

1 comments


06 May 2009

Half?

Some days ago I found out that there is a surprisingly small amount of search results at google when you search for stuff related to OpenGL vertex buffers, and half floats. Well, they work. I supose that's all you need to know about it if you're interested.

The work with scenept.untergrund.net keeps progressing slowly. That's just because coding php is boring. I spend more time trying to find out why stuff is working istead of not working like in a regular programming language. Seriously. Why are there so many hidden (???) variables in bbpress's code? Why don't most functions simply return values instead of using secret variables?

Labels:

xernobyl @ 03:41

0 comments


26 January 2009

GLSL and Point Sprites

I survived last week. Good.
I spent the last 3 or 4 days trying to replace a few spheres with a few point sprites hoping they would be faster. I'm not getting the feeling they're faster than using billboards, or even faster than drawing a few spheres. Even on my old machine. Anyway I finally got some point sprites that behave like real spheres on a 3D world. It's strange how hard it is to find any decent information about using gl_FragDepth, or Point Sprites with GLSL.
After doing a few drawings on my new white board I concluded that I need better pens. I also found out that
[code]gl_PointSize = radius * screen_height / (tan(fov/2) * distance);[/code]
is the correct size of a sphere. Start by drawing a frustrum triangle, split it in half and you're almost there. You can probably guess what the variables mean. After that it was a lot harder to find out that after z is normalized to [-1, 1] it still has to fit in the depth buffer that goes from [0, 1]. The OpenGL specificiation is not a very good reference.
Next step?

Labels: , , ,

xernobyl @ 22:20

2 comments