Specular highlights and texturing.

Okay, I think I’m behind the times here. My book says that to render shiny specular highlights on an object with a texture, I must use a two-pass approach, first rendering with the texture, then using a second pass without to blend the specular highlight in.

Is there any way to do this in one pass now? Any way to utilize multitexturing to make it one pass? What are my options?

Thanks,
Siwko

Use EXT_separate_specular_color.
http://oss.sgi.com/projects/ogl-sample/registry/EXT/separate_specular_color.txt

Eww… I read the spec, and I don’t like it. I know this in an EXT spec, but how prevelant is it? Who’s cards currently support this?

Have you or anyone else had decent results with this extension? Also, what kind of framerate hit does this extension usually incur?

It is what I asked for, but I’m currently at a loss to discern which would be better, this extension or doing two-pass with CVA’s (and/or VAR’s).

Siwko

On GeForces (and probably any reasonably current hardware) it doesn’t incur any performance hit. You could even code it in Register Combiners and just use the final combiner stage (which is free, btw). Any card that supports OpenGL 1.2 (even if Windows doesn’t) supports EXT_separate_specular.

Even if your card is somewhat slow with this, it can’t be slower than sending the triangle again via multipass. Especially tossing blending into the picture (which causes a bandwidth hit too).

Technically, you don’t need either multipass or EXT_separate_specular. The specular color will simply blend with the diffuse color to give an unrealistic appearence.

I’ve used this extension. No noticable frame rate hit at all.

– Zeno

This is supported on our products and is not a performance hit. We’ve had separate interpolators for diffuse and specular since Rage Pro, with no perf hit. Here are a few sample apps:

RadeonSeparateSpecular

RadeonSeparateSpecularII

-Jason

I have an example of Specular highlighting with and without extensions. Extensions does slow down the demo a bit.

Example does come with source code written in Delphi, but the OpenGL code will obviously be exactly the same in C.
http://home.global.co.za/~jhorn

Well thanks guys. I just wasn’t sure how prevalent this extension was on current cards. And the performance issue was a question too.

Thanks for the Demo’s Jason. I haven’t looked at them yet, and I’m sure they’ll work. Does ATI have any sort of developer’s program? Would you guys be willing to send a (free) sample Radeon? Right now our development base is the NVidia line and 3dlabs. Not a single ATI in the house (except Mobility’s in laptops, which we all know don’t do OpenGL).

Just checking.

Siwko