Hello! I'm still working on my first 3D game and I just created a simple outline shader that is affecting all meshes in the root node. However, I want to avoid this shader being applied to my player mesh node that is inside the root node too. Is it possible? Any clue?
By design, a screen-space shader will affect the whole viewport. There are a few ways to prevent specific objects from being modified by the screen-space shader, but there is no "one size fits all" way to do this.
For instance, for shaders that use the depth buffer, you can configure the mesh's material to not write to the depth buffer by enabling alpha-blended transparency (even if the material is fully opaque). This will prevent it from casting shadows, so you will have to duplicate the MeshInstance and set the second MeshInstance's Cast Shadow property to Shadows Only if you still want it to cast shadows.
I will try that, @Calinou. Thanks.
You can use 2 viewports, but I find this to be not a great solution, as it makes editing the project difficult. In general, though, full screen shaders affect everything. So the outline will be on everything.
© 2022 - 2024 — McMap. All rights reserved.