mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- disable any texture clamping for textures with a user shader.
This cannot be reliably determined so the least restrictive setting must be used.
This commit is contained in:
parent
3a6e05710a
commit
6076f0a69d
1 changed files with 4 additions and 4 deletions
|
@ -310,6 +310,10 @@ void FRenderState::SetMaterial(FMaterial *mat, int clampmode, int translation, i
|
|||
mShaderTimer = mat->tex->shaderspeed;
|
||||
SetSpecular(mat->tex->Glossiness, mat->tex->SpecularLevel);
|
||||
|
||||
if (tex->UseType == ETextureType::SWCanvas) clampmode = CLAMP_NOFILTER;
|
||||
if (tex->bHasCanvas) clampmode = CLAMP_CAMTEX;
|
||||
else if ((tex->bWarped || tex->shaderindex >= FIRST_USER_SHADER) && clampmode <= CLAMP_XY) clampmode = CLAMP_NONE;
|
||||
|
||||
// avoid rebinding the same texture multiple times.
|
||||
if (mat == lastMaterial && lastClamp == clampmode && translation == lastTranslation) return;
|
||||
lastMaterial = mat;
|
||||
|
@ -320,10 +324,6 @@ void FRenderState::SetMaterial(FMaterial *mat, int clampmode, int translation, i
|
|||
int maxbound = 0;
|
||||
auto tex = mat->tex;
|
||||
|
||||
if (tex->UseType == ETextureType::SWCanvas) clampmode = CLAMP_NOFILTER;
|
||||
if (tex->bHasCanvas) clampmode = CLAMP_CAMTEX;
|
||||
else if (tex->bWarped && clampmode <= CLAMP_XY) clampmode = CLAMP_NONE;
|
||||
|
||||
// Textures that are already scaled in the texture lump will not get replaced by hires textures.
|
||||
int flags = mat->isExpanded() ? CTF_Expand : (gl_texture_usehires && tex->Scale.X == 1 && tex->Scale.Y == 1 && clampmode <= CLAMP_XY) ? CTF_CheckHires : 0;
|
||||
int numLayers = mat->GetLayers();
|
||||
|
|
Loading…
Reference in a new issue