Archived

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

illuzion

Colors over textures

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites