From: jal Date: Sat, 12 Jun 2010 11:36:06 +0000 (+0200) Subject: Apply floodlight to vertex lighting (there seems to remain some problem with X-Git-Tag: xonotic-v0.5.0~255^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ff8feb8f314e7f5d445b267853eeca022906bf05;p=xonotic%2Fnetradiant.git Apply floodlight to vertex lighting (there seems to remain some problem with vertexlighting not receiving enough bounced light) --- diff --git a/tools/quake3/q3map2/light_ydnar.c b/tools/quake3/q3map2/light_ydnar.c index 6a54389e..70c728d0 100644 --- a/tools/quake3/q3map2/light_ydnar.c +++ b/tools/quake3/q3map2/light_ydnar.c @@ -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 );