Search Unity

Church Window Light Effect

Discussion in 'Editor & General Support' started by christophm, Jun 23, 2012.

  1. christophm

    christophm

    Joined:
    May 27, 2012
    Posts:
    7
    Hello everyone,

    I want to create the inside of a church for a level in my game and I have a jpeg picture of a church window (see attachments).
    My goal is to include this window into my level and have the inside of the church illuminated through this window. This should result in a very nice atmosphere and colorful light effects.
    The problem is: I have no idea how to achieve this or what steps are necessary.
    Could anyone point me into the right direction?

    Thanks!
    Christoph

    $window.jpg
     
  2. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
  3. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    you can also use it as an emmisive texture(self illuminated) if you are using beast to use as a light source that is textured..
     
  4. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    I've never been able to get emissive (self illum) textures to bake. I have pro.
     
  5. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    I stand corrected. I can get self Illuminated textures to bake. He's a screen shot where the corridor is lit by nothing but self Illuminated lighting from the textures. There is no ambient light and there are no other light sources in the scene.

    As far as I can tell, I can't get shadows and I can't get that project effect your looking for. Not sure it's possible.
     

    Attached Files:

    Last edited: Jun 24, 2012
  6. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Regardless, I've got to say, that is a really awesome-looking bake.
     
  7. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    i agree, it is.

    if you were to add now a direct light source with this indirect one, you will get that look that you want.

    C
     
  8. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    Thanks for the compliments, guys. I did it as a little test but I'll think I use something like that somewhere in my next game. It's very moody.
     
    Last edited: Jun 24, 2012
  9. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    an image using your texture.
    I added the direct realtime only light, with a cookie.

     
    Last edited: Jun 24, 2012
  10. christophm

    christophm

    Joined:
    May 27, 2012
    Posts:
    7
    This is 100% what I was looking for!!
    Could you point me towards that "direct realtime only light" property? Never came across it so far :(
    I am on Unity 3.5 pro.
    Thanks,
    Christoph
     
  11. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    http://unity3d.com/support/documentation/Components/class-Light.html

    at the bottom the lightmapping variable. set it to real time only to remove it from the bake pass

    hint: when you make your cookie for the light, have the image get slightly more blurry in the direction away from the source if you want it to look more natural.


    example:



    unfortunately you may have to make a custom shader to use a colored image. cookies only work as an alpha channel
    all i did on this was approximate the light color in the light. an easy way to do that is to take the window image into photoshop and blur it. that will give you a good idea of what the color should be.

    C
     
    Last edited: Jun 24, 2012
  12. christophm

    christophm

    Joined:
    May 27, 2012
    Posts:
    7
    Thanks Cherub for following up!

    I used your cookie and it looks quite nice:


    The only thing I am a little confused about, is how you managed to get the colors into the cookie. I know light cookies are just black and white, but your example clearly shows that in the bottom corners your have greenish colors while the overall color is more reddish.
    Did you use three cookies, one for each color? Or is there a better way to achieve this?

    Again, thank you very much for your help!
    Christoph
     
    Last edited: Jun 24, 2012
  13. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    cool!

    i used that colored texture material as an emissive light in the baking part. the colors are really only showing through where it is closest to the window and maybe sometimes a few photons will go in other places as well. you can also make the light map resolution higher on the floor around your windows. but youll have to cut up the floor unless you arent worried about memory.

    also worth noting is that that reddish color is from the bake, i made the real time light bluish.(against my advice for finding the color) it just felt better to be blue.
     
    Last edited: Jun 24, 2012
  14. christophm

    christophm

    Joined:
    May 27, 2012
    Posts:
    7
    Again, thanks for your help!
    I never heard of "emissive light" and all I could find was this page: http://unity3d.com/support/documentation/Manual/LightmappingInDepth.html

    Is there a different source where I can get infos regarding how to implement/include this emissive light thing?

    Thanks!
    Christoph
     
  15. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    it's the same thing you did with your corridor.
     
  16. christophm

    christophm

    Joined:
    May 27, 2012
    Posts:
    7
    sorry, that wasn't me :(
     
  17. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    my bad! I think if you use diffuse self illuminated shader it exposes the emmision property.
     
  18. christophm

    christophm

    Joined:
    May 27, 2012
    Posts:
    7
    Thank you very much!
    This property was simply hidden behind the little options wheel!
    After finally finding that and baking the scene, it looks like the example you created.
    Again, thank you very much for your hints!
    I will post a picture as soon as the result is really great, right now I am still fine-tuning the baking parameters.
     
    Last edited: Jun 26, 2012
  19. ZoomDomain

    ZoomDomain

    Joined:
    Aug 30, 2012
    Posts:
    150
    interesting thing about that is that the sun seems to be several feet from the window, in which case the level should be rather hot. you should add some towels to your scene.