OpenGL2: Fix merged lightmap hacks to have real lightmap index
This fixes the texcoord range to be 0.0 to 1.0 for external lightmaps in shaders that also have an internal lightmap. (Instead of 2.0 to 3.0 for example.) This only affects clampMap as repeating wrapping sampled the correct location. I haven't found such a shader but I need to get real lightmap index for future merged lightmap hacks.
This commit is contained in:
1 parent
7426ac2176
commit
eaefa35580
3 files changed
+17
-6
No files matched your search
@@ -617,7 +617,7 @@ static shader_t *ShaderForShaderNum( int shaderNum, int lightmapNum ) {
|
||||
lightmapNum = LIGHTMAP_WHITEIMAGE;
|
||||
}
|
||||
|
||||
shader = R_FindShader( dsh->shader, lightmapNum, qtrue );
|
||||
shader = R_FindShaderEx( dsh->shader, FatLightmap( lightmapNum ), qtrue, lightmapNum );
|
||||
|
||||
// if the shader had errors, just use default shader
|
||||
if ( shader->defaultShader ) {
|
||||
@@ -706,7 +706,7 @@ static void ParseFace( dsurface_t *ds, drawVert_t *verts, float *hdrVertColors,
|
||||
surf->fogIndex = LittleLong( ds->fogNum ) + 1;
|
||||
|
||||
// get shader value
|
||||
surf->shader = ShaderForShaderNum( ds->shaderNum, FatLightmap(realLightmapNum) );
|
||||
surf->shader = ShaderForShaderNum( ds->shaderNum, realLightmapNum );
|
||||
if ( r_singleShader->integer && !surf->shader->isSky ) {
|
||||
surf->shader = tr.defaultShader;
|
||||
}
|
||||
@@ -813,7 +813,7 @@ static void ParseMesh ( dsurface_t *ds, drawVert_t *verts, float *hdrVertColors,
|
||||
surf->fogIndex = LittleLong( ds->fogNum ) + 1;
|
||||
|
||||
// get shader value
|
||||
surf->shader = ShaderForShaderNum( ds->shaderNum, FatLightmap(realLightmapNum) );
|
||||
surf->shader = ShaderForShaderNum( ds->shaderNum, realLightmapNum );
|
||||
if ( r_singleShader->integer && !surf->shader->isSky ) {
|
||||
surf->shader = tr.defaultShader;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user