OpenGL specular highlight rendering and DTS objects
by David Wyand · in Torque Game Engine · 12/17/2002 (11:33 am) · 2 replies
Greetings!
Through my continuing work on the LightWave DTS exporter, I've come across the fact that the TGE doesn't appear to support specular highlights for DTS objects (or anything else, AFAIK). This has gotten me thinking (a dangerous prospect) about the reason why and what it would take to implement it.
First of all, a question to those that have more experience than I with OpenGL: Do specular highlights (using GL_SPECULAR and GL_SHININESS) add any significant rendering performance penalty? Sure, it would depend on the number of polygons that make use of it. But is it generally avoided in a gaming environment?
If the answer is 'no' or 'it's not significant', then I'd like to propose a change to the DTS file format to allow for specular highlights. It doesn't appear that the material class (TSMaterialList) currently supports this, so it would require a modification. And, of course, the DTS exporters would need to be modified to take advantage of this, but any changes wouldn't prevent the current set of exporters from working.
Other things would need to be done within the engine to support specualr highlights, such as activating the specular component of lights, and modifying the DTS rendering code. However, one thing at a time...
So, what are your thoughts?
- LightWave Dave
Through my continuing work on the LightWave DTS exporter, I've come across the fact that the TGE doesn't appear to support specular highlights for DTS objects (or anything else, AFAIK). This has gotten me thinking (a dangerous prospect) about the reason why and what it would take to implement it.
First of all, a question to those that have more experience than I with OpenGL: Do specular highlights (using GL_SPECULAR and GL_SHININESS) add any significant rendering performance penalty? Sure, it would depend on the number of polygons that make use of it. But is it generally avoided in a gaming environment?
If the answer is 'no' or 'it's not significant', then I'd like to propose a change to the DTS file format to allow for specular highlights. It doesn't appear that the material class (TSMaterialList) currently supports this, so it would require a modification. And, of course, the DTS exporters would need to be modified to take advantage of this, but any changes wouldn't prevent the current set of exporters from working.
Other things would need to be done within the engine to support specualr highlights, such as activating the specular component of lights, and modifying the DTS rendering code. However, one thing at a time...
So, what are your thoughts?
- LightWave Dave
About the author
A long time Associate of the GarageGames' community and author of the Torque 3D Game Development Cookbook. Buy it today from Packt Publishing!
#2
Yes, I was thinking of vertex-based specular highlights. I'm not interested in per pixel lighting at the moment.
If the only penalty within the rendering pipeline is the extra amount of polygons for a smooth highlight, then I can live with that. It is then up to the modeler as to how fine a mesh is required, and levels of detail can reduce the mesh complexity at a distance.
My own plan was to use specular highlights for helmet visors, binocular lenses, and vehicle windshields. I suppose it really comes down to me (and anyone else) trying it out and making my own determination as to what is acceptable.
Any one else have some thoughts on this?
- LightWave Dave
12/17/2002 (1:04 pm)
Greetings!Yes, I was thinking of vertex-based specular highlights. I'm not interested in per pixel lighting at the moment.
If the only penalty within the rendering pipeline is the extra amount of polygons for a smooth highlight, then I can live with that. It is then up to the modeler as to how fine a mesh is required, and levels of detail can reduce the mesh complexity at a distance.
My own plan was to use specular highlights for helmet visors, binocular lenses, and vehicle windshields. I suppose it really comes down to me (and anyone else) trying it out and making my own determination as to what is acceptable.
Any one else have some thoughts on this?
- LightWave Dave
Torque Owner Mz
While this works fine for diffuse lighting, it's not so good for a specular term.
To get a good looking specular highlight with openGL, there are two real options:
1) Calculate lighting per pixel. (Phong or similar.) This requires either pixel shader hardware, or going to software mode rendering.
2) Tesselate surfaces very finely, so that vertexes are close enough together to catch the gradations in a specular highlight. This sends polygon counts through the roof.
So yeah, it's a pretty big performance penalty.