pixels += ( y * width * 4 ) + ( x * 4 );
VectorCopy( pixels, color );
color[ 3 ] = pixels[ 3 ];
+
+ if ( texturesRGB ) {
+ color[0] = Image_LinearFloatFromsRGBFloat( color[0] * ( 1.0 / 255.0 ) ) * 255.0;
+ color[1] = Image_LinearFloatFromsRGBFloat( color[1] * ( 1.0 / 255.0 ) ) * 255.0;
+ color[2] = Image_LinearFloatFromsRGBFloat( color[2] * ( 1.0 / 255.0 ) ) * 255.0;
+ }
+
return qtrue;
}
float st[ 2 ], lightmap[ 2 ], *radLuxel;
radVert_t *rv[ 3 ];
+ if (!bouncing)
+ Sys_Printf( "BUG: RadSample: !bouncing shouldn't happen\n" );
/* initial setup */
ClearBounds( mins, maxs );
static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm, shaderInfo_t *si,
float scale, float subdivide, qboolean original, radWinding_t *rw, clipWork_t *cw ){
- int i, style;
+ int i, style = 0;
float dist, area, value;
vec3_t mins, maxs, normal, d1, d2, cross, color, gradient;
light_t *light, *splash;
/* bouncing light? */
if ( bouncing == qfalse ) {
+ /* This is weird. This actually handles surfacelight and not
+ * bounces. */
+
/* handle first-pass lights in normal q3a style */
value = si->value;
light->photons = value * area * areaScale;
light->dist = DotProduct( light->origin, normal );
}
+ if (light->photons < 0 || light->add < 0 || light->color[0] < 0 || light->color[1] < 0 || light->color[2] < 0)
+ Sys_Printf( "BUG: RadSubdivideDiffuseLight created a darkbulb\n" );
+
/* emit light from both sides? */
if ( si->compileFlags & C_FOG || si->twoSided ) {
light->flags |= LIGHT_TWOSIDED;
void RadLightForTriangles( int num, int lightmapNum, rawLightmap_t *lm, shaderInfo_t *si, float scale, float subdivide, clipWork_t *cw ){
int i, j, k, v;
bspDrawSurface_t *ds;
- surfaceInfo_t *info;
float *radVertexLuxel;
radWinding_t rw;
/* get surface */
ds = &bspDrawSurfaces[ num ];
- info = &surfaceInfos[ num ];
/* each triangle is a potential emitter */
rw.numVerts = 3;
contentFlags = surfaceFlags = compileFlags = 0;
ApplySurfaceParm( "nodraw", &contentFlags, &surfaceFlags, &compileFlags );
+ // jal : avoid bouncing on trans surfaces
+ ApplySurfaceParm( "trans", &contentFlags, &surfaceFlags, &compileFlags );
+
/* early outs? */
if ( scale <= 0.0f || ( si->compileFlags & C_SKY ) || si->autosprite ||
( bspShaders[ ds->shaderNum ].contentFlags & contentFlags ) || ( bspShaders[ ds->shaderNum ].surfaceFlags & surfaceFlags ) ||