Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

true rgb color shader that does not react to lights

Discussion in 'Shaders' started by verbatimline, Apr 8, 2009.

  1. verbatimline

    verbatimline

    Joined:
    Mar 24, 2009
    Posts:
    88
    Is there a shader in which I can apply a texture and have the actual rgb colors render without being influenced by lights?
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Try this:

    Code (csharp):
    1. Shader "Texture Simple" {
    2.     Properties {
    3.         _MainTex ("Base (RGB)", 2D) = "white"
    4.     }
    5.     SubShader {
    6.         Pass {
    7.             SetTexture [_MainTex]
    8.         }
    9.     }
    10. }
     
  3. verbatimline

    verbatimline

    Joined:
    Mar 24, 2009
    Posts:
    88
    hi daniel, thanks for your response. Where would I put that?
     
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Just go to Assets -> Create -> Shader

    Then open the shader in Unitron and paste the code right there. Then on a material click the drop down menu and go to Texture Simple.
     
  5. verbatimline

    verbatimline

    Joined:
    Mar 24, 2009
    Posts:
    88
    unitron? That is your script editor correct?
     
  6. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    Yes, but it comes with Unity. Just double-click the shader file and it should open.

    -Jeremy
     
  7. verbatimline

    verbatimline

    Joined:
    Mar 24, 2009
    Posts:
    88
    awesome thanks man! 8)
     
  8. verbatimline

    verbatimline

    Joined:
    Mar 24, 2009
    Posts:
    88
    Hey Daniel,
    How would you have it render a 2dTexture?
     
  9. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    What do you mean?
     
  10. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    render to a 2d texture would require Unity Pro and then use RenderTexture
     
  11. verbatimline

    verbatimline

    Joined:
    Mar 24, 2009
    Posts:
    88
    I mean, I would like the user to apply their image to the side of a cube. I laid out the uvs of the cube so that the image appears on all sides but that would require a 2dTexture correct?