I am currently in a situation here, and would like you alls ideas. I am currently designing a game engine, 1st person shooter, (with a horror feel). I have been reading all about the different methods of doing many many “effects” aka, bump mapping, per pixel lighting, shadow mapping, etc;. But they ALL seem to use card specific extensions. I would realy realy like not to have to do that. I would prefer to do the effects and have them run on all the cards, without having to rewrite the code for EVERY card there is. Any suggestions?
Oh, just so you know, i “started” writing this engine attempting to make games for Laptops again. (Seemingly that MOST laptops dont have the vid card with alot of power). I would like to continue that, but I would also like a fairly simple way to add in some of the above effects without all the card/vendor specific extensions. ?? .
I don’t know any methods for doing per-pixel lighting and bump mapping without extensions and I would really like to know a way to do that too. But there is a way to do shadow volumes without extensions. Look at this paper for an in-depth explanation on the subject : http://wwwvis.informatik.uni-stuttgart.de/eng/research/pub/pub2002/roettgerWSCG02.ps.gz
I have implemented the screen buffer method on my TNT2 with attenuated shadows and it’s not bad at this point. I still have some problems with non closed and non two manifold meshes, but the problem comes from me and not the method described in the paper.
No extensions are needed and it works on my TNT2 even in 16 bits without requiring a stencil or destination alpha buffer. Attenuated shadows are not “physically” correct, but it’s a visually acceptable approximation in my case, and it can be done with one less pass than ambient shadows (comparable to the standard stencil method).
If the requirement of a destination alpha buffer is not a problem for you, you can even use the alpha buffer method to render shadow volumes faster than with the stencil method. And there are other improvements described in the paper to enhance the system.
My (just released) game engine project has two card specific codepaths, but also has a standard path which only requires OpenGL 1.3. It does per-pixel attenuation, shadow volumes and bump mapping using the 1.3 core, but only does diffuse - there are no specular highlights.
See: http://users.ox.ac.uk/~univ1234 or there is a link on the OpenGL.org front page.
I also have a tutorial on doing bump mapping without any card-specific extensions.
Hope this helps.
If you use “ID” shadow maps, any card that can do a subtract-and-absolute can support shadow maps. Note: these are harder to make work with self-shadowing; in the easy case, an ID shadow map only makes meshes shadow other meshes (further away).
But there is a way to do shadow volumes without extensions.
Hum, you can say there’s a way to do shadow volumes without a stencil buffer; or you can say that there’s a way to do shadow maps without extensions… but shadow volumes without extensions doesn’t make a lot of sense to me
Btw, i agree with Zed. You can use some tricks, but generally speaking, you need to use extensions to make these cutting-edge effects. You can’t have the butter and the money for the butter (i guess it’s coming from the same cook than for your cake, Zed).
> but shadow volumes with extensions doesn’t make a lot of sense to me
The question of the topic starter was about using special effects without extensions, so I just precised that shadow volumes can be done without extensions, ie. without using :
GL_NV_depth_clamp
GL_NV_vertex_program
GL_EXT_vertex_shader
GL_EXT_stencil_two_side
GL_EXT_stencil_wrap
ARB_vertex_program
And he mentionned that he wants his program to work on most graphics card, so I think shadow volumes that can be done without those extensions and without stencil/alpha buffer could be useful for him.
And did I say it is even faster than stencil shadow volumes when using an alpha buffer ?