- Home /
Question by
Hawaiianspawn · Apr 02, 2017 at 10:09 AM ·
shadershadersmaterials
Holes in Occlusion Culling a transparent object
I am trying to write a shader uses proper occlusion culling. But I get these transparent blocks within the texture.
The normals are facing out and UV's are not overlapping.
I just want to know what I should be looking for in solutions. I'm out of ideas what it could be.
Shader "Custom/YellingTransparent" {
Properties
{
_MainTex("Texture", 2D) = "white" {}
_InnerColor("Inner Color", Color) = (1.0, 1.0, 1.0, 1.0)
_RimColor("Rim Color", Color) = (0.26,0.19,0.16,0.0)
_RimPower("Rim Power", Range(0.5,8.0)) = 3.0
}
SubShader
{
Tags{ "Queue" = "Transparent" }
//Cull Front
Cull Back
Blend One One
ZWrite On
LOD 200
CGPROGRAM
#pragma surface surf Lambert
struct Input
{
float2 uv_MainTex;
float3 viewDir;
};
sampler2D _MainTex;
float4 _InnerColor;
float4 _RimColor;
float _RimPower;
void surf(Input IN, inout SurfaceOutput o)
{
o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgba * _InnerColor;
half rim = 1.0 - saturate(dot(normalize(IN.viewDir), o.Normal));
o.Emission = _RimColor.rgba * pow(rim, _RimPower);
}
ENDCG
}
Fallback "Diffuse"
}
Comment
Your answer
Follow this Question
Related Questions
Put new Shaders into older version of unity 0 Answers
Is it worth keeping the built-in render pipeline? 0 Answers
Shader for highlighting on mouse over, multiple shaders or property on shader? 0 Answers
How can I edit Material Textures without creating a new Shader?,How to edit Material Texture 1 Answer
a 'bar' or neon like light. 3 Answers