mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-17 18:01:24 +00:00
Fix random texture sampling bug
This commit is contained in:
parent
03d0b09f29
commit
a0b6a0275c
2 changed files with 6 additions and 4 deletions
|
@ -201,6 +201,8 @@ void FGLRenderer::AmbientOccludeScene()
|
||||||
glBindTexture(GL_TEXTURE_2D, mBuffers->AmbientRandomTexture);
|
glBindTexture(GL_TEXTURE_2D, mBuffers->AmbientRandomTexture);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
mSSAOShader->Bind();
|
mSSAOShader->Bind();
|
||||||
mSSAOShader->DepthTexture.Set(0);
|
mSSAOShader->DepthTexture.Set(0);
|
||||||
|
|
|
@ -342,10 +342,10 @@ void FGLRenderBuffers::CreateAmbientOcclusion(int width, int height)
|
||||||
double z = distribution(generator);
|
double z = distribution(generator);
|
||||||
double w = distribution(generator);
|
double w = distribution(generator);
|
||||||
|
|
||||||
randomValues[i * 4 + 0] = (int16_t)clamp(x * 32768.0, -32767.0, 32768.0);
|
randomValues[i * 4 + 0] = (int16_t)clamp(x * 32767.0, -32768.0, 32767.0);
|
||||||
randomValues[i * 4 + 1] = (int16_t)clamp(y * 32768.0, -32767.0, 32768.0);
|
randomValues[i * 4 + 1] = (int16_t)clamp(y * 32767.0, -32768.0, 32767.0);
|
||||||
randomValues[i * 4 + 2] = (int16_t)clamp(z * 32768.0, -32767.0, 32768.0);
|
randomValues[i * 4 + 2] = (int16_t)clamp(z * 32767.0, -32768.0, 32767.0);
|
||||||
randomValues[i * 4 + 3] = (int16_t)clamp(w * 32768.0, -32767.0, 32768.0);
|
randomValues[i * 4 + 3] = (int16_t)clamp(w * 32767.0, -32768.0, 32767.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
AmbientRandomTexture = Create2DTexture("AmbientRandomTexture", GL_RGBA16_SNORM, 4, 4, randomValues);
|
AmbientRandomTexture = Create2DTexture("AmbientRandomTexture", GL_RGBA16_SNORM, 4, 4, randomValues);
|
||||||
|
|
Loading…
Reference in a new issue