- Home /
Odd transparency effects
Hi.
I'm working on a mesh and I have to allow user to control transparency of the mesh through a controler. Fact : when i turn every materials in Transparent one, i get very odds transparency effects even with 0 transparency, it's like some normals were suddendly inverted.
I've tried to make my own custom script, it actually works (+ specular yay) but i still have this effect...
Thanks a lot for whom will be able to help me, i'm stuck on this problem till 4 hours.
I can't tell this way, but perhaps you can single out the object and tell a bit more about the material ?
$$anonymous$$y first thought was z-fighting, but I assume there's nothing wrong with the object itself ? (like accidentally duplicated polygons).
I've spend some hours on the deep internet trying to solve this.
I came to the point that it's due to the way unity is rendering objects when there is transparent object ; zbuffer apparently trigger its rendering priority from back to front (of the camera). And because the ground is "flat" and is as "near" as "far" of the camera, the ground is rendered first, and only after this the building is rendered, making this odd effect : the ground is above the building...
The only way i've found to counter this is to change priority in RenderTag of the Shader. Technically, if i write 1 shader per $$anonymous$$aterial (~10 for my scene), and i put in RenderTag = Transparent+1 / +2 / +3 etc... i'd be able to change the rendering priority order.
I'm trying to script this ; at Start, the script is changing the RenderTag of each $$anonymous$$aterial to renders each $$anonymous$$aterial properly.
But so far this is where i'm stucked, i don't know if it's even possible to change the RenderTag through a script :/ $$anonymous$$y line looks like this :
function Start(){ for (var child in Transform){ child.renderer.material.TagRenderer = ("Geometry+"+$i); $i++; }
Anyone knows how to change/instantiate TagRenderer through of 1 Shader applied on 10 $$anonymous$$aterials with a single script ?
Your answer
![](https://koobas.hobune.stream/wayback/20220613121710im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Edge Detection (effect normals) with water (transparent) error. 0 Answers
Receiving shadows by transparent floor 0 Answers
Transparency / Fade Material Shading Issues 0 Answers
surface shading with transparency 1 Answer
Shader Question about Alpha 0 Answers