-
-
Notifications
You must be signed in to change notification settings - Fork 35.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
Problem with LUTPass and WebGL1 #21502
Comments
/ping @gkjohnson |
It seems Safari is complaining about this line using three.js/examples/jsm/postprocessing/LUTPass.js Lines 37 to 39 in 05e9ac7
I'm not sure what the WebGL spec dictates but it seems like some weird behavior from Safari. Either way I think a solution is to update the ShaderMaterial fragment shader to manually exclude that line if using WebGL1 / 2D LUT rather than a #define. |
This is no Safari specific issue. When I use If |
three.js/examples/jsm/postprocessing/LUTPass.js Lines 37 to 39 in 05e9ac7
Yes, I guess this would be a good way to implement it, without changing to much. There is also the option of having 2 shaders and have the LUTPass pick the appropriate one. I guess that would render a lot of code, though. |
Oh I missed that! I must have changed that since I originally tested with WebGL1.
My plan was to make a function that would conditionally include the snippets currently inside the |
I have this solution currently working in both WebGL1 and 2 (Safari and Chrome): Should I make a Pull Request for this one? I don't know if it is up to the coding standards, I just did it my way. Need this feature working tomorrow in a showcase. :). I have also made changes to the html of the example. Just fixed a variable spelling error in the parameters. |
Here's the diff: nilsrydell@7936ca7?w=1 |
I'll take a look at the diff and make a PR with updated formatting this weekend if that sounds good @nilsrydell. Thanks! |
@gkjohnson Yes, sure sound great :). |
I think this issue might actually be caused by this line which occurs outside of the preprocessor directives. |
Describe the bug
The LUTPass is not rendering output when used in a WebGL1 context (Safari and IOS). I have tried both the example (https://threejs.org/examples/?q=post#webgl_postprocessing_3dlut) and my own code with no luck.
Chrome and WebGL2 seems to work fine. Safari on desktop and on IOS produce the same errors to console:
To Reproduce
Run this demo in Safari or IOS Safari: https://threejs.org/examples/?q=post#webgl_postprocessing_3dlut
Platform:
The text was updated successfully, but these errors were encountered: