Advertisement

Setting Polygon color in other areas apart form the vertex points

Started by November 26, 2003 03:37 AM
8 comments, last by agent666 21 years, 3 months ago
How do i set the color of a polygon where there isn''t a vertex? I want to do this for lighting. I want to check where points in space are on the polygon and light it orcodinally to how close it is to the light source.
Three options:

Tesselate the geometry so there are more vertices and interpolation is no longer so inaccurate.

Use a texture (for some lighting effects this will require CPU calculations and will be slow, for specular highlights it may be possible to project a texture/use cubemapping to get the right effect).

Use a per-fragment operation (fragment program/shader, register combiners etc).

Enigma

Advertisement
hmm, so how do they do lighting in the tutorial at www.gametutorials.com

Quake3 BSP Loader3

Even when i turn the texturing off in that tutorial and put it in wireframe mode, you can see that the level is made up of mostly triangles and at the middle of the polygons lines (between the vertex points) there is a different colour to the vertex points of that polygon, so they are somehow, setting colour to points between the vertex points.
hiya

Colors are interpolated between points on a polygon. Meening,
point a can be red and point b can be blue thus some where inbetween you''ll have purple. However, thats assuming the
coloring is set for smooth instead of flat.

Cheers.
"Make it a habit to be loyal to the activities that serve the highest part of yourself."
yes but the colours at each vertex point is the same, except there is a different colour between the vertex points with the same colour

ah but thanks anyway, i never knew what that glshademodel thing turned off until you said "However, thats assuming the
coloring is set for smooth instead of flat."



[edited by - Agent666 on November 27, 2003 2:22:33 AM]
hehe, oops yea the shading is set to smooth instead of flat (I was tired!
"Make it a habit to be loyal to the activities that serve the highest part of yourself."
Advertisement
Okay, I downloaded it to see what you are talking about. When you click the right mouse button the level is drawn without textures, but the color changes aren''t from setting the color between vertices. Those are the lightmaps.
hmm so what exactly is a lightmap in short definition? Is it something you can do with an opengl function or is it a texture with colors set with another texture blended over the top or what?
My guess...

A lightmap is a textureMAP with varying light intensities used to multitexture 'over the top of' a 'normal' 'base' texture.
Base texture meaning summin like "An image of a metal thing" for example.

I'd go with your....
"texture with colors set with another texture blended over the top" thing

Lightmap = lighting, lol
Damn I'm drunk


[edited by - TerraX on November 28, 2003 4:46:49 AM]

Check out this article. (or just look at the pictures)

http://www.flipcode.com/articles/article_lightmapping.shtml

This topic is closed to new replies.

Advertisement