Hey Iv'e been trying out an old shader code, I can post a link to it later but i’m on another computer right now.
Anyway the shader makes objects fade into the distance, but I’ve found when applied to models with a transparent "Black rgb 000" background the transparency stops working and I get a black box visible around the model. any idea how to might be able to resolve this problem?
Shader messes with the transparency
Moderator: Moderators
Re: Shader messes with the transparency
Here's an example of the glsl shader Iv'e been trying to use.
http://www.revengeofthesunfish.com/fog_ ... ng.zgeproj
When I run the example I see the images disappear suddenly rather than fade.
Is there a fix to get this shader to fade gradually and keep transparency with flat models?
http://www.revengeofthesunfish.com/fog_ ... ng.zgeproj
When I run the example I see the images disappear suddenly rather than fade.
Is there a fix to get this shader to fade gradually and keep transparency with flat models?
Re: Shader messes with the transparency
Hi jinxtengu,
K
It's because your alpha test is set to "greater than 0.5". Any pixel that fails that test won't get rendered. Either adjust the threshold value ( why not use greater than 0 ) or mix with "vec4(0,0,0,1)" instead of "vec4(0,0,0,0)" in your fragment shader .. depends a little on how you want things to work.
K
Re: Shader messes with the transparency
Thanks. I got it working now. I was adding the alpha test without even realising it could be edited. I just assumed it was either on or off, I see now it works with a threashold, which makes sense.