Search Unity

How to do moonlight shaft through window...

Discussion in 'General Graphics' started by MartinOrtiz, Jan 17, 2019.

  1. MartinOrtiz

    MartinOrtiz

    Joined:
    Apr 12, 2018
    Posts:
    122
    I have a dark room, and want to simulate shaft of moonlight coming through window...

    The window looks like a window, but is opaque, so am not sure what the best approach to get the look would be? If it were not opaque, I think a directional light would do it(?)
     
  2. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,664
    xVergilx and Ryiah like this.
  3. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,142
    Peter77, Ryiah and AcidArrow like this.
  4. MartinOrtiz

    MartinOrtiz

    Joined:
    Apr 12, 2018
    Posts:
    122
    A light shaft is what I want to do.....is there a Unity3D example?

    Again, one issue (maybe it's not an issue), is that it's not a real window where it's transparent, its just a window texture....

    Aura has injection volumes, is that what I want?
     
  5. MartinOrtiz

    MartinOrtiz

    Joined:
    Apr 12, 2018
    Posts:
    122
    If I use something like Aura, can I still use the post processing stack?
     
  6. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,664
    In your case, it's probably best to use some sort of trickery: flat planes + texture(s).

    Example from RAGE (not my video):


    Aura and alike need a directional light or any other light type to work with.
     
    Peter77 likes this.
  7. MartinOrtiz

    MartinOrtiz

    Joined:
    Apr 12, 2018
    Posts:
    122
    Yes, when the geometry, like a cave entrance or something like that, when it supports the use of realistic lights, then it's not a big issue, it's when you don't have a true opening in the wall (doorway, window, cave entrance), then it can be problematic.
     
  8. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    We use Volumetric Light Beam linked above for our bullet holes in our game, well its a proof of concept feature right now. Latest version its really performant, its only 1 draw call for all beams.

    Its not a 100% realistic look. but its close enough
     
  9. MartinOrtiz

    MartinOrtiz

    Joined:
    Apr 12, 2018
    Posts:
    122
    I will try some of the techniques mentioned.
     
  10. MartinOrtiz

    MartinOrtiz

    Joined:
    Apr 12, 2018
    Posts:
    122
    I am still unsure though, when using alternate lighting techniques, can I still use the post processing stack? Or will they be fighting each other?
     
  11. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    966
    How restricted is the camera? I was playing with volumetric lighting recently and was less than pleased with the performance. I realized that I could smoke and mirrors it with a single quad that always faces the camera and a custom shader. It doesn't work from all angles though, but I could imagine you could do some trickery with the shader.