Vertex Lighting in the Existing Demos

The way vertex lighting is working in the existing demos is that
only two pass shaders (lightmap * texture) were collapsed to a
single pass, all other shaders stayed the same.

Xian added some chrome and energy effects to parts of q3tourney2,
which changed them from two pass to three pass shaders. We felt
that that 50% increase on those polygons was justified in normal
play, but as people have pointed out, when you are playing with
vertex lighting, that three passes stays three passes instead
of collapsing to a single pass, resulting in a 300% increase
on those polygons over the way it was before. Still faster than
lightmap mode, but a large variance over other parts of the level.

Today I wrote new code to address that, and improve on top of it.

Now when r_vertexlight is on, I force every single shader to a
single pass. In the cases where it isn’t a simple light*texture
case, I try and intelligently pick the most representative pass
and do some fixups on the shader modulations.

This works our great, and brings the graphics load down to the
minimum we can do with the data sets.

Performance is still going to be down a couple msec a frame due to
using dynamic compilation instead of dll’s for the cgame, but that
is an intentional tradeoff. You can obviously slow things down by
running a lot of bots, but that is to be expected.

I am still investigating the high idle dedicated server cpu utilization
and a few other issues. The server cpu time will definately be
higher than 1.08 due to the dynamic compiler, but again, that is
an intentional tradeoff.

A set of go-fast-and-look-ugly options:
r_mode 2
r_colorbits 16
r_texturemode GL_LINEAR_MIPMAP_NEAREST
r_vertexlighting 1
r_subdivisions 999
r_lodbias 2
cg_gibs 0
cg_draw3dicons 0
cg_brassTime 0
cg_marks 0
cg_shadows 0
cg_simpleitems 1
cg_drawAttacker 0

* icons for bot skills on scoreboard
* r_vertexlight is now “force single pass” for all shaders
* modified cd key check to be fire and forget on the client
* file handle debugging info in path command
* network address type of NA_BAD for failed resolves
* better command line variable overriding
* cache scoreboard for two seconds
* sync sound system before starting cinematics
* fixed many escapes disconnect from server exiting the game
* fixed shotgun pellets underwater expending all temp entities

Leave a Reply