Home Unreal Engine

Screen Space Fresnel Reflections-UDK

polycounter lvl 8
Offline / Send Message
KazeoHin polycounter lvl 8
Hey guys, just got done making this video to show off a new material surface. The surface uses the rendered scene (basically a screenshot) to produce reflections per-frame. The video explains it better.


[ame=http://www.youtube.com/watch?v=hRVLWIMOPlo]Kazeohin-SSFR Demonstration[/ame]

LowSSFR%2BFR.jpg
---^^The material in its basic form
MediSSFR%2BFR.jpg
---^^Medium quality showing some great Anti-Aliasing
HighSSFR%2BFR.jpg
---^^high quality really goes all-out to provide an awesome visual.

What do you think? Useful? Useless?

Replies

  • lpcstr
    Options
    Offline / Send Message
    How about posting a picture of reflection-only. It's hard to get a sense for the amount of reflection with all that pesky refraction getting in the way.
  • KazeoHin
    Options
    Offline / Send Message
    KazeoHin polycounter lvl 8
    lpcstr wrote: »
    How about posting a picture of reflection-only. It's hard to get a sense for the amount of reflection with all that pesky refraction getting in the way.

    Silly me, I forgot the Polycount forums have not seen all my WIPs that I posted on the Epic Games forum, so obviously you would not have seen just the reflection effect. Here is a fresh screen-grab.

    SSFR-Only.jpg
  • Santewi
    Options
    Offline / Send Message
    Pretty fancy. Looks rather messy when combined with the refraction effect though.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Isn't it DX11 exclusive however? http://www.gamedev.net/blog/1323/entry-2254101-real-time-local-reflections/

    Also, aren't refractions supposed to be upside down or U inverted most of the time?
  • KazeoHin
    Options
    Offline / Send Message
    KazeoHin polycounter lvl 8
    My implementation does not involve ray-tracing, as such it can run on DX9 fine. It is designed as a fresnel reflection, which means it only effects surfaces at more perpendicular angles to the camera normal. It looks awesome on curved and complex surfaces, but the effect is less convincing on large, flat surfaces.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Nice! So are you using a Scene-Texture for this and are taking only RG value for the projection or is there something more? I tried this technique not too long ago, but I always kept on getting 'black holes' in my Refl/Refraction setups.

    How did you avoid that if you don't mind me asking?
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    Cool work, Kazeo!
  • Angry Beaver
    Options
    Offline / Send Message
    Angry Beaver polycounter lvl 7
    Love to see how you're actually doing it. :)
  • KazeoHin
    Options
    Offline / Send Message
    KazeoHin polycounter lvl 8
    Love to see how you're actually doing it. :)

    As soon as I find enough webhost mirrors, I'm going to be making public a whole BUNCH of my shaders. Any volunteers?
  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    Is that you doing the voice-over in the video? I like it! :-)

    How does your SSFR method differ from the SSR feature in the Dx11 update for Crysis 2 -- Which BTW, oddly enough, also worked just fine in DX9 mode -- and subsequent CrySDK builds? (Except the last 2 versions in which SSR was dropped from DX9 mode)
  • KazeoHin
    Options
    Offline / Send Message
    KazeoHin polycounter lvl 8
    Computron wrote: »
    Is that you doing the voice-over in the video? I like it! :-)

    Why yes, that is my voice. Now for everything I type here, imagine it in my voice.
    Computron wrote: »
    How does your SSFR method differ from the SSR feature in the Dx11 update for Crysis 2 -- Which BTW, oddly enough, also worked just fine in DX9 mode -- and subsequent CrySDK builds? (Except the last 2 versions in which SSR was dropped from DX9 mode)

    The SSR in the cryengine is raytrace-based and is performed as a hybrid compute/pixel shader. My own SSFR is purely a pixel shader. It is not 100% accurate, it is however 100% awesome. Cryengine's SSR is designed for large, flat surfaces wheras my own shader is more for organic, rounded meshes.
  • pior
    Options
    Offline / Send Message
    pior grand marshal polycounter
    I actually found the voiceover to be a bit distracting :D

    Anyways, on topic : It would be great to see the effect applied to a sphere and a cube with soft corners, just for the sake of seing how far it holds. The fireplace shot looks extremely convincing, very cool stuff. Considering it is screen space, do you end up with the object reflecting on itself ?

    (I love that kind of trick ... I find myself applying a fake, handpainted photo studio cubemap to a lot of materials regardless of the environment, as it give that instant product design look and it's super cheap. Now your shader takes it way further thats for sure!)
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Impressive work ! Looking forward for the details ! :)
    KazeoHin wrote: »
    Why yes, that is my voice. Now for everything I type here, imagine it in my voice.
    Ho god, I hear you voice now. D:
  • Computron
    Options
    Offline / Send Message
    Computron polycounter lvl 7
    Cool. Can you post some examples with more types of objects like the ones Pior mentioned please?
    KazeoHin wrote: »
    The SSR in the cryengine is raytrace-based and is performed as a hybrid compute/pixel shader. My own SSFR is purely a pixel shader. It is not 100% accurate, it is however 100% awesome. Cryengine's SSR is designed for large, flat surfaces wheras my own shader is more for organic, rounded meshes.

    Interesting. I find that Cryengine's SSR works pretty similar in both cases, by which I mean it's not that great in either. :poly124:

    It seems to me that their SSR method doesn't have a very far reach, even if the source pixels that should be reflected are within screenspace. It may be that their method has a maximum cutoff distance for reflections, IIRC they said this is because it would otherwise be too expensive to trace. On the other hand, they do blend the SSR on top of the standard cubemap reflections, on the fresnel angles, so that angles that cannot be reflected with SSR still have some specular component. In addition, I think the latest build of CrySDK even supports blurring the SSR reflections (In DX11 mode only) to take glossiness into account as they do with Cubemap mip-levels.

    IDK for sure though, as I only have a DX10 card and I can't test it.

    Does your method have any similar features or overcome any of these limitations? Could it be applied as a post proccess so that it can be cheaply applied to all materials, as it is in Cry3?
  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    @Kazeo

    How big are the files you want to host? You are more than welcome to post it on my forums. I think it's limited to 50mb or around there, though.

    http://www.imbuefx.com/forum-wp
  • r13
    Options
    Offline / Send Message
    r13 founder
    Polycount can host them as well if you contact about it too.
  • Minato
    Options
    Offline / Send Message
    Minato polycounter lvl 5
    Wow, Definitely useful, I have no idea how it's going to play out in a busy scene but this looks really useful, this way the reflections will definitely look more at home and dynamic since the color/luminance values are the same as the environment, not to mention the movement factor, really nice, now only if there was a way to control it's glossiness...
  • KazeoHin
    Options
    Offline / Send Message
    KazeoHin polycounter lvl 8
    Minato wrote: »
    Wow, Definitely useful, I have no idea how it's going to play out in a busy scene but this looks really useful, this way the reflections will definitely look more at home and dynamic since the color/luminance values are the same as the environment, not to mention the movement factor, really nice, now only if there was a way to control it's glossiness...

    Oh, but there IS. I just havn't shown that particular aspect. With the right settings, you can make the surface look metallic.
  • Minato
    Options
    Offline / Send Message
    Minato polycounter lvl 5
    That sounds great, can't wait to see it in action and play with it, something confuses me a little bit though, and i may be confusing the terminology and/or how this works, but as far as i can tell this isn't a post effect, If so, and even though you are using the rendered frame, can this still be considered a SS effect?... since this would mean you'd have to add the effect to every model individually and not in one shot over the Screen after the fact...

    Anyways, this looks and sounds awesome, keep up the great work...
  • Snefer
    Options
    Offline / Send Message
    Snefer polycounter lvl 16
    holy shiznits that was awesome!
  • KazeoHin
    Options
    Offline / Send Message
    KazeoHin polycounter lvl 8
    Minato wrote: »
    That sounds great, can't wait to see it in action and play with it, something confuses me a little bit though, and i may be confusing the terminology and/or how this works, but as far as i can tell this isn't a post effect, If so, and even though you are using the rendered frame, can this still be considered a SS effect?... since this would mean you'd have to add the effect to every model individually and not in one shot over the Screen after the fact...

    Anyways, this looks and sounds awesome, keep up the great work...

    When I first played with the idea back when I was looking to add it to my Audio Royalle map, I called it the 'clearcoat post-process' and it was applied to the entire scene. The only problem was that there was no way to controll it in a deferred layer, per-se. So I've repurposed it as a surface-specific effect. Would it be more efficient as a post-process? Most likely. Do I know HLSL in order to make that work? Definitely not, unfortunately.

    Screen-space refers to the fact that no additional assets are required other than the scene texture and various surface vectors.
  • Minato
    Options
    Offline / Send Message
    Minato polycounter lvl 5
    I see, thanks for the explanation...
  • Snefer
    Options
    Offline / Send Message
    Snefer polycounter lvl 16
    I cant wait to take a closer look, this is exactly what i wanted for my next project : D
  • Santewi
    Options
    Offline / Send Message
    Do you have problems with the scene texture being clamped in the 0-1 space (and therefore resulting in black borders) when the model's edges are near the edges of the screen? I'm asking this because I whipped up a similar shader myself yesterday and had some problem with it.
  • Scorpyx
    Options
    Offline / Send Message
    Scorpyx polycounter lvl 12
    KazeoHin wrote: »
    you can make the surface look metallic
    Great work - can't wait to see and touch it
Sign In or Register to comment.