Jump to content

Apply shader to a single object - alpha problem


Recommended Posts

Hello, I struggle with a really tough thing. I want to apply shader to a single object and everything would be easy and cool but there is 1 problem. Objects have alpha animation when they are streamed in and when I apply shader to a certain object (engineApplyShaderToWorldTexture with 2nd argument set on "*") it doesn't affect on the object when it isn't fully visible. My shader uses vertex and pixel functions but it doesn't really matter - any shader applied to an object has the same problem. This shader changes object's geometry so it looks stupid when you see the original object (without the shader) and when you go closer it appears and finally changes its geometry.
Worth to mention that when I use engineApplyShaderToWorldTexture without 3rd argument shader works perfectly but you know, I don't want to apply it to all objects which have a given texture name but to just 1 element. This problem dissapears when I apply the shader to a single object which was created with LOD argument set on true. I tried to create custom LOD and apply shader on it but with no effect.

https://streamable.com/vg1a6r
Short video shows that when alpha is less than 100% we see the original object and when it fully appears shader starts working.

Edited by Krzysztof
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...