-
-
Notifications
You must be signed in to change notification settings - Fork 35.8k
r175 breaks custom shadow because RenderTarget changed to multisampled #30895
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
Comments
The cause lies in |
In the constructor of |
I found the PR #30633. It was a pretty comprehensive PR with a lot of changes. ![]() Here it can see how this.depthTexture = options.depthTexture; was removed. In r174 it was:
I admit I still don't understand why this was omitted. However, this.depthTexture is important for correct communication to the shader. With this one line, everything is fine again. I'll take a closer look to perhaps understand it better. |
Uh oh!
There was an error while loading. Please reload this page.
Description
I created a live example using r174. As soon as I switch to r175, it breaks because in r175 the RenderTarget suddenly sets to multisampled. Even if I set samples in RenderTarget to 1 it doesn't work.
I think the RenderTarget would benefit from a parameter that lets you set it to multisampled or non-multisampled.
I created my own light source, as simple as possible, from lines 221 to 328. In it, I switch between a placeholder depth texture and the scene depth texture. This has the advantage that the shader is initialized from the beginning and I avoid the frame delay that occurs when using threejs light sources if I want to use the shadow map from them for my own shader.
Reproduction steps
I think simply using my working codePen / jsfiddle with r174 and looking at the small, quick-to-understand light source from 221-328 is easier to understand than a long to-do description. 242 to 273 are the interesting parts.
I installed the samplerComparison into my r174. It works fine.
Simply switch from r174 to r175 and in the console you can see that the RenderTarget suddenly delivers a multisampled texture. If I can use multisampled depth textures for the placeholder and the scene depth texture, that would also be a possibility. The important thing is that both have the same nature so that they remain interchangeable at the shader uniform.
P.S. I tried to incorporate a few PRs into r174 that were incorporated into r175. Unfortunately, I don't recognize any PR that could be the cause of the issue. It has to be one of the PRs.
Code
look at live example
Live example
https://codepen.io/Spiri0/pen/ByaeZJV?editors=0010
https://jsfiddle.net/Spiri/k7e8trzv/4/
Screenshots
No response
Version
175
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: