int vertexupdatenum;
int r_shadow_buffer_numleafpvsbytes;
-qbyte *r_shadow_buffer_leafpvs;
+unsigned char *r_shadow_buffer_leafpvs;
int *r_shadow_buffer_leaflist;
int r_shadow_buffer_numsurfacepvsbytes;
-qbyte *r_shadow_buffer_surfacepvs;
+unsigned char *r_shadow_buffer_surfacepvs;
int *r_shadow_buffer_surfacelist;
rtexturepool_t *r_shadow_texturepool;
if (r_shadow_buffer_leaflist)
Mem_Free(r_shadow_buffer_leaflist);
r_shadow_buffer_numleafpvsbytes = numleafpvsbytes;
- r_shadow_buffer_leafpvs = (qbyte *)Mem_Alloc(r_shadow_mempool, r_shadow_buffer_numleafpvsbytes);
+ r_shadow_buffer_leafpvs = (unsigned char *)Mem_Alloc(r_shadow_mempool, r_shadow_buffer_numleafpvsbytes);
r_shadow_buffer_leaflist = (int *)Mem_Alloc(r_shadow_mempool, r_shadow_buffer_numleafpvsbytes * 8 * sizeof(*r_shadow_buffer_leaflist));
}
if (r_shadow_buffer_numsurfacepvsbytes < numsurfacepvsbytes)
if (r_shadow_buffer_surfacelist)
Mem_Free(r_shadow_buffer_surfacelist);
r_shadow_buffer_numsurfacepvsbytes = numsurfacepvsbytes;
- r_shadow_buffer_surfacepvs = (qbyte *)Mem_Alloc(r_shadow_mempool, r_shadow_buffer_numsurfacepvsbytes);
+ r_shadow_buffer_surfacepvs = (unsigned char *)Mem_Alloc(r_shadow_mempool, r_shadow_buffer_numsurfacepvsbytes);
r_shadow_buffer_surfacelist = (int *)Mem_Alloc(r_shadow_mempool, r_shadow_buffer_numsurfacepvsbytes * 8 * sizeof(*r_shadow_buffer_surfacelist));
}
}
{
int x, y, z, d;
float v[3], intensity;
- qbyte *data;
+ unsigned char *data;
R_FreeTexturePool(&r_shadow_texturepool);
r_shadow_texturepool = R_AllocTexturePool();
r_shadow_attenpower = r_shadow_lightattenuationpower.value;
r_shadow_attenscale = r_shadow_lightattenuationscale.value;
#define ATTEN2DSIZE 64
#define ATTEN3DSIZE 32
- data = (qbyte *)Mem_Alloc(tempmempool, max(ATTEN3DSIZE*ATTEN3DSIZE*ATTEN3DSIZE*4, ATTEN2DSIZE*ATTEN2DSIZE*4));
+ data = (unsigned char *)Mem_Alloc(tempmempool, max(ATTEN3DSIZE*ATTEN3DSIZE*ATTEN3DSIZE*4, ATTEN2DSIZE*ATTEN2DSIZE*4));
for (y = 0;y < ATTEN2DSIZE;y++)
{
for (x = 0;x < ATTEN2DSIZE;x++)
{
// ARB2 GLSL shader path (GFFX5200, Radeon 9500)
int surfacelistindex;
- qboolean doambientbase = r_shadow_rtlight->ambientscale * VectorLength2(lightcolorbase) > 0.00001 && basetexture != r_texture_black;
- qboolean dodiffusebase = r_shadow_rtlight->diffusescale * VectorLength2(lightcolorbase) > 0.00001 && basetexture != r_texture_black;
- qboolean doambientpants = r_shadow_rtlight->ambientscale * VectorLength2(lightcolorpants) > 0.00001 && pantstexture != r_texture_black;
- qboolean dodiffusepants = r_shadow_rtlight->diffusescale * VectorLength2(lightcolorpants) > 0.00001 && pantstexture != r_texture_black;
- qboolean doambientshirt = r_shadow_rtlight->ambientscale * VectorLength2(lightcolorshirt) > 0.00001 && shirttexture != r_texture_black;
- qboolean dodiffuseshirt = r_shadow_rtlight->diffusescale * VectorLength2(lightcolorshirt) > 0.00001 && shirttexture != r_texture_black;
+ qboolean dobase = (r_shadow_rtlight->ambientscale + r_shadow_rtlight->diffusescale) * VectorLength2(lightcolorbase) > 0.00001 && basetexture != r_texture_black;
+ qboolean dopants = (r_shadow_rtlight->ambientscale + r_shadow_rtlight->diffusescale) * VectorLength2(lightcolorpants) > 0.00001 && pantstexture != r_texture_black;
+ qboolean doshirt = (r_shadow_rtlight->ambientscale + r_shadow_rtlight->diffusescale) * VectorLength2(lightcolorshirt) > 0.00001 && shirttexture != r_texture_black;
qboolean dospecular = specularscale * VectorLength2(lightcolorbase) > 0.00001 && glosstexture != r_texture_black;
// TODO: add direct pants/shirt rendering
- if (doambientpants || dodiffusepants)
+ if (dopants)
R_Shadow_RenderSurfacesLighting_Light_GLSL(ent, texture, numsurfaces, surfacelist, lightcolorpants, vec3_origin, vec3_origin, pantstexture, r_texture_black, r_texture_black, normalmaptexture, r_texture_black, 0, modelorg);
- if (doambientshirt || dodiffuseshirt)
+ if (doshirt)
R_Shadow_RenderSurfacesLighting_Light_GLSL(ent, texture, numsurfaces, surfacelist, lightcolorshirt, vec3_origin, vec3_origin, shirttexture, r_texture_black, r_texture_black, normalmaptexture, r_texture_black, 0, modelorg);
- if (!doambientbase && !dodiffusebase && !dospecular)
+ if (!dobase && !dospecular)
return;
R_Mesh_TexMatrix(0, &texture->currenttexmatrix);
R_Mesh_TexBind(0, R_GetTexture(normalmaptexture));
int shadowmeshes, shadowtris, numleafs, numleafpvsbytes, numsurfaces;
entity_render_t *ent = r_refdef.worldentity;
model_t *model = r_refdef.worldmodel;
- qbyte *data;
+ unsigned char *data;
// compile the light
rtlight->compiled = true;
R_Shadow_EnlargeLeafSurfaceBuffer(model->brush.num_leafs, model->num_surfaces);
model->GetLightInfo(ent, rtlight->shadoworigin, rtlight->radius, rtlight->cullmins, rtlight->cullmaxs, r_shadow_buffer_leaflist, r_shadow_buffer_leafpvs, &numleafs, r_shadow_buffer_surfacelist, r_shadow_buffer_surfacepvs, &numsurfaces);
numleafpvsbytes = (model->brush.num_leafs + 7) >> 3;
- data = (qbyte *)Mem_Alloc(r_shadow_mempool, sizeof(int) * numleafs + numleafpvsbytes + sizeof(int) * numsurfaces);
+ data = (unsigned char *)Mem_Alloc(r_shadow_mempool, sizeof(int) * numleafs + numleafpvsbytes + sizeof(int) * numsurfaces);
rtlight->static_numleafs = numleafs;
rtlight->static_numleafpvsbytes = numleafpvsbytes;
rtlight->static_leaflist = (int *)data;data += sizeof(int) * numleafs;
- rtlight->static_leafpvs = (qbyte *)data;data += numleafpvsbytes;
+ rtlight->static_leafpvs = (unsigned char *)data;data += numleafpvsbytes;
rtlight->static_numsurfaces = numsurfaces;
rtlight->static_surfacelist = (int *)data;data += sizeof(int) * numsurfaces;
if (numleafs)
vec3_t lightcolor;
int numleafs, numsurfaces;
int *leaflist, *surfacelist;
- qbyte *leafpvs;
+ unsigned char *leafpvs;
int numlightentities;
int numshadowentities;
entity_render_t *lightentities[MAX_EDICTS];
rtexture_t *R_Shadow_LoadCubemap(const char *basename)
{
int i, j, cubemapsize;
- qbyte *cubemappixels, *image_rgba;
+ unsigned char *cubemappixels, *image_rgba;
rtexture_t *cubemaptexture;
char name[256];
// must start 0 so the first loadimagepixels has no requested width/height
{
cubemapsize = image_width;
// note this clears to black, so unavailable sides are black
- cubemappixels = (qbyte *)Mem_Alloc(tempmempool, 6*cubemapsize*cubemapsize*4);
+ cubemappixels = (unsigned char *)Mem_Alloc(tempmempool, 6*cubemapsize*cubemapsize*4);
}
// copy the image with any flipping needed by the suffix (px and posx types don't need flipping)
if (cubemappixels)