PDA

View Full Version : tweaking glShadeModel



malancha
03-30-2004, 10:50 PM
Hi, does anyone know what kind of interpolation is performed when glShadeModel(GL_SMOOTH) is used?
I get the feeling it's bilinear.
I need to be able to specify my own interpolation function, or at least to have a wider selection. Is there any way to do this?

I'm not worried about lighting -- I just need the colors from vertices to be interpolated across my triangles using something a little more accurate than bilinear.

Thanks in advance.

[Edit: clarity]

Mazy
03-31-2004, 12:09 AM
Most implementations nowadays use perspectivecorrect bilinear filtering i think.

You cannot change the model itself, but you can assign texturecoords instead of colors and upload a texture of choice that will be the interpolation. or you can move to fragmentprograms and pretty much do whatever you want with the shading system

Honk
03-31-2004, 12:13 AM
Originally posted by malancha:
Is there any way to do this?
Yes, vertex and fragment programms.

malancha
03-31-2004, 01:25 AM
Thanks, guys.

Can you point me to some tutorials for the techniques you mentioned? I've been googling for a while now, and haven't been able to come up with much.