Announcement

Collapse
No announcement yet.

Secondary bounce light from flashlight possible?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Secondary bounce light from flashlight possible?

    I was watching a video of Escape From Tarkov the other day, and was so impressed by the way it handles lighting that I had to look up what engine it was using. Unity 5 apparently.

    One thing that was really impressive was that when the player shone his flashlight on a red metal door, a large part of the room lit up with a red color. It really sold the lighting.

    I know Alien Isolation did something similar with it's flashlight.

    So what I'm wondering is if it's possible to achieve that effect in UE4? Even if it has to be some hack, like raytrace to the flashlight surface point and move a pointlight there that takes on the color of whatever the surface the ray hit (if that's possible). So yeah... Possible?
    // Acriax

    Mountain Trail - UE4 Marketplace Store
    dev@mountaintrail.co for support

    #2
    You can use LPV (Light Propagation Volume)

    https://docs.unrealengine.com/latest...gationVolumes/
    Lighting Technical Director | Co-Founder
    Game School Online

    Want to learn Unreal Engine 4 and game development from professionals that have worked on games at studios like Call of Duty, Battlefield, Last of Us, Riot Games, Blizzard, and more? Checkout Game School Online, the first ever fully featured, structured online game development training platform that is completely free, no strings attached: https://beta.gameschoolonline.com/

    Comment


      #3
      Oh, very nice. I'll play around with it some. Hope it's not as performance demanding as it looks to be.
      // Acriax

      Mountain Trail - UE4 Marketplace Store
      dev@mountaintrail.co for support

      Comment


        #4
        I've heard some developers place place a point light near where a flash light hits a wall/object and pull the color of the light based off the asset it's pointing at.

        Comment


          #5
          Yeah, that's the hack I thought of as well, but the problem might be getting the color of the hit surface
          // Acriax

          Mountain Trail - UE4 Marketplace Store
          dev@mountaintrail.co for support

          Comment


            #6
            Originally posted by Acriax View Post
            Yeah, that's the hack I thought of as well, but the problem might be getting the color of the hit surface
            Okay, so here's how I have had it set up in the past:
            • To start with, you need to parent a SceneCapture2D component to your camera/light/whatever. Set the FOV fairly small - I've found about 10 degrees works best. Under the capture options, set it to BaseColor.
            • Next, make a RenderTarget and point your SceneCapture at it. Use a low resolution, say 32x32.
            • Make three new LightFunction materials. In each one, hook up your RenderTarget's red, green and blue channels respectively, so that you have one channel per material.
            • Place three pointlights in your blueprint, and switch off their shadow casting. Give each of the lights one of your R/G/B light functions, and set their light color to match.


            What should happen is your scene capture picks up the base color from whatever it is you're looking at, renders it into a small texture swatch, which is then distributed to each of your three lights to rebuild the color.

            The technique does have its limitations, since any highly contrasting textures are going to cause issues. If thats the case, you may want to run each of your RenderTargets through a SpiralBlur, to try and even out the color variations on the surface.

            Attached Files
            Last edited by scrcr0; 04-15-2017, 03:23 PM.

            Comment


              #7
              I did it by assigning RGB values via the physics material, so you could easily apply physics materials to static meshes specifying the color of an asset. There's probably a much more elegant way to use a similar approach, but I'm more of an artist and this is my first BluePrint outside of following tutorials.





              I added a brightness falloff based off distance, probably should also increase/decrease the radius based off distance as well.
              Attached Files

              Comment


                #8
                remember to set the "min roughness" of the point lights to 1, this would roughly simulate diffuse only light, which is what you want for a bounce. Otherwise you'll get multiple highlights on shinier surfaces.

                Comment

                Working...
                X