Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Bluestrike · Apr 23, 2013 at 08:56 AM · shaderdeferred renderingforward rendering

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. alt text

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?

forwardissue.jpg (12.6 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image whydoidoit · Apr 23, 2013 at 09:31 AM 0
Share

You can get the shader source code for the shaders in each build from here: http://unity3d.com/unity/download/archive

avatar image Bluestrike · Apr 26, 2013 at 06:56 AM 0
Share

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"
 }

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

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...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges