xuxiandi / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

texture2D(sampler, coord, bias) does not match OpenGL #233

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run 
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conforma
nce/glsl/samplers/glsl-function-texture2d-bias.html

What is the expected output? 

It passes, drawing each the colors from each mip

What do you see instead?

It's mixing the mips even though sampling is set to GL_LINEAR_MIPMAP_NEAREST 

Original issue reported on code.google.com by g...@chromium.org on 25 Oct 2011 at 5:26

GoogleCodeExporter commented 9 years ago
It's passing fine on my system (Windows 7 x64, Chrome Canary 17.0.917.0, ANGLE 
r803, GeForce 330M).

Original comment by nicolas....@gmail.com on 25 Oct 2011 at 6:31

GoogleCodeExporter commented 9 years ago
On a system with an Intel HD Grpahics 2000, all mipmap levels are incorrect.

Interestingly it doesn't seem like it's simply using the wrong bias and 
blending mipmaps:

bias 0 - expected: 255,000,000 was 255,128,128
bias 1 - expected: 000,255,000 was 255,128,128
bias 2 - expected: 000,000,255 was 128,255,128
bias 3 - expected: 255,255,000 was 128,128,255
bias 4 - expected: 255,000,255 was 255,255,128
bias 5 - expected: 000,255,255 was 255,128,255
bias 6 - expected: 255,128,128 was 128,255,255
bias 7 - expected: 128,128,128 was 255,191,191
bias 8 - expected: 128,255,128 was 191,191,191

It appears to be rendering a brighter version of the mipmap one level above the 
intended one...

Original comment by nicolas....@gmail.com on 25 Oct 2011 at 2:07

GoogleCodeExporter commented 9 years ago
I believe some NVIDIA cards (at least the 8800, probably others) fail the 
texldb DCT test, so that could explain this. I know ATI cards pass the test, 
but no clue about Intel.

Original comment by j...@baumanfamily.com on 25 Oct 2011 at 2:57

GoogleCodeExporter commented 9 years ago
It doesn't pass on my ATI 4850

Original comment by g...@chromium.org on 25 Oct 2011 at 4:07

GoogleCodeExporter commented 9 years ago
It looks like this is caused by multi-sampling...

Original comment by nicolas....@gmail.com on 25 Oct 2011 at 6:21

GoogleCodeExporter commented 9 years ago
What does that mean? I'm drawing a solid color, there's no blending and I'm 
drawing to the entire backbuffer.

Is the bug in the test itself or is the bug that tex2Dbias fails to do the 
correct thing with multi-sampling on?

Original comment by g...@google.com on 25 Oct 2011 at 8:18

GoogleCodeExporter commented 9 years ago
This got fixed by turning off anti-aliasing in the test.

The problem was that anti-aliasing enabled centroid sampling, which changed the 
texture coordinates slightly and thereby also the mipmap LOD calculation, 
affecting which level gets sampled by tex2Dbias. The centroid issue itself got 
fixed in r1192, which addressed issue 340.

Original comment by nicolas....@gmail.com on 30 Oct 2012 at 7:27