faking specular highlights?

Hi, I’m working on a large scale visualisation tool, the visualisation aspect is a city with roads/traffic/buildings etc. There could be 100’s of 3d models active in the scene at any one time.

Currently I’m planning on having three levels of detail for the 3d models, flat shaded, pre rendered static lighting (ambient/emissive/diffuse), typical OpenGl lighting with ambient/emissive/diffuse and specular highlights.

the pre rendered stuff is like taking snapshot of the model with some lights defined, you get the shading created by the lights, then you can work out what the colour is at each vertex (math at the back of the red book) and save this. Put the drawing process, with the per vertex colours, in a display list and you get reasonable quality 3d definition without having to go through the standard OpenGl lighting routines each time the scene is redrawn which is obviously faster… for me that’s good.

Problem is you cant do this with the specular highlight as this depends on the position of the lights and the position of the view. In my case I’m not that bothered about achieving the level of specular detail that OpenGl gives me, i.e. I don’t care if the highlights move as the viewpoint does, I only want to highlight the sharp edges of the model using the specular colour/shininess.

Like the pre rendered stuff I want to set up the lighting and take a snapshot of how the model looks with shading and highlights, a one time static thing so I don’t need to use OpenGl lighting and get faster performance all be it less detail/realism in the specular component.

Any ideas on how to do this and fake the specular highlight.

One restriction i have is that i cant use any extensions, basic opengl 1.2(ish) only.

thanks in advance
ewan

does gl1.2 support environment mapping? i guess no cubic env map, but at least spherical.

i’m not sure anymore wich cames when. but with envmapping, you can create specular effects. dunno, google should show up some of these…

You could use cubemaps to simulate specular lighting. I think i’ve seen a paper about cubemapping at the nvidia developer site that also explains this method.
I did a quick search and found it here: http://developer.nvidia.com/object/IO_20010830_4778.html

Hope this helps

Jsut realised that you want to use OGL 1.2 so no cube maps, right?

[This message has been edited by Jens Scheddin (edited 02-11-2004).]

>>>Like the pre rendered stuff I want to set up the lighting and take a snapshot of how the model looks with shading and highlights, a one time static thing so I don’t need to use OpenGl lighting and get faster performance all be it less detail/realism in the specular component.<<<

With 1.2 you don’t even have multitextexturing actually. It’s 1.2.1 minimum.

For a snap shot, you might as well give high quality and vertex lighting ain’t it!

You can create a 2D specular map. The center is bright circle and falls off as you move towards the edge.
If reflection vector hits the center, you get maximum specular.

Then you need to compute the tex coords based on view position and light position. Sorry, too lazy to write it up

If you render impostors, then do it using high quality. I highly recommend impostors for these kinds of scenes, if you have the texture memory (which isn’t much more than you’d need for static pre-renders anyway).

For very-low-detail LOD, a box with a normal map and specular using cube mapping is likely to look reasonably good.

I remember reading about faking specular highlights with sphere mapping and multipass blending on some old SGI opengl course material. Maybe it will help you.
http://www.sgi.com/software/opengl/advanced97/slides/slides.html

Look at the “Lighting” chapter.