Archived

This topic is now archived and is closed to further replies.

Colour source for shading with lights off

This topic is 5504 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, If you have lighting calculations turned off, is it possible to have polygons shaded using the colour information set in the current material? If not, then why? Cheers, BD.

Share this post


Link to post
Share on other sites
The material is used in the direct3d "lighting engine" vertex shading pipeline to get vertex diffuse and specular values, which the fixed-function fragment pipeline can then interpolate over the face. As such, when you disable the lighting engine, the vertex colors are not computed by direct3d for you each frame. If you want to give your polygons color without the lighting engine enabled, you can fill in the diffuse (and specular if you want) entries in your vertex data, and the fragment pipeline will then interpolate those values just the same as if they came out of the d3d lighting engine.

So to summarize, you can take whatever parts of your material you want, do some manual lighting either at runtime or as a preprocessing step, and put the values into the vertex color entries. These values can then be used to blend with textures or whatever else you want to do.

Share this post


Link to post
Share on other sites