View Full Version : Question about display lists
07-30-2006, 06:32 AM
I have a display list which is built at startup and contains a simple mesh. Can i alter the mesh color to make the object lighter or darker, without having to rebuild the display list at runtime ?
I tried with a glColor4f() but doesn't work. I guess it is possible only with shaders ?
07-30-2006, 06:36 AM
if the list contains only geometry data (glVertex), you can change the color with glColor before you call glCallList. do you want the mesh to be drawn with only one color?
07-30-2006, 06:48 AM
The list contains geometry, has a white color for all the objects,and bind textures for each object.
Take for example a house: i have a texture for the roof and one for the sides. Both roof and sides have a material color = white.
What i'd like to do is, at run-time, alter the white color so that the house can become greenish, or lighter and so on ...
07-30-2006, 06:50 AM
Well, i tried to remove all the glColor calls in the display generation list routine (as you suggested) and it works now, thanks !
08-01-2006, 08:57 AM
You can put your 'material' calls (glColor*, glBindTexture etc.) in a seperate display list, and call that from within your mesh display list.
That way you can rebuild the material display list when needed (or every frame), and all meshes that call that list pick it up the changes automaticly.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.