Skip to content
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

GPURenderer transparent vs non-transparent texture issue #133

Open
rohan-deshpande opened this issue Nov 19, 2020 · 0 comments
Open

GPURenderer transparent vs non-transparent texture issue #133

rohan-deshpande opened this issue Nov 19, 2020 · 0 comments

Comments

@rohan-deshpande
Copy link
Collaborator

rohan-deshpande commented Nov 19, 2020

Currently non transparent textures will be given background colours when the GPURenderer is used in a three WebGLRenderer alpha: true context.

Screen Shot 2020-11-20 at 7 32 58 am

^ Notice how every texture other than the middle one has a black square background.

This can be "solved" in two ways. Firstly, turn alpha: true off for the WebGLRenderer. Not ideal, as the user may want to have a transparent canvas.

Secondly, we could change the fragment shader gl_FragColor calculation from

gl_FragColor = gl_FragColor * texture2D(uTexture, uv)

to

gl_FragColor = gl_FragColor * texture2D(uTexture, uv).rgbr

However this borks transparent textures

Screen Shot 2020-11-20 at 9 04 25 am

^ Notice how the middle texture looks completely different now to the first image.

We do need to support both, so for now, we will leave things as is and ask users to do alpha: false if they are using non transparent textures, saying the alternative is not supported right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant