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 oliver-jones · Oct 03, 2013 at 12:26 PM · guilighting3dscene

Plane Object as GUI - Lighting Issue

Hello,

I'm using planes and quads for backgrounds to my GUI panels within my actual scene. Because of this, the object is taking on lighting behaviours, which I do not want.

Is there away to tell the game object/shader to completely ignore lighting? Because right now, I'm using a directional lightly specifically for my GUIs, which I do not want.

I want to be able to use the absolute colour I have defined in the material shader.

If it helps, I have this shader that allows you to apply an absolute textures to a game object that doesn't take on any lighting (used for GUI too):

 Shader "GUI/Texture Only" {
 
 Properties {
     _Color ("Main Color", Color) = (.5,.5,.5,1)
     _MainTex ("Texture", 2D) = ""
 }
 
 SubShader {Pass {    // iPhone 3GS and later
     GLSLPROGRAM
     varying mediump vec2 uv;
     
     #ifdef VERTEX
     void main() {
         gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
         uv = gl_MultiTexCoord0.xy;
     }
     #endif
     
     #ifdef FRAGMENT
     uniform lowp sampler2D _MainTex;
     void main() {
         gl_FragColor = texture2D(_MainTex, uv);
     }
     #endif        
     ENDGLSL
 }}
 
 SubShader {Pass {    // pre-3GS devices, including the September 2009 8GB iPod touch
     SetTexture[_MainTex]
 }}
  
 }
Comment
Add comment · Show 4
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 KiraSensei · Oct 03, 2013 at 03:05 PM 0
Share

Personnally, for a 3D game, I use a second camera to handle GUI textures, rendered after the first one. So the second camera (and the GUI planes, objects...) does not move at all, so no problems with lights :)

avatar image oliver-jones · Oct 03, 2013 at 03:22 PM 0
Share

That's what I am doing - I have one camera to render only my GUIs, and another to render everything else. Even with this, the game objects that are being used as GUIs still react to light. I've changed them to the Unlit shader, and it seems to look just fine. Thanks

avatar image robertbu · Oct 03, 2013 at 03:31 PM 1
Share

If the problem is solved, please close the question.

avatar image oliver-jones · Oct 03, 2013 at 03:38 PM 0
Share

Could you do me a favour and convert your comment to an answer so I can mark it correct. Thanks.

1 Reply

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

Answer by robertbu · Oct 03, 2013 at 02:50 PM

There are lots of shaders that don't take on lighting. Try Unlit/Texture for example. And there are many more including ones on the Wiki.

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

15 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 avatar image avatar image avatar image

Related Questions

Changing start scene gui size main menu 0 Answers

How can I allow a player to select from multiple scenes to load? 4 Answers

A 2D GUI in mid air, for oculus, tracking an object. 1 Answer

Changing 3d text through script 1 Answer

How to render pixelated light? 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