fixed invalid skybox texture mip/filter settings

This commit is contained in:
myT 2023-03-02 18:57:49 +01:00
parent 693415a6e2
commit c75b2b27fa
3 changed files with 10 additions and 3 deletions

View File

@ -100,6 +100,8 @@ chg: with r_backend GL3, depth fade with MSAA now requires GLSL 4.00 at a minimu
chg: with r_backend GL3, alpha to coverage now requires GLSL 4.00 at a minimum
fix: invalid skybox texture mip-mapping and filtering settings (e.g. cpm25 skybox seams)
fix: in render batches with multiple shaders where the second or later surface had a shader using
"rgbGen lightingDiffuse", the colors would be wrong and crashes could occur

View File

@ -506,9 +506,14 @@ static void ParseTriSurf( const dsurface_t* ds, const drawVert_t* verts, msurfac
static void ParseFlare( const dsurface_t* ds, msurface_t* surf )
{
// @NOTE: we don't support/render flares, so we shouldn't load shaders:
// 1. it could create resources that are never used to render the map
// 2. it could force loading images used elsewhere with the wrong settings
// e.g. the cpm25 skybox would end up not being set up as clampMap
static surfaceType_t flare = SF_FLARE;
surf->fogIndex = LittleLong( ds->fogNum ) + 1;
surf->shader = ShaderForShaderNum( ds->shaderNum, LIGHTMAP_BY_VERTEX );
//surf->shader = ShaderForShaderNum( ds->shaderNum, LIGHTMAP_BY_VERTEX );
surf->shader = tr.defaultShader;
surf->data = &flare;
}

View File

@ -1140,7 +1140,7 @@ static void ParseSkyParms( const char** text )
if ( strcmp( token, "-" ) ) {
for (i = 0; i < 6; ++i) {
Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga", token, suf[i] );
shader.sky.outerbox[i] = R_FindImageFile( pathname, IMG_NOMIPMAP | IMG_NOPICMIP, TW_CLAMP_TO_EDGE );
shader.sky.outerbox[i] = R_FindImageFile( pathname, IMG_NOPICMIP, TW_CLAMP_TO_EDGE );
if ( !shader.sky.outerbox[i] ) {
shader.sky.outerbox[i] = tr.defaultImage;
}
@ -1168,7 +1168,7 @@ static void ParseSkyParms( const char** text )
if ( strcmp( token, "-" ) ) {
for (i = 0; i < 6; ++i) {
Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga", token, suf[i] );
shader.sky.innerbox[i] = R_FindImageFile( pathname, IMG_NOMIPMAP | IMG_NOPICMIP, TW_REPEAT );
shader.sky.innerbox[i] = R_FindImageFile( pathname, IMG_NOPICMIP, TW_CLAMP_TO_EDGE );
if ( !shader.sky.innerbox[i] ) {
shader.sky.innerbox[i] = tr.defaultImage;
}