Apply floodlight to vertex lighting (there seems to remain some problem with
vertexlighting not receiving enough bounced light)
This commit is contained in:
parent
0c20b6e140
commit
ff8feb8f31
|
|
@ -2584,6 +2584,8 @@ void IlluminateVertexes( int num )
|
|||
rawLightmap_t *lm;
|
||||
bspDrawVert_t *verts;
|
||||
trace_t trace;
|
||||
float floodLightAmount;
|
||||
vec3_t floodColor;
|
||||
|
||||
|
||||
/* get surface, info, and raw lightmap */
|
||||
|
|
@ -2661,11 +2663,20 @@ void IlluminateVertexes( int num )
|
|||
VectorCopy( verts[ i ].normal, trace.normal );
|
||||
|
||||
/* r7 dirt */
|
||||
if( dirty )
|
||||
if( dirty && !bouncing )
|
||||
dirt = DirtForSample( &trace );
|
||||
else
|
||||
dirt = 1.0f;
|
||||
|
||||
/* jal: floodlight */
|
||||
floodLightAmount = 0.0f;
|
||||
VectorClear( floodColor );
|
||||
if( floodlighty && !bouncing )
|
||||
{
|
||||
floodLightAmount = floodlightIntensity * FloodLightForSample( &trace, floodlightDistance, floodlight_lowquality );
|
||||
VectorScale( floodlightRGB, floodLightAmount, floodColor );
|
||||
}
|
||||
|
||||
/* trace */
|
||||
LightingAtSample( &trace, ds->vertexStyles, colors );
|
||||
|
||||
|
|
@ -2674,6 +2685,9 @@ void IlluminateVertexes( int num )
|
|||
{
|
||||
/* r7 dirt */
|
||||
VectorScale( colors[ lightmapNum ], dirt, colors[ lightmapNum ] );
|
||||
|
||||
/* jal: floodlight */
|
||||
VectorAdd( colors[ lightmapNum ], floodColor, colors[ lightmapNum ] );
|
||||
|
||||
/* store */
|
||||
radVertLuxel = RAD_VERTEX_LUXEL( lightmapNum, ds->firstVert + i );
|
||||
|
|
@ -2720,6 +2734,9 @@ void IlluminateVertexes( int num )
|
|||
{
|
||||
/* r7 dirt */
|
||||
VectorScale( colors[ lightmapNum ], dirt, colors[ lightmapNum ] );
|
||||
|
||||
/* jal: floodlight */
|
||||
VectorAdd( colors[ lightmapNum ], floodColor, colors[ lightmapNum ] );
|
||||
|
||||
/* store */
|
||||
radVertLuxel = RAD_VERTEX_LUXEL( lightmapNum, ds->firstVert + i );
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user