-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
readRenderTargetPixels() works for WebGLRenderTarget but is all 0 for WebGL3DRenderTarget #28501
Comments
An alternative cause would be that RTT 3D does not work - but I do not see a reason for it. |
Thank you for testing. (r156 was just my dev environment - I will change it in the bug report) Any idea why the output is 0,0,0 on my system? I tried the fiddle in Firefox & Chrome and on Laptop and Workstation - same result - always 0,0,0 for 3D render target :-( |
Oh, I misunderstood your bug report. I was assuming you had issues with an older version of Since you are using Chrome, do you mind typing |
So I tried on 3 browsers on 2 systems - the output is consistent: Here is the output of the Notebook: Workstation: I wonder if it is a read or a write problem. |
Is the plane in the following fiddle red or white on your systems? https://jsfiddle.net/9ecums7j/1/ The demo has two passes. The first one renders the scene into the first layer of a 3D render target. The second one uses the first layer as a texture for a plane mesh. |
Using a normal render target is incompatible with the custom shader since it uses So it seems there is an issue with rendering into 3D render targets on your devices. Or there is an issue with using them as a texture. Maybe the call of This is unfortunately not something we can fix in this repository. Would you mind reporting the issue at the Chromium bug tracker (https://issues.chromium.org/issues)? Please attach your Chrome GPU reports, a link to this issue and the below fiddle. I've simplified it a bit so it is focused on the most important things: https://jsfiddle.net/47donLx0/ I've also changed the color semantics. Green color means using the 3D render target as a texture works as expected. |
BTW: Do you see any WebGL warnings in the browser console on the affected devices? Just want to be sure we do not overlook something obvious... |
Will do. |
If it's a GPU driver issue, the used browser does not necessarily matter. If the Chromium devs conclude the root cause is driver related, they might adapt a workaround on browser level or redirect the issue to the GPU vendor. |
An added datapoint: I have the same issues, I came across it while implementing WebGL3DRenderTarget in the WebGPURenderer. In my tests I also noted a flash of color sometimes appearing in the developer console window which I had open as usual. An elderly MacBook works OK for Safari and Chrome (116 - it hadn't been used for a while) and Chrome 125. |
If the problem is in ANGLE, the Chromium bug tracker is definitely the right sport to report the issue. |
@aardgoose Out of curiosity: Does the reproduction test case also fail on your affected systems? You should see a green plane in https://jsfiddle.net/47donLx0/ |
@Mugen87 Yes, I was just using your test case, I wasn't assuming my patches worked! |
This looks like it's related to, if not a duplicate of, #25353 which shows that rendering to 3d render targets fails in D3D backends (which is used in both reported platforms here). Unfortunately there's been no movement from Chromium in well over a year: |
@gkjohnson It does look very similar. As noted I saw screen corruption (flashes of color in the developer tools console panel. |
Thanks for mentioning #25353. Before filing a new issue at the Chromium bug tracker, it's probably better to bump the existing one with a new comment. I'll do that later. Besides, it's not much but maybe it would help if more devs upvote the bug at the Chromium bug tracker. This can be done here: ![]() |
@aardgoose Someone from the Chromium team tested the fiddle with different systems with Vulkan backend and couldn't reproduce, see https://issues.chromium.org/issues/40890022#comment12. Do you mind responding at the bug tracker and share a Chrome GPU report as an attachment of an affected system using Vulkan? |
Two follow-up questions:
Thx |
AFAIK, mostly Linux systems. Recent Apple devices use Metal. You can check this by opening
You can force a backend when starting the browser via console. However, it is no lasting setting and the selected backend might not be supported on your system. For macOS, it looks like so using Chrome Canary.
|
Description
I am using a shader to write to a 3D render target.
To debug the result I am using renderer.readRenderTargetPixels()
The result for WebGLRenderTarget is correct, the result for WebGL3DRenderTarget is all zero.
Reproduction steps
Please check the fiddle:
Code
See fiddle for complete example.
Live example
https://jsfiddle.net/92xa60g4/25/
Screenshots
No response
Version
r164
Device
Desktop
Browser
Chrome
OS
Windows
The text was updated successfully, but these errors were encountered: