Announcement

Collapse
No announcement yet.

Ray traced rectangle lights with animated textures - how?

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

    Ray traced rectangle lights with animated textures - how?

    Hi folks. Can anyone help me with a brief description of how to execute this technique?

    I'm trying to duplicate the beautiful ray tracing effects seen in the inspiring Porsche Speed of Light demo. Specifically I am trying to connect an animated image sequence into the texture slot of a rectangle light which will be seen sharp in reflections, yet cast a nice soft, ever-changing light onto the scene. Just like a giant TV screen would - as seen in Porsche: Speed of Light. https://www.youtube.com/watch?v=QmbvSkBBrmI

    Click image for larger version

Name:	animatedTextureQuestion_01.jpg
Views:	105
Size:	193.0 KB
ID:	1736761

    Unfortunately I am having no luck with any method I can think of. The most logical method to me is to create a media texture based on an exr image sequence, using a media track in the level sequence to play it back as described here https://docs.unrealengine.com/en-US/...cks/index.html. Then I drag-drop this media texture onto the light. As you can see from the attached image the result is always horribly wrong, no matter how I go about doing it. The light no longer behaves like a soft area light, but more like a hard-edged film projector with non-physical results.

    Click image for larger version

Name:	animatedTextureProblem_01.jpg
Views:	70
Size:	431.0 KB
ID:	1736762

    I am using UE 4.25 preview 4.

    François Antoine and Min Jie Wu gave a talk on their Porsche piece for Nvidia called "Deconstructing the Speed of Light", unfortunately the video recording of this session picks up after the section in question. http://on-demand.gputechconf.com/gtc...pdf/CH8807.pdf

    Does anyone know how to plug animated image sequences into ray traced area lights and get appealing results?

    Many thanks!

    #2
    Have you looked in LightFunctions ? These are Materials which you can apply to a Light, and in this material you can do what ever you want.

    Comment


      #3
      Originally posted by PrHangs View Post
      Have you looked in LightFunctions ? These are Materials which you can apply to a Light, and in this material you can do what ever you want.
      Thanks for the tip PrHangs. I will certainly start researching the capabilities of light functions, not having used them yet.

      The initial impressions aren't great though as line one in the documentation says "It should be noted however that you cannot change the color of lights using a Light Function". This is precisely the effect I am trying to achieve. As various regions of the giant tv screen light up with red, green, blue in the image sequence, they should automatically spill soft red green and blue light into my scene. Here's a demo of the effect working perfectly with a non-animating texture, no light functions, just a plain rectangle light. I just need exactly this behaviour, but with the texture derived from a sequence of images, not one static image.

      Click image for larger version

Name:	redAndBlueDemo.jpg
Views:	62
Size:	228.4 KB
ID:	1737007​​​​​​​

      Will still read up on light functions though - many thanks!

      Comment


        #4
        They used a media player as texture. With that, you can put a video into the source texture slot (NOT into the light function) and animate your light color.

        I used this tutorial for TV screens to create my video/media player, which i then put into the rect light.

        Tutorial (i followed it until the 4.20 minute mark, but the rest should be interesting too):




        My result:

        Last edited by Suthriel; 03-25-2020, 08:18 PM.

        Comment


          #5
          Thanks Suthriel. That tutorial video you linked to is a good source of information about how I can use light functions to create the effect I'm going for. So big thanks for that!

          BUT unfortunately his technique is a hack that involves creating three lights (red, green, blue) where you'd normally need one to get around the fact that light functions can't handle colour. So that's a 3x performance hit, which for ray tracing area lights is a big deal.

          You mention that Porsche used a Media Player as a texture (not a light function). But when I do that my nice soft area light just turns into a movie projector. This problem is demonstrated very clearly in your own result video. Your rectangle light is somehow magically projecting a perfectly legible image of peoples faces etc onto the floor - like a projector. A real TV screen has no lens in front of it, and therefore it just makes a soft blob of coloured light (which the tutorial creates with blur filters, light functions, 3x the needed number of lights etc). I'm lighting my scene with multiple giant video walls, so the difference is huge.

          I don't want to be dismissive of your very helpful answer - you have given me a way forward! But I'm still wondering if the Porsche guys were doing something a little less "hacky" than creating source texture cameras to film their screen, duplicating the light 3 times, etc.

          Comment


            #6
            Seems to me like it's a flat plane with the media texture for the emissive. Most of the light coming from it seems to be more specular than diffuse which also suggests it's a dim emissive compared to a direct light source. Also if you look at the "Light Studio" tool on screen there are only 2 light sources visible: the overhead light and the one that is rotated around to the back.
            Lighting Artist @ Rockstar Games
            ArtStation
            Twitter

            Comment


              #7
              Originally posted by shokomon View Post
              You mention that Porsche used a Media Player as a texture (not a light function). But when I do that my nice soft area light just turns into a movie projector. This problem is demonstrated very clearly in your own result video. Your rectangle light is somehow magically projecting a perfectly legible image of peoples faces etc onto the floor - like a projector. A real TV screen has no lens in front of it, and therefore it just makes a soft blob of coloured light (which the tutorial creates with blur filters, light functions, 3x the needed number of lights etc). I'm lighting my scene with multiple giant video walls, so the difference is huge.
              Ok, that blurry lighting... dunno ^.^ But if you look at this clip here, were they show an interactive demo with the used lights, then you can see, that their floor is quite reflective/metallic, and does reflect a pretty clear and sharp image of the background TV and the car itself (1 minute mark) :



              Maybe the pdf contains some hint, because those boxes, they are moving, seem to be a combination of rectangular light and an emissive plane. Take a look at page 56, where one of those boxes is marked, and what it contains. BP_LightFree contains a RectLight and a Plane.

              PDF: http://on-demand.gputechconf.com/gtc...pdf/CH8807.pdf

              Have tested it with an emissive plane instead of a rect light, and maybe with a better GPU and more samples and more bounces for reflection and Global Illumination, it could look closer to your desired TV screen:




              Edit: The only other way i can think of, would be to create a blurry video copy, that you use for the rect light, and the normal sharp video for the emissive plane for the reflections.
              Last edited by Suthriel; 03-26-2020, 08:14 AM.

              Comment


                #8
                Originally posted by Suthriel View Post

                Ok, that blurry lighting... dunno ^.^ But if you look at this clip here, were they show an interactive demo with the used lights, then you can see, that their floor is quite reflective/metallic, and does reflect a pretty clear and sharp image of the background TV and the car itself (1 minute mark) :
                Wow - thanks Suthriel!!

                That has to go down as the most helpful answer I have ever received on a forum. To go to the trouble of actually mocking up my setup and then making a movie of it for me to watch...I'm stunned. And your results really do look like the Porsche reference. Amazing effort. I also like your suggestion about pre-blurring an image sequence, I'm going to try that because it's easy to automate in Nuke and it would mean the soft illumination would be occurring with primary rays, not just reflections and GI, which might help it interact better with more shaders in the scene.

                I'm on a work-supplied 2080ti, and I'm rendering stuff non-realtime in the end, so I can afford some higher sample settings.

                Originally posted by rosegoldslugs View Post
                Seems to me like it's a flat plane with the media texture for the emissive. Most of the light coming from it seems to be more specular than diffuse which also suggests it's a dim emissive compared to a direct light source. Also if you look at the "Light Studio" tool on screen there are only 2 light sources visible: the overhead light and the one that is rotated around to the back.
                Also thanks to you rosegoldslugs - I think your analysis is accurate and is in line with Suthriel's demo. I might also cook up a custom bloom kurnel, because looking closely at the Porsche light studio, some of what looks like illumination from the video wall is actually light wrap from the bloom.

                Thanks heaps to the 2 of you - I'm looking forward to trying it all out at work today!

                Comment


                  #9
                  Just a quick follow-up. Suthriel and rosegoldslugs, your suggestions were on the money.

                  An emissive plane with the media player texture on it gets you half of the way there. You can see it affecting all reflective surfaces, including ones with blurry reflections. But it has a limitation - it is not a genuine source of light. Therefore the diffuse component of all shaders do not seem to receive illumination from this plane as far as I can see. Some objects, like my seats, come out essentially black not matter how bright this emissive plane is.

                  So the second half of your Suthriel's solution kicks in. I pre-blurred the same image sequence and fed that into a rectangle light's texture slot. This does a pretty good job of mimicking the effect of a truly textured area light source. This technique has two limitations. 1. you have to manually double handle all images sequences to pre-blur them, import them, hook them up, trigger them in a level sequence etc. 2. There doesn't seem to be a way to tell a rectangle light NOT to appear in reflections. So your nice, sharp reflections from the emissive plane are doubled up with soft reflections of the rectangle light. But in terms of the rendered images, this compromise is not huge.

                  So thanks guys for un-blocking me and letting me get back to making cool pictures. I wrapped up the above technique into a blueprint light/plane actor for easier handling.

                  If anyone out there knows how to get image sequences playing as the texture on a ray traced rectangle light, per the original question, please pitch in. The results would be visually superior and the need to double handle all image sequences would disappear.

                  Cheers!

                  Comment


                    #10
                    Originally posted by shokomon View Post
                    There doesn't seem to be a way to tell a rectangle light NOT to appear in reflections. So your nice, sharp reflections from the emissive plane are doubled up with soft reflections of the rectangle light.
                    ... press X to doubt

                    There are indeed two settings in all lights, that you can toggle, that WILL affect their reflections. The first and most important is called "Specular Scale", the other is a switch that is called "Affect raytraced reflections".

                    Video, cuz it´s easier to see their effect with moving pics the "affect reflection" is most noticeable around the front area of the car :

                    Comment

                    Working...
                    X