Announcement

Collapse
No announcement yet.

ue4 lens flare????

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

    #16
    I disabled the depth test, but then it starts to render even behind walls.

    Caldera Entertainment | Twitter | ArtStation

    Comment


      #17
      Well yeah, it will do that... But I'm assuming, and correct me if I'm wrong here, that a lens flare should be a conditional thing to start with. i.e. it shouldn't EVER be omnipresent, it should only appear when the player is a certain distance and angle relative to lighting for a particular object, fading into and out of existence.

      Again, no lens flare expert, but it seems pretty strange to me to be designing a lens flare that's just always there. I would have assumed you were already doing some sort of math and traces to figure out when to spawn the particle effect and control its size such that it wouldn't appear unless the point of flare was visible to the player already...

      Comment


        #18
        No, that isn't supposed to happen. The wall should occlude the lensflare if you are viewing it from the back, the side where the actor isn't placed. Here's a clearer demonstration of the issue - https://forums.unrealengine.com/show...es-in-UE4-Pics

        Caldera Entertainment | Twitter | ArtStation

        Comment


          #19
          Hi SE_JonF, I used this tutorial to remove harsh edges in intersection between objects: Wiki Visual Effects: Lesson 02: Using Depth Fade, https://wiki.unrealengine.com/Visual...ing_Depth_Fade
          Here are two pictures without and with Depth Fade Material Expression Node:
          Click image for larger version

Name:	Without Using Depth Fade Material Expression Node.jpg
Views:	1
Size:	412.1 KB
ID:	1065972
          Click image for larger version

Name:	With Using Depth Fade Material Expression Node.jpg
Views:	1
Size:	441.2 KB
ID:	1065973
          Last edited by Angel Tsvetkov; 02-04-2015, 08:37 AM.
          Luxocraft - [FREE] 3D Ray Tracing Block Construction Builder Game on Steam

          Comment


            #20
            Hey Angel, while it isn't as bad as a sharp intersection the lensflare shouldn't be intersecting with nearby objects at all which is what I'm trying to avoid. I do this by checking the box "disable depth test" in the material, but that then presents the issue where it isn't fully occluded when the actor is behind a wall.

            Caldera Entertainment | Twitter | ArtStation

            Comment


              #21
              As a workaround, why not create a Blueprint to hold the lens flare particle system?

              Every Tick, you can have it trace from its own root in the direction of the player's Camera Component, for that component. If it gets a hit, it sets itself to be Visible / enables the particle system, and if it doesn't get a hit, it disables its own visbility / deactivates the particle system.

              It's sort of a hacky workaround but it should be effective... And once you have the logic built you can expand it by calculating the angle difference between the surface and the camera to parametrize the size and intensity of the lens flare.
              Last edited by RhythmScript; 02-06-2015, 12:45 AM.

              Comment


                #22
                Hi! I'm a new user of the UE4, and unfortunately a little bit obsessed with the anamorphic lens flare. I didn't understood the tutorial posted by Tim Hobson. There is a more detailed tutorial, or something else, that can allow me to achive the same result?
                Last edited by totix27; 03-29-2016, 12:51 PM.

                Comment


                  #23
                  Hi, I've made a shader to simulate Lens Flare effect. It can correctly detect if effect is blocking by some object in front and keeps constant screen scale. Check it here
                  http://antondoe.blogspot.com/2016/06...-flare-in.html

                  Comment

                  Working...
                  X