Announcement

Collapse
No announcement yet.

Abusing UE4's Reflection system for cheap translucency

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

    Abusing UE4's Reflection system for cheap translucency

    I've been playing with this idea to use UE4's reflection probe system for transparency. Essentially, you should be able to sample reflections via the camera's direction, rather than the object's normal, to see "straight trough it". Obviously not good enough for a big glass pane, but it could be used for some cool Visual Effects, such as a "predator" like effect.

    Here's the proof of concept I put together in Unreal Tournament, by changing the player's normal to be the camera vector. The results are promising!



    Here's a video of the effect in action:
    https://twitter.com/Stabberthomas/st...13084227325952

    This is the effect I'm after:
    Click image for larger version  Name:	 Views:	1 Size:	105.4 KB ID:	1409243
    And a video:
    https://twitter.com/Stabberthomas/st...35297089695744

    But this is just using a static cubemap.
    Over the next few days I'll try to implement this as a proper shading model!

    Let me know if you have any tips or comments in general.
    Last edited by ThomasKole; 01-07-2018, 11:47 AM.

    #2

    Click the youtube video below for the full example in high quality:

    Comment


      #3
      Same idea, but in outpost 23


      Comment


        #4
        Loving these results, def. keep us updated

        Comment


          #5
          Whoo, I got my shading model to work.

          I compiled it from the latest version from Github.

          It's a first step at least. I can select it in the "Shading Model" drop down, and it refracts. Now I gotta hook everything up correctly.
          UE4's shaders are quite complex I found out, and it's not quite there yet. I think I might not have enough customdata to make it work, so I might have to hijack "specular" or "ambient occlusion" or something.

          Anyway, here is a video of what it looks like so far.





          Oh, and of course, HUGE THANKS to Felix Kate, for writing how to actually implement a custom shading model. It's not super up-to-date anymore, but it definitely gives you something to look for in the code.

          https://blog.felixkate.net/2016/05/2...ading-model-1/
          Last edited by ThomasKole; 01-11-2018, 05:38 PM.

          Comment


            #6
            This is so.. amazing. to say it politely.

            Comment


              #7
              wow, super neat!
              Follow me on Twitter!
              Developer of Elium - Prison Escape
              Localized IBL for UE4

              Comment


                #8
                Awesome work
                Broad Strokes | Jan Kaluza | Marketplace Release: 'Over 9000 Swords' Modular Melee Weapon System
                Currently not available for freelance work
                Dev Blog & Tutorials | Twitter

                Comment


                  #9
                  Looks awesome! I remember thinking about this a while back, but never had the knowledge/time to implement it. Can't wait to see how far you can take it.

                  Comment


                    #10
                    Originally posted by Stabberthomas View Post
                    UE4's shaders are quite complex I found out, and it's not quite there yet. I think I might not have enough customdata to make it work, so I might have to hijack "specular" or "ambient occlusion" or something.
                    If you need full RGB data, a trick I've used before is using the subsurface gbuffer for it, it's the only full RGB buffer that isn't used for something important. Otherwise, there's of course customdata for single channel information.

                    Congrats on everything so far though, this looks awesome! I look forward to when you hopefully release it!

                    Comment


                      #11
                      Looking good.
                      I wonder if Bent Normal Maps could be used to darken reflection/refraction in "cavities".
                      Twitter | MinimalUI UE4 Editor Theme
                      Dark Themes for: Forum | AnswerHub | Everything else

                      Comment


                        #12
                        This is so cool... Im speechless!
                        Nilson Lima
                        Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
                        Join us at Discord: https://discord.gg/uFFSEXY

                        UE4 Marketplace: Cloudscape Seasons
                        supporting: Community FREE Ocean plugin

                        Comment


                          #13
                          That looks pretty nice Didn't they add a way to add shading models as a plugin in one of the latest updates? Might be worth a look to make it more independent.

                          Comment


                            #14
                            Zero-Night I was thinking about that too, I'll have to look into how that's implemented. S-ed I haven't really looked into UE4's implementation of bent normal maps, I'll have a look! RRe36 I could have sworn that was possible, but it's not apparently. Only global shaders are supported, not entire shading models. I wish I could turn it into a plugin!

                            Comment


                              #15
                              Here's some more experimentation:



                              I haven't found a robust way to pass trough all the required parameters. I need tint, roughness (separate from the normal roughness), and IOR.)
                              If anyone has any pointers let me know!

                              Comment

                              Working...
                              X