- Home /
Issue when switching from deferred to forward lighting.
Since deferred lighting is to expensive on lower end systems I have the option to switch to forward rendering in my game.
The problem is that the dynamic models are not properly lit anymore. Like the button in the image below.
Will the "use in forward rendering" flag fix this issue? Where did the link to download the shader sources go too? Can't find the shader sources on the asset store either. So I can try to modify them with the dualforward parameter. Unless someone already has done this and made it availeble to others?
You can get the shader source code for the shaders in each build from here: http://unity3d.com/unity/download/archive
Thanks, I tried modifying the shaders, either I am doing it wrong, its bugged or its not related to my issue.
Shader "DualForward/Self-Illu$$anonymous$$/Bumped Diffuse" {
Properties {
_Color ("$$anonymous$$ain Color", Color) = (1,1,1,1)
_$$anonymous$$ainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
_Illum ("Illu$$anonymous$$ (A)", 2D) = "white" {}
_Bump$$anonymous$$ap ("Normalmap", 2D) = "bump" {}
_EmissionL$$anonymous$$ ("Emission (Lightmapper)", Float) = 0
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 300
CGPROGRA$$anonymous$$
#pragma surface surf Lambert dualforward
sampler2D _$$anonymous$$ainTex;
sampler2D _Bump$$anonymous$$ap;
sampler2D _Illum;
fixed4 _Color;
struct Input {
float2 uv_$$anonymous$$ainTex;
float2 uv_Illum;
float2 uv_Bump$$anonymous$$ap;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 tex = tex2D(_$$anonymous$$ainTex, IN.uv_$$anonymous$$ainTex);
fixed4 c = tex * _Color;
o.Albedo = c.rgb;
o.Emission = c.rgb * UNITY_SA$$anonymous$$PLE_1CHANNEL(_Illum, IN.uv_Illum);
o.Alpha = c.a;
o.Normal = UnpackNormal(tex2D(_Bump$$anonymous$$ap, IN.uv_Bump$$anonymous$$ap));
}
ENDCG
}
FallBack "DualForward/Self-Illu$$anonymous$$/Diffuse"
}
Answer by Bluestrike · Apr 26, 2013 at 07:56 AM
I forgot recompiling the level with the "use in forward rendering" check for the lightmapper. It improves the issue a bit:
The dynamic model part (the button) is still a bit lighter and has a popup effect at sertain range but its no longer fullbright. Adding the dualforward command to the shader has no effect at all...
Your answer
Follow this Question
Related Questions
Problem with shadow casting on transparent material 0 Answers
Shader for Overlapping LIghts 0 Answers
Poor performance in Forward Rendering 0 Answers
Deferred Light Rendering: Prevent additional lighting passes on pixels in overlapping point lights 0 Answers
Yet Another Forward Rendering, Lightmap and Bump shader question 1 Answer