- Home /
Question by
Bongmo · Apr 21, 2016 at 10:00 PM ·
shadergameobjectcolortransparency
Transparency cube shader?
I'm trying to make this or something like this: Transparency with Standard Surface shader
I'm using 4.7.1. Script is not working.
I get this errors:
Giving up. Parser is hopelessly lost... at line 14
Syntax error at line 29
Syntax error at line 31
Or is there another way to do something like this?
Comment
Answer by Namey5 · Apr 22, 2016 at 10:11 AM
This is a shader using the Standard lighting model, which requires Unity 5, therefore you have to modify the shader yourself. All you have to change in this instance is the lighting model.
Shader "Custom/Transparent"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader
{
Tags {"Queue" = "Transparent" "RenderType"="Transparent" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert fullforwardshadows alpha:fade
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
fixed4 _Color;
void surf (Input IN, inout SurfaceOutput o)
{
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}