vertex lighting?


(ACROBAT) #1

I have to Q’s for whoever.

  1. What is vertex lighting and why\when should I use it?

  2. I made some terrain in easygen a while back with a metashader. I put a yavin shader in jko on and the terrain was pitch black. I then tried a jka skybox that used the q3map2 commands and the ground was lit up. Does this have anything to do with vertex lighting? Why did one skybox work and the other not?


(Shallow) #2

If the sky didn’t cast any light at all, chances are you just didn’t have it in shaderlist.txt, although as this was a map you did a while back it’s a bit difficult to confirm that now.

Vertex lighting is generally used on models but can also be used on surfaces derived from brushes or patches. Vertex lighting bakes colour information into each vertex on a drawsurf (triangle mesh created by Q3map2 from input brush/etc. data). A vertex is a point in 3D space that defines one corner of a triangle. Typically vertices will be shared between several triangles.

Vertex lighting is good when you want to save texture memory and speed up rendering. It doesn’t require a seperate pass to render it like a lightmap does. Less passes generally means faster rendering, although this should be less of a concern on modern hardware.

Terrain can look OK with vertex lighting sometimes, it depends on the sky lighting and whether the terrain has appropriate vertex density in the right areas.

If you have smallish mapobjects that have a lot of triangles in relative to their size, it’s usually silly to lightmap them. The lighting detail you get by using vertex lighting on these objects will usually be the same or better than you would get from lightmapping, and on complex objects Q3map2’s automated projections for lightmap UVs can often turn out oddly.


(ACROBAT) #3

The basic qmap skyboxes in default jko do cast light and did in this case, but it did not light up the easygen terrain. Another person i know just had the same problem. My model was lit up but the terrain wasn’t.