-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Wrong multisample quality detected #9269
Comments
In my opinion |
@SuperSodaSea is correct. |
Render textures can be created with a higher multisample rate (as per the above example when using |
Set
pixijs/packages/core/src/framebuffer/FramebufferSystem.ts Lines 472 to 496 in cfe74e0
|
(There are some devices supporting 16-sample framebuffer, so maybe you can try to set 16 instead of |
The line
Works fine for 4. What do the values |
So I think the return value in |
It also says:
So all renderbuffers except those with integer format support at minimum |
So in any way, |
@BarberDucky What does |
@dev7355608 It returns |
It must be a driver bug then. renderer.framebuffer.msaaSamples = [4, 2, 1];
renderTexture.multisample = 2; And what does this return?: gl = renderer.gl;
samples= {};
for (const internalFormat of ['R8', 'RG8', 'RGB8', 'RGB565',
'RGBA4', 'RGB5_A1', 'RGBA8', 'RGB10_A2', 'SRGB8_ALPHA8',
'DEPTH_COMPONENT16', 'DEPTH_COMPONENT24', 'DEPTH_COMPONENT32F',
'DEPTH24_STENCIL8', 'DEPTH32F_STENCIL8', 'STENCIL_INDEX8'])
{
samples[internalFormat] = Array.from(gl.getInternalformatParameter(
gl.RENDERBUFFER, gl[internalFormat], gl.SAMPLES));
}
samples |
So for the first part, the app works, but it seems that there is no visible difference between multisamples 2 and 4. I would like to add that I get As for the second part: DEPTH24_STENCIL8: [16, 8, 4]
DEPTH32F_STENCIL8: [16, 8, 4]
DEPTH_COMPONENT16: [16, 8, 4]
DEPTH_COMPONENT24: [16, 8, 4]
DEPTH_COMPONENT32F: [16, 8, 4]
R8: [16, 8, 4]
RG8: [16, 8, 4]
RGB5_A1: [16, 8, 4]
RGB8: [16, 8, 4]
RGB10_A2: [16, 8, 4]
RGB565: [16, 8, 4]
RGBA4: [16, 8, 4]
RGBA8: [16, 8, 4]
SRGB8_ALPHA8: [16, 8, 4]
STENCIL_INDEX8: [16, 8, 4, 1] |
Not sure if this is the relevant code, but I found this: here I guess we can just filter out samples above |
Current Behavior
Property
renderer.multisample
returns 4 (MSAA_QUALITY.MEDIUM
).Expected Behavior
WebGL Report reports the framebuffer parameter
Max Samples
to be 8. It is therefore expected that the propertyrenderer.multisample
should return 8 (MSAA_QUALITY.HIGH
).Steps to Reproduce
On a device which has framebuffer parameter
Max Samples
equal to 8, simply read therenderer.multisample
property.Environment
pixi.js
version: 7.1.4Possible Solution
The code for
MultisampleSystem
determines the multisample quality by accessing thegl.SAMPLES
constant, both for WebGL1 and WebGL2. Same thing forFramebufferSystem
on one occasion. However, WebGL2 has an additional constant used for multisampling —gl.MAX_SAMPLES
. This is the one that WebGL Report uses. These two values are different, first one being 4, second being 8. I couldn't find what these two constants represent exactly and what is the difference between them.If it is decided that
gl.MAX_SAMPLES
is the one to be used, the solution would probably be to read this value instead ofgl.SAMPLES
for WebGL2.The text was updated successfully, but these errors were encountered: