Have any of you had problems with having multiple directional lights in your scene all with render mode important?
its a problem with the shader im writing where it does not work well with more than one important render mode. but for unitys standard shader it works fine.
The problem is that some geometry sometimes goes darker randomly. I dont know much about writing shaders.
Shader "Custom/mufirstshader" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Shininess("Shininess", Range(0, 1)) = 0.078125
_Gloss("Gloss", Range(0, 1)) = 0.078125
_MainTex2("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"RenderType"="Transparent" "Queue"="Transparent" "IgnoreProjector"="True"}
LOD 200
Pass {
ZWrite On
ColorMask 0
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : SV_POSITION;
};
v2f vert (appdata_base v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
return o;
}
half4 frag (v2f i) : COLOR
{
return half4 (0,0,0,1);
}
ENDCG
}
CGPROGRAM
#pragma surface surf Standard alpha
#pragma debug
sampler2D _MainTex;
sampler2D _MainTex2;
fixed4 _Color;
half _Shininess;
half _Gloss;
struct Input {
float2 uv_MainTex;
float2 uv_MainTex2;
};
void surf(Input IN, inout SurfaceOutputStandard o) {
// Albedo comes from a texture tinted by color
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
fixed4 c2 = tex2D(_MainTex2, IN.uv_MainTex2);
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = c2.r*_Shininess;
o.Smoothness = c2.g;
o.Alpha = c.a;
}
ENDCG
}
//Fallback "Transparent/Diffuse"
}