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

A truly lightmap shader !

Discussion in 'Shaders' started by maxxoros, May 7, 2009.

  1. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    Well, this is, for some one who interest in baking art and wonder about the weakness of lightmapper, that the fact is black multiply texture.

    This is the issue of current lightmapper



    Well, we lose the glow/exposure point that make scene really dull.

    So I decide to make a mod to current lightmapper shader, add a exposure control texture. You will see the different here



    New Lightmapper
    Code (csharp):
    1. Shader "Lightmapped/DiffuseMod" {
    2.     Properties {
    3.         _Color ("Main Color", Color) = (1,1,1,1)
    4.         _MainTex ("Base (RGB)", 2D) = "white" {}
    5.         _LightMap ("Lightmap (RGB)", 2D) = "black" {}
    6.         _LightMap2 ("Exposure map (RGB)", 2D) = "black" {}         
    7.     }
    8.     SubShader {
    9.         UsePass "Lightmapped/VertexLitMod/BASE"
    10.         UsePass "Diffuse/PPL"
    11.     }
    12.     FallBack "Lightmapped/VertexLit", 1
    13. }

    New lightmapper Dependency


    Code (csharp):
    1. Shader "Lightmapped/VertexLitMod" {
    2. Properties {
    3.     _Color ("Main Color", Color) = (1,1,1,1)
    4.     _SpecColor ("Spec Color", Color) = (1,1,1,1)
    5.     _Shininess ("Shininess", Range (0.01, 1)) = 0.7
    6.     _MainTex ("Base (RGB)", 2D) = "white" {}
    7.     _LightMap ("Lightmap (RGB)", 2D) = "black" {}
    8.     _LightMap2 ("Lightmap (RGB)", 2D) = "black" {}     
    9. }
    10.  
    11. // ------------------------------------------------------------------
    12. // Three texture cards (Radeons, GeForce3/4Ti and up)
    13.  
    14. SubShader {
    15.     Blend AppSrcAdd AppDstAdd
    16.     Fog { Color [_AddFog] }
    17.  
    18.     // Ambient pass
    19.     Pass {
    20.         Name "BASE"
    21.         Tags {"LightMode" = "PixelOrNone"}
    22.         Color [_PPLAmbient]
    23.         BindChannels {
    24.             Bind "Vertex", vertex
    25.             Bind "normal", normal
    26.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    27.             Bind "texcoord", texcoord1 // lightmap uses 2nd uv         
    28.             Bind "texcoord1", texcoord2 // main uses 1st uv
    29.         }
    30.        
    31.    
    32.         SetTexture [_LightMap] {
    33.             constantColor [_Color]
    34.             combine texture * constant
    35.         }
    36.        
    37.         SetTexture [_MainTex] {
    38.             constantColor [_Color]
    39.             combine texture * previous
    40.         }
    41.        
    42.         SetTexture [_LightMap2] {
    43.             constantColor [_Color]
    44.             combine texture + previous
    45.         }      
    46.     }
    47.    
    48.     // Vertex lights
    49.     Pass {
    50.         Name "BASE"
    51.         Tags {"LightMode" = "Vertex"}
    52.         Material {
    53.             Diffuse [_Color]
    54.             Shininess [_Shininess]
    55.             Specular [_SpecColor]
    56.         }
    57.  
    58.         Lighting On
    59.         SeparateSpecular On
    60.  
    61.         BindChannels {
    62.             Bind "Vertex", vertex
    63.             Bind "normal", normal
    64.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    65.             Bind "texcoord1", texcoord1 // lightmap uses 2nd uv
    66.             Bind "texcoord", texcoord2 // main uses 1st uv
    67.         }
    68.        
    69.         SetTexture [_LightMap] {
    70.             constantColor [_Color]
    71.             combine texture * constant
    72.         }
    73.         SetTexture [_LightMap] {
    74.             constantColor (0.5,0.5,0.5,0.5)
    75.             combine previous * constant + primary
    76.         }
    77.         SetTexture [_MainTex] {
    78.             combine texture * previous DOUBLE, texture * primary
    79.         }
    80.     }
    81. }
    82.  
    83. // ------------------------------------------------------------------
    84. // Dual texture cards - draw in two passes
    85.  
    86. SubShader {
    87.     Blend AppSrcAdd AppDstAdd
    88.     Fog { Color [_AddFog] }
    89.  
    90.     // Always drawn base pass: texture * lightmap
    91.     Pass {
    92.         Name "BASE"
    93.         Tags {"LightMode" = "Always"}
    94.         Color [_PPLAmbient]
    95.         BindChannels {
    96.             Bind "Vertex", vertex
    97.             Bind "normal", normal
    98.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    99.             Bind "texcoord", texcoord1 // main uses 1st uv
    100.         }
    101.         SetTexture [_LightMap] {
    102.             constantColor [_Color]
    103.             combine texture * constant
    104.         }
    105.         SetTexture [_MainTex] {
    106.             combine texture * previous, texture * primary
    107.         }
    108.     }
    109.    
    110.     // Vertex lights: add lighting on top of base pass
    111.     Pass {
    112.         Name "BASE"
    113.         Tags {"LightMode" = "Vertex"}
    114.         Material {
    115.             Diffuse [_Color]
    116.             Shininess [_Shininess]
    117.             Specular [_SpecColor]
    118.         }
    119.  
    120.         Lighting On
    121.         SeparateSpecular On
    122.        
    123.         ColorMask RGB
    124.  
    125.         SetTexture [_MainTex] {
    126.             combine texture * primary DOUBLE, texture
    127.         }
    128.     }
    129. }
    130.  
    131. // ------------------------------------------------------------------
    132. // Single texture cards - lightmap and texture in two passes; no lighting
    133.  
    134. SubShader {
    135.     Blend AppSrcAdd AppDstAdd
    136.     Fog { Color [_AddFog] }
    137.  
    138.     // Base pass: lightmap
    139.     Pass {
    140.         Name "BASE"
    141.         Tags {"LightMode" = "Always"}
    142.         BindChannels {
    143.             Bind "Vertex", vertex
    144.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    145.         }
    146.         SetTexture [_LightMap] { constantColor [_Color] combine texture * constant }
    147.     }
    148.    
    149.     // Second pass: modulate with texture
    150.     Pass {
    151.         Name "BASE"
    152.         Tags {"LightMode" = "Always"}
    153.         BindChannels {
    154.             Bind "Vertex", vertex
    155.             Bind "texcoord", texcoord0 // main uses 1st uv
    156.         }
    157.         Blend Zero SrcColor
    158.         SetTexture [_MainTex] { combine texture }
    159.     }
    160. }
    161.  
    162. Fallback "VertexLit", 1
    163.  
    164. }
    165.  
    And this is texture sample for lightmap and exposure slot



    Now I think I can not do anything more because of lacking knowledge. :oops: :? :( . These thing need to be done:

    1. Add a control brightness and contrast for exposure texture. This will save tone of time open back and forth PS for editing picture. However, If, this affect much to FPS ?
    2. Fix code with the following
    • Vertex lights
      Dual texture cards - draw in two passes
      Single texture cards - lightmap and texture in two passes; no lighting
    3. A simpler work flow for generate these kind of texture !!!
     
  2. GaborD

    GaborD

    Joined:
    Jul 9, 2007
    Posts:
    42
    You could maybe also try playing with the blendmodes instead of using an extra exposure map.
    A mod x 2 blend should be easily doable in Unity and would let your lightmaps look like they do in the 3D tool (if exposure is set up correctly in the 3D package) because they can also brighten up the base texture and not just darken it like with multiply blending.
    I haven't played with it in Unity yet, but use the blend-style in other engines (NF, OGRE, Blitz3D) all the time for lightmaps. Will try around in Unity when I get home tonight.
    Don't hurt me if I am wrong, I am a Unity newbie.
     
  3. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Yeah, built-in Lightmapped shaders do multiplication (that is, lightmap can only darken the base texture).

    Another approach, like you outlined, is to have lightmaps that can both darken and lighten the texture.

    I think doing "combine texture * previous double" when combining the lightmap the main texture is the most efficient way (that way, gray color in the lightmap would do nothing; darker colors would darken and lighter colors would brighten).
     
  4. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    I understand the way re-use of lightmap to an "add" mode. However, problem is, data inside lightmap is not enough for the exposure enhancement in most case. The black and white data inside lightmap CAN NOT stand for all exposure data that texture should have after lighting



    So In theory, we usually talk about re-add lightmap to gain exposure, but that doesnot bring the reality and the mood we have when rendering, especially If we are working with GI engine like MR or VR, that really sensitive in exposure data.

    I have finishing develop a toolkit to solve all matter come out with this method, from baking to transfering data into Unity. However It will need a little time of testing before I release to community :D :D :D
     
  5. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    I really don't understand the problem with Aras' solution, or what you're trying to accomplish beyond getting a brighter result out of light maps.

    In Unity, dynamic lights add texture*lightColor*2, which allows the overbright effect you're talking about. Unity 2 added an intensity value for lights that gets multiplied in as well, allowing users to get new extremes of brightness.

    The lightmap shaders that come with Unity only add texture*lightmapColor, which results in the purely darkening effect you see.

    Aras' solution would give you texture*lightmapColor*2, which results in the same magnitudes as lights of intensity 1.

    If that's still not bright enough for you, you could quadruple the result while still keeping everything in fixed function.
     
  6. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Here, I implemented Aras' suggestion:

    Code (csharp):
    1. Shader "Lightmapped*2/VertexLit" {
    2. Properties {
    3.     _Color ("Main Color", Color) = (1,1,1,1)
    4.     _SpecColor ("Spec Color", Color) = (1,1,1,1)
    5.     _Shininess ("Shininess", Range (0.01, 1)) = 0.7
    6.     _MainTex ("Base (RGB)", 2D) = "white" {}
    7.     _LightMap ("Lightmap (RGB)", 2D) = "black" {}
    8. }
    9.  
    10. // ------------------------------------------------------------------
    11. // Three texture cards (Radeons, GeForce3/4Ti and up)
    12.  
    13. SubShader {
    14.     Blend AppSrcAdd AppDstAdd
    15.     Fog { Color [_AddFog] }
    16.  
    17.     // Ambient pass
    18.     Pass {
    19.         Name "BASE"
    20.         Tags {"LightMode" = "PixelOrNone"}
    21.         Color [_PPLAmbient]
    22.         BindChannels {
    23.             Bind "Vertex", vertex
    24.             Bind "normal", normal
    25.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    26.             Bind "texcoord", texcoord1 // main uses 1st uv
    27.         }
    28.         SetTexture [_LightMap] {
    29.             constantColor [_Color]
    30.             combine texture * constant DOUBLE
    31.         }
    32.         SetTexture [_MainTex] {
    33.             constantColor [_Color]
    34.             combine texture * previous, texture * constant
    35.         }
    36.     }
    37.    
    38.     // Vertex lights
    39.     Pass {
    40.         Name "BASE"
    41.         Tags {"LightMode" = "Vertex"}
    42.         Material {
    43.             Diffuse [_Color]
    44.             Shininess [_Shininess]
    45.             Specular [_SpecColor]
    46.         }
    47.  
    48.         Lighting On
    49.         SeparateSpecular On
    50.  
    51.         BindChannels {
    52.             Bind "Vertex", vertex
    53.             Bind "normal", normal
    54.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    55.             Bind "texcoord1", texcoord1 // lightmap uses 2nd uv
    56.             Bind "texcoord", texcoord2 // main uses 1st uv
    57.         }
    58.        
    59.         SetTexture [_LightMap] {
    60.             constantColor [_Color]
    61.             combine texture * constant
    62.         }
    63.         SetTexture [_LightMap] {
    64.             combine previous + primary
    65.         }
    66.         SetTexture [_MainTex] {
    67.             combine texture * previous DOUBLE, texture * primary
    68.         }
    69.     }
    70. }
    71.  
    72. // ------------------------------------------------------------------
    73. // Dual texture cards - draw in two passes
    74.  
    75. SubShader {
    76.     Blend AppSrcAdd AppDstAdd
    77.     Fog { Color [_AddFog] }
    78.  
    79.     // Always drawn base pass: texture * lightmap
    80.     Pass {
    81.         Name "BASE"
    82.         Tags {"LightMode" = "Always"}
    83.         Color [_PPLAmbient]
    84.         BindChannels {
    85.             Bind "Vertex", vertex
    86.             Bind "normal", normal
    87.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    88.             Bind "texcoord", texcoord1 // main uses 1st uv
    89.         }
    90.         SetTexture [_LightMap] {
    91.             constantColor [_Color]
    92.             combine texture * constant DOUBLE
    93.         }
    94.         SetTexture [_MainTex] {
    95.             combine texture * previous, texture * primary
    96.         }
    97.     }
    98.    
    99.     // Vertex lights: add lighting on top of base pass
    100.     Pass {
    101.         Name "BASE"
    102.         Tags {"LightMode" = "Vertex"}
    103.         Material {
    104.             Diffuse [_Color]
    105.             Shininess [_Shininess]
    106.             Specular [_SpecColor]
    107.         }
    108.  
    109.         Lighting On
    110.         SeparateSpecular On
    111.        
    112.         ColorMask RGB
    113.  
    114.         SetTexture [_MainTex] {
    115.             combine texture * primary DOUBLE, texture
    116.         }
    117.     }
    118. }
    119.  
    120. // ------------------------------------------------------------------
    121. // Single texture cards - lightmap and texture in two passes; no lighting
    122.  
    123. SubShader {
    124.     Blend AppSrcAdd AppDstAdd
    125.     Fog { Color [_AddFog] }
    126.  
    127.     // Base pass: lightmap
    128.     Pass {
    129.         Name "BASE"
    130.         Tags {"LightMode" = "Always"}
    131.         BindChannels {
    132.             Bind "Vertex", vertex
    133.             Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
    134.         }
    135.         SetTexture [_LightMap] { constantColor [_Color] combine texture * constant DOUBLE}
    136.     }
    137.    
    138.     // Second pass: modulate with texture
    139.     Pass {
    140.         Name "BASE"
    141.         Tags {"LightMode" = "Always"}
    142.         BindChannels {
    143.             Bind "Vertex", vertex
    144.             Bind "texcoord", texcoord0 // main uses 1st uv
    145.         }
    146.         Blend Zero SrcColor
    147.         SetTexture [_MainTex] { combine texture }
    148.     }
    149. }
    150.  
    151. Fallback "VertexLit", 1
    152.  
    153. }
    154.  
     
  7. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    As I said, the data inside lightmap is not enough for exposure It will "mass" exposure your result because of vast area in lightmap is white, or grey, that will bring the wrong result. We do not need exposure *WHERE* data is white! White color does not stand for that area should be gain EXPOSURE. It just points out that area is fully LIT, no thing more !!!

    Okie I will show more thing about what lightmap bring if we use it to gain exposure

    First, this is the lightmap

    Now result with only lightmap multiplied

    And now I use your method, lightmap also a "exposure map" (my own term:eek: )



    So well, now we have a fully exposure model. But that TOTALLY WRONG! all white data is exposured without concerning if it is exposured in rendering or not!!! Model, in just case is call "burning" and if we make a scene with "burning model" like this, that will elimiated all the development of Rendering field for tonemapping and exposure control over years.
    :D :D

    Now I show you the exposure map, only area appear in map is OVER EXPOSURE. That mean bring the reality and a good MOOD for model.



    Now you see exposure data is quite sensitive, only area where sun hit in a direct way gain exposure



    You could understand why exposure data need to be seperated from Lightmap :)
     
  8. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    If you use my shader with a normal light map texture, it will be twice as bright as the built-in lightmap shader.

    If all you're doing is summing your "exposure" texture with the existing, non-doubled lightmap, there is no reason why you can't combine your exposure and light map textures beforehand:

    doubleLightmap = exposure*0.5 + lightmap*0.5

    Then you can accomplish the same effect without a second texture.
     
  9. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    Sorry I dont get all what you mean :oops: ...So you mean after rendering out exposure map and lightmap, you use a composite apps to combine them into one map? Then what method we use to add this to our model ? :roll:
     
  10. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Your method uses three textures:

    • Diffuse: base colour
      Lightmap: a regular light map
      "Exposure" map: a selectively darkened version of the diffuse map
    and applies them like this:
    Code (csharp):
    1. result = diffuse*lightmap + exposure
    Because the exposure map is just a selectively darkened diffuse map, the equation can be expanded as follows:
    Code (csharp):
    1. result = diffuse*lightmap + diffuse*selectiveDarkening
    2. result = diffuse*(lightmap + selectiveDarkening)
    3. result = 2*diffuse*(0.5*lightmap + 0.5*selectiveDarkening)
    The coefficients added in the last step are necessary because (lightmap+selectivedarkening) will have values ranging from 0-2, which cannot be encoded in a regular texture. Thus we use a half-brightness version of this result, and double it in the shader.
    This means that you need to use my shader with a combined light map created in the following way:
    • 1. Make a half-brightness version of your regular light map
      2. Make a half-brightness version of whatever you used to darken your exposure map
      3. Sum the two
    The part I don't really know about is 2, because I'm not sure what method you use to darken the diffuse map. Whatever that method is, do it to a full white image instead of the diffuse map. Reduce the brightness of the result by half, and you'll have what you need from step 2.
     
  11. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    Thanks, I will try your method. :roll: If that go really well I will use imagemagik to combine 2 image into one and make the final lightmap texture. That will save a lot of space in graphic card, especially when it s a giant scene! :eek:
     
  12. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    Hi

    After alot of testing I must assume It s really hard to control the workflow because of produce a texture that suit to double modulate is very very difficult!

    I will continue to stuck to current workflow, until we find a new way to store "exposure data" :cry: :cry:
     
  13. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    How do you produce your exposure texture?
     
  14. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    There are two way you could use

    I am using Vray, so It has an option to control contrast and brighness for output images, so I write script to batch bake and post-process them

    If you are using another renderer (Mray or any else), I advice to use imagemagik to post-process. Create a bat file after rendering image and we get the result.

    And I see you are having some misundestanding with exposure map (sorry if I wrong). It is not an darken version of diffuse, but It is the render result, mean we have lite the diffuse, and then darken it so only exposure area remain on texture
     
  15. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    The "darkened diffuse" was just a guess. The point is that your exposure texture incorporates the diffuse colour. This means that it's not strictly lighting, because it's been pre-multiplied, which is why you can get away with just adding it to the lightmap result in your shader.

    I guess my question is this: if you took the base colour out of the exposure map, what would be left? Is it just a representation of the parts of the light map that are over-exposed?
     
  16. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    Yes :wink:

    The fact area are marked on exposure map IS over-exposed area in lightmap. Because we have no way to store these floating data to lightmap, I make a seperate map for it. :roll:
     
  17. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Ok. In that case, is it possible to just render the light map component of your exposure map, without the diffuse colour multiplied in? If you can get that, you should be able to combine it with the regular range light map, and use it with my version of the light map shader.
     
  18. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    It will not be a problem...So you mean we get exposure map without diffuse color and then make half brightness of it, add blending with half brightness lightmap and use your method? :?: :roll:
     
  19. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    There are one thing I want to ask too about 0.5 brightness thing. You mean we control exposure (mean Value in HSV color space) in a floating image, or just half brightness of a texture 8bit/channel
     
  20. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Yeah, I think you've got it. The end result (the average of the exposure and lightmap textures) will be a "full-range" light map, wherein any value over 127 will produce that over-exposed look that regular light maps don't get you.

    I'm keen to see the results!
     
  21. maxxoros

    maxxoros

    Joined:
    May 3, 2009
    Posts:
    52
    Now I fully understand your idea, the fact that s the tonemapping of the final image, where we compress all over 1 Value and compress them under or equal 1.

    I will try to see the result. However there is a weak point in this method, that is because the lighting is alway double, so it s hard to control exactly the exposure.
     
  22. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    :D Lightmap....
     
  23. maxfax2009

    maxfax2009

    Joined:
    Feb 4, 2009
    Posts:
    410
    Hi

    So no true lightmap in Unity, been playing with it and the light map does not pick up the colours from the textures or the lighter parts.

    This would be good to have, where in your 3D App you could bake in GI, coloured lights and so on.

    So at the moment is just really for shadows.

    I would like soemthing like this - can Unity do this or does it need extra support?

    http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf
     
  24. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The lightmap texture is RGB; you can use whatever colors you like. If you use the shader Daniel posted on page 1, then 50% gray in the lightmap gives you the full value of the base texture, with lighter shades brightening it.

    --Eric
     
  25. maxfax2009

    maxfax2009

    Joined:
    Feb 4, 2009
    Posts:
    410
    Thanks Eric

    OK using that shader on page one gives a bit of blue - but it as white lines too over my texture :(


    Plus there is no BUMP in that shader!
     
  26. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    It's really hard to tell what problem you are experiencing from this description. Could you post a screen shot, and if possible the textures you are using?

    If you've got the previous shader in your project, this shader will work as a bumped version:

    Code (csharp):
    1. Shader "Lightmapped*2/Bumped Diffuse" {
    2.     Properties {
    3.         _Color ("Main Color", Color) = (1,1,1,1)
    4.         _MainTex ("Base (RGB)", 2D) = "white" {}
    5.         _BumpMap ("Bump (RGB)", 2D) = "bump" {}
    6.         _LightMap ("Lightmap (RGB)", 2D) = "black" {}
    7.     }
    8.     SubShader {
    9.         UsePass "Lightmapped*2/VertexLit/BASE"
    10.         UsePass "Bumped Diffuse/PPL"
    11.     }
    12.     FallBack "Lightmapped*2/VertexLit", 1
    13. }
     
  27. maxfax2009

    maxfax2009

    Joined:
    Feb 4, 2009
    Posts:
    410
    thanks for reply Daniel

    will post screen shots soon :)
     
  28. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    Gratitude! this shader is awesome! any chance of the same shader but with transparency? this would be rad
     
  29. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    This is a three-year-old thread, and the shaders in it have been entirely superseded by Unity's built-in shaders and light mapper. I would be very surprised if they even worked in Unity 3.
     
  30. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,121
    it does
     
  31. kondrup

    kondrup

    Joined:
    Apr 23, 2009
    Posts:
    205
    Hey, This shader is fantastic and it even works in Unity4!

    Can't believe I haven't seen this thread before. Now my lightmaps actually looks the way I have always wanted them to look.

    Thanks a lot Daniel!


     
  32. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    I'm glad this works for you. Where are you getting your lightmaps from?
     
    JamesArndt likes this.
  33. kondrup

    kondrup

    Joined:
    Apr 23, 2009
    Posts:
    205
    It depends on the project. Most often I just use max'es scanline render and a skylight but in this case I used vray with a daylight system..
    It is not until now however that I am 100% satisfied with the results :)
     
  34. bbedwell

    bbedwell

    Joined:
    Nov 5, 2012
    Posts:
    37
    I'm having an issue where a lightmap I rendered via MR in Max is TOO BRIGHT with the Legacy Lightmap material but it looks fine with the Mobile Legacy Lightmap material.
     
  35. jujunosuke

    jujunosuke

    Joined:
    Apr 30, 2011
    Posts:
    190
    Hey Daniel, this shader looks like exactly what i want, but unfortunately i have an issue.

    I am using Unity 4.2.1 with a Mac.
    And i don't get over exposure at all...
    The exposure map has no effect at all.

    Do you have any idea why ?
    Thank you in advance for any answer :)
     
  36. jujunosuke

    jujunosuke

    Joined:
    Apr 30, 2011
    Posts:
    190
    False alarm, i think it work great with the Lightmapped*2 version that does not need exposure map.
    Would it be possible to make a specular version by any chance ?
     
  37. Stephen-MF

    Stephen-MF

    Joined:
    Apr 14, 2015
    Posts:
    10
    Is it possible to make this work on the standard shader in unity 5.5?
    Would be great!
     
    JamesArndt and jason-fisher like this.