-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
GLES2 WebGL DEPTH_TEXTURE Feedback loop error #46883
Comments
This was originally the plan for Godot 3.x, but we'll keep GLES3 if this proposal goes through. We can reimplement GLES3 in 4.0 with a more low-end approach to make it more compatible.
This is because built-in shaders in GLES3 are more complex and therefore take more time to compile. |
@Calinou Do you have any workaround ideas for this? I am trying to create shader for positional fog which affects all nodes in certain area. Similar to fog in WorldEnvironment but with static position. |
You can place a procedural plane or cube in the world using MeshInstance + SpatialMaterial, then enable Proximity Fade on the SpatialMaterial and increase the fade distance. You can change the fog color by changing the material's albedo color, and toggle unshaded mode if you don't want lighting to impact fog. This should give you a nice fixed-position fog effect as long as the camera doesn't enter the volume. |
I will try that, thanks! |
Any hope for this getting fixed? I could use GLES3 but the slower shader compilation speeds are really unfortunate :( |
Nobody knows how to fix this, so it will take a while before this is fixed. |
Fixed by #80481 |
@clayjohn I still have this issue in Godot 3.6 beta 4 and when building 3.x from source. Has the issue been reintroduced? |
@singfisher Are you using the exact same code from this bug report? It is still possible to run into this error for other reasons (i.e. if you pass a ViewportTexture into a shader that is used in that Viewport). |
@clayjohn Yes, I just tried with the minimal reproduction project linked above and see the error in both 3.6 beta 4 and 3.x latest |
I took a look at relevant PRs made after and it doesn't seem like any of them would have re-introduced this issue. Sorry to be excessively picky, is there any chance you are using out of date export templates. In other words, when you build from source, are you building both the editor and export templates and then using your custom export template? |
Thank you for checking. No problem. I built the export templates myself and copied them over to the templates folder with the appropriate names. However, I have left the "Custom Template" Debug and Release fields in the export dialog empty - do I need to do anything with those? Only other possible irregularities: I copied the Base Class Libraries from 3.6 beta 4. I also do not have the mono module enabled in the export templates despite the editor having it enabled. |
The "Custom Template" Debug and Release fields should point towards your custom export templates. I think the engine copies the export templates to a shared location when you "install" them. So just replacing the templates won't be enough. |
When using the Custom Template fields I still see the issue unfortunately :( |
Thanks for bearing with me. CC @lawnjelly |
Oh yep, still seems to be occurring in 3.6 beta 4. I'll see if I can build the web version and work out why. UPDATE: It resets and clears the active textures in I have tried clearing all the texture slots in the reset, and that doesn't fix the problem here in web build, so the logic for which active textures are in use seems unlikely to be the source of this continuing bug. It may be that we need to call UPDATE: Firefox generates a more useful error message:
I suspect the problem is it is trying to read from depth while also writing to depth at the same time in the same shader, maybe this is not supported on web, I'm not really expert in this area. Graphics Frame Analyzer shows on desktop the input texture (2033) is also the output depth (2033). This may not be supported. In order to do this you might need to write depth on one pass, then read on a separate pass with a different depth output maybe. But I'm not really familiar with this area. |
Issue description:
I am trying to use this snippet https://docs.godotengine.org/en/3.2/tutorials/shading/screen-reading_shaders.html#depth-texture
to create post-processing shader which uses pixels world position to calculate new color.
It doesn't seem to work on browser with GLES2 if modifying ALBEDO and console gets filled with:
GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture.
However it seems to work with GLES3 on HTML5 but isn't GLES3 going to be deprecated for browser? Also for me HTML5 GLES3 projects loads longer when starting it.
Here is the shader:
On native and Godot editor the shader works as expected and you should see this:
Godot version:
3.2.3.stable.official
OS/device including version:
Linux with Nvidia Drivers (460.39) - WebGL with GLES2
Chromium 89
Minimal reproduction project:
GLES2 Webgl Bug.zip
The text was updated successfully, but these errors were encountered: