Hi, I’m trying to make a character that it’s a ghost, but every material I tried with transparency looks ugly, because the intern and back parts of the chracter mesh could be seen from outside (e.g. eyeballs, backpack, etc.).
Is there any way to make a transparent objet, hiding its own components that shouldn’t be seen?
Thank you very much!
Try this.
Shader “Transparent/Fade” {
Properties {
_Color (“Main Color”, Color) = (1,1,1,1)
_MainTex (“Base (RGB) Trans (A)”, 2D) = “white” {}
}
SubShader {
Tags {“RenderType”=“Transparent” “Queue”=“Transparent+2”}
// Render into depth buffer only
Pass {
ColorMask 0
}
Pass {
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
ColorMask RGB
Material {
Diffuse [_Color]
Ambient [_Color]
}
Lighting On
SetTexture [_MainTex] {
constantColor [_Color]
Combine texture * primary DOUBLE, texture * primary
}
}
}
}
That’s perfect! Thank you very much!