Can someone explain vertex color?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
junglist
Posts: 21
Joined: Thu Dec 18, 2003 8:00 am

Can someone explain vertex color?

Post by junglist »

And is vertex lighting related?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

More or less. The vertex color is usually computed by averaging the color of the pixels in the vertex's texture. Vertex lighting means traditional OpenGL lighting, i.e. skipping the lightmap step.
junglist
Posts: 21
Joined: Thu Dec 18, 2003 8:00 am

Post by junglist »

Here's where I'm confused: when you say "the vertex's texture", how is a vertex's texture determined?
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

He means that the pixels of the texture applied to the surface is averaged to yield the vertex color.

Vertex colour and vertex lighting are simply a set of RGB and sometimes alpha values attributed to each vertex point of an object. Lets say that you have a square surface, with the top two vertices with vertex colour white (1 1 1) and the bottom two vertices set with vertex colour black (0 0 0). The surface of the square will have a gradient running from black to white, bottom up.

Vertex lighting and vertex colour work essentially the same way. The only difference being how they are used. You can "paint" static vertex colours onto a model in a 3D modeling app, or you can let the game automatically generate and/or modify the vertex lighting on the model as it moves around (ie. player/weapon models).
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
junglist
Posts: 21
Joined: Thu Dec 18, 2003 8:00 am

Post by junglist »

That makes more sense. It was just hard for me to think of a single point in space as having its own color/texture. :)

Thanks both.
Post Reply