Announcement

Collapse
No announcement yet.

How do I had emissive light behind walls with hidden shadows?

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

    How do I had emissive light behind walls with hidden shadows?

    I haven't been able to find an answer for this anywhere. I'm making a third person game with walls that are hidden in game and have hidden shadows so the player can't see into other rooms across the map. The problem is that all emissive materials still show through. I have forward shading turned out because I heard somewhere a while back this was the way to do it, but the problem is still there. Please help me.

    #2
    If that's the camera view that players will be looking at and you want to hide something outside of the room you're in you would need to do something like create a black mesh that blocks it or do something like trigger actor to keep track of the room you're in so that you can hide rooms when you're not in them

    Comment


      #3
      Originally posted by darthviper107 View Post
      If that's the camera view that players will be looking at and you want to hide something outside of the room you're in you would need to do something like create a black mesh that blocks it or do something like trigger actor to keep track of the room you're in so that you can hide rooms when you're not in them
      That's it? No way to hide emissive? That's terrible.

      Comment


        #4
        I mean, there is... you can create a material.parameter collection with the name of the room, add it in as the multiplier for the emissive, and set all to 0 except the room you need to see...

        Comment


          #5
          Originally posted by MostHost LA View Post
          I mean, there is... you can create a material.parameter collection with the name of the room, add it in as the multiplier for the emissive, and set all to 0 except the room you need to see...
          Thanks, but this seems like a lot of work. Really wish there was a simple way.

          Comment


            #6
            You can add a black box to extend the room walls in height. That's about it though.
            If you add a ceiling you could force the camera to stay below the roof via collisions. Those are pretty much the only available options since the room is visible.

            Ha. Idea. Maybe you can extend the wall's bounding box for occlusion in the Z to cause the other rooms to be occluded and not render.
            It would lower your overhead/drawcalls as well, but I have never really seen it work that way. Usually I extend bounds to cause objects to render when they don't on their own...

            Comment


              #7
              Originally posted by MostHost LA View Post
              You can add a black box to extend the room walls in height. That's about it though.
              If you add a ceiling you could force the camera to stay below the roof via collisions. Those are pretty much the only available options since the room is visible.

              Ha. Idea. Maybe you can extend the wall's bounding box for occlusion in the Z to cause the other rooms to be occluded and not render.
              It would lower your overhead/drawcalls as well, but I have never really seen it work that way. Usually I extend bounds to cause objects to render when they don't on their own...
              Every wall is one-sided geometry so they are hidden when in front of the camera. The reason I don't add a black box is because they can get in the way of players view at times. It's a unique system where all the higher walls are hidden with hidden shadows, making it so you can always get a clear view of the action when rotating the camera while at the same time having the other room hidden by the shadows of the hidden walls.

              Would you mind explaining in a little more detail what you mean by extending the wall's bounding box for occlusion in the Z in order to make the other rooms not render. I'm not familiar with this technique.

              Comment


                #8
                Every object has bounds used for occlusion purposes.
                they *may* work by also disabling the geometry behind them. (Though normally they make geometry go away or remain on screen longer).

                Additionally, i think the real issue is that the system you created to hide the rest is a bit flawed. Shadows may hide things, but they also could not (raise monitor gamma and that's gone).
                Why not try to utilize a post process material to mask everything around the player character by a specific sphere radius?

                If you wanted to, you could probably also just create room specific postprocess with exact shapes to control visibility.

                Global post process to make everything completely black.
                Room sized PP to make everything within the volume visible.

                as a result, the areas outside of the volume would automatically hide...

                Comment


                  #9
                  Originally posted by MostHost LA View Post
                  Every object has bounds used for occlusion purposes.
                  they *may* work by also disabling the geometry behind them. (Though normally they make geometry go away or remain on screen longer).

                  Additionally, i think the real issue is that the system you created to hide the rest is a bit flawed. Shadows may hide things, but they also could not (raise monitor gamma and that's gone).
                  Why not try to utilize a post process material to mask everything around the player character by a specific sphere radius?

                  If you wanted to, you could probably also just create room specific postprocess with exact shapes to control visibility.

                  Global post process to make everything completely black.
                  Room sized PP to make everything within the volume visible.

                  as a result, the areas outside of the volume would automatically hide...
                  Appreciate your helpful response. I'll look into one of those techniques.

                  Comment


                    #10
                    Originally posted by Omega Mouse View Post

                    Appreciate your helpful response. I'll look into one of those techniques.
                    That seems strange though that turning up the gamma would show what's being hidden by the hidden shadow. The only light in the scene is attached to the main character with certain lighting options turned on to expand the range to fill an entire room.

                    Comment


                      #11
                      Unless the light is baked in volumetric maps (which as you describe, it shouldn't be), you would probably still get bleeding...

                      Comment


                        #12
                        How about something like a trigger volume per room that, when player is in it (in the trigger volume and the corresponding room), it activates all emissives to turn off in other rooms. Not sure how it would be set up in Blueprints, but it's the idea that could be borrowed from.

                        Comment


                          #13
                          we discussed that above with the material parameter collections.

                          It's a lot of work considering if you have many rooms and non-master materials handling the emissive.

                          even with master materials and a function, it would require room by room instances and assigning materials correctly.

                          Because x × 1 is equal to 1 and × 0 is always 0, you can use math to pick if 0 or 1 should be used on a per instance basis.
                          Even better then mod; pseudo code:
                          if
                          a scaler of room set in instance.
                          b current room MPC
                          > 0
                          = 1
                          < 0
                          this output gors straight into the final multiply of the emissive, so whatever the value is x 0 or x 1.

                          It really doesn't resolve the other issues though, the proper way is still the post process volumes since they are already volumes and you don't even need to trigger anything.... you can probably set the master pp exposure to a negative number and even raising gamma won't help.

                          Comment

                          Working...
                          X