Colors over textures

Started by
2 comments, last by illuzion 22 years, 8 months ago
I''ve been playing with lightmaps recently, and I''ve got a few questions about them. Specifically, about a different way of storing / drawing the lighting information. I was looking back over some old opengl demos and one of them was a triangle with different colours at each vertex, that blended in the middle (yes, very simple, but I didn''t know any opengl back then... I still dont ). And it suddenly struck me that this might be a better way of drawing lighting: get light values for each vertex and then, rather than drawing to a bitmap and using multitexturing, draw normally but with colors so the texture is tinted. There a couple of things I want to check with this though... - is it slow? Will this make a speed hit over normal, non-tinted drawing? - will it overlay black as black (shadow) or transparent (useless)? Can it be changed? - etc... has anyone done this? Does anyone have any suggestions? Thanks.
Advertisement
Congratulations! You have discovered vertex lighting. ;-)

Seriously, though. Vertex lighting uses a normal vector to compute the lighting levels at each vertex then, during rendering, blends the resulting "diffuse" colors across the triangle (this is called Gouraud shading and has been around longer than lightmapping).

I suppose you could precompute the colors of the vertices to account for shadows (and speed up rendering a little by not having any lights).

Let us know where you take this. ;P

the major problem with this instead of other methods eg lightmaps is it looks crap, though it is quicker.
I knew this was a pre-existing shading method (I didn''t know it was gouraud though). I guess what I really want to know, is is using a color overlay thing in OpenGL slow?

This topic is closed to new replies.

Advertisement