Search Unity

Need 1 (hopefully) simple shader

Discussion in 'Shaders' started by Drazil, Aug 14, 2014.

  1. Drazil

    Drazil

    Joined:
    Sep 9, 2013
    Posts:
    22
    I am currently working on a personal little project (image below) that will be a kinda tron-ish styled game. Presently I am using a "Self-Illuminated/Diffuse" shader to make the blue (or orange) lines glow but I need a way to transition between the blue and orange textures.


    What I would like if anyone has time to make something is a shader that is pretty much has the same setup as the shader I'm currently using but instead instead of the grayscale image being used to determine what parts of the texture are illuminated have it used to determine how much of the (self illuminated) base color is showing, Also I would like a variable between 0.0 and 1.0 that determines how illuminated the base color is.

    If this task is too much to ask I don't absolutely need it but it would be nice. Presently what I do to transition is i turn up the fog and make the switch when you can't see anything. If I absolutely need to I can just manage this task by generating textures but it would be nice to have a shader for it.

    Here is a demo of what I currently have: https://dl.dropboxusercontent.com/u/62448402/ship.html
     
  2. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    I could be wrong, but don't self illuminated shaders from unity already work like that? you give them a main color (say blue) that tints whatever you have in the base texture or the illumination texture, if you change this color to orange it'll do what you want, you only need to tween the color from blue to orange for the effect you want
     
  3. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    I'm not sure what you mean by
    and
    Both cases could be expressed as
    Code (csharp):
    1. illumResult = baseTex*illumTex
     
  4. drudiverse

    drudiverse

    Joined:
    May 16, 2013
    Posts:
    218
    Last edited: Aug 16, 2014
  5. drudiverse

    drudiverse

    Joined:
    May 16, 2013
    Posts:
    218