Change multisampling count to 0, improved fix/workaround for AMD GPUs (#26)

Part of fixing graphical rendering bugs: https://github.com/iceiix/steven/issues/25
Corrupted graphics on AMD video cards: https://github.com/Thinkofname/steven/issues/74

The previous workaround set NUM_SAMPLES to 2, but this added an extra texel fetch. Setting to 1 reproduces the 16px blue striped unexpected behavior. Setting to 0 samples avoids the extra fetch and the striping.

This is allowed per http://docs.gl/gl3/glTexImage2DMultisample:
> samples specifies the number of samples in the image and must be in the range zero to GL_MAX_SAMPLES - 1.
This commit is contained in:
iceiix 2018-11-18 16:18:16 -08:00 committed by GitHub
parent e12ea17aaa
commit 748911a91b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,7 @@ use std::sync::mpsc;
const ATLAS_SIZE: usize = 1024;
// TEMP
const NUM_SAMPLES: i32 = 2;
const NUM_SAMPLES: i32 = 0;
pub struct Camera {
pub pos: cgmath::Point3<f64>,

View File

@ -15,6 +15,7 @@ void main() {
for (int i = 1; i < samples; i++) {
col += texelFetch(tcolor, C, i);
}
if (samples != 0)
col /= float(samples);
float r = accum.a;