Home Unreal Engine

How do I get reflections in Unreal 4?

ScottHoneycutt
polycounter lvl 13
Offline / Send Message
ScottHoneycutt polycounter lvl 13
28.jpg

I'm searching for good reflections in Unreal 4.

1) I've tried simply placing a sphere around the model with an HDI emissive material, with and without a sphere capture, and no reflections. Note that the HDR is 8000x4000 jpg and Unreal wont let me place it into cube map channels (I would like to know why)

2) I've gone into the reflections level example, placed my model into the scene, and even created an object that is all black with "1" metalness, but no reflections

3) I placed a skylight in with a sky map from Unreal's engine assets and received a wash out result of color without seeing the image details at all at any intensity, only more color reflected.

4) I placed a post process volume over the model with the same sky map and received similar but different results.

These are just four shots of my recent attempt to figure out Unreal reflections. I had somehow accidentally deleted multiple sky maps out of the engine assets library (some of them it seemed that they turned into material thumbnails simply by double-clicking them). I have no idea at this point about the relevance of capture actors, as I cannot get them to have any effect at all, other than a slight omni light effect with the brightness slider. I'm simply trying to set up a portfolio piece render. Any and help is appreciated. Thanks.

Replies

  • WarrenM
    It depends on how your material is set up. You need to have a metalness mask and a roughness mask to tell the reflections how to behave.
  • RogelioD
    Offline / Send Message
    RogelioD polycounter lvl 12
    Not sure if this will help but I lost reflections when I tried to use LPV to have dynamic lighting- apparently you need a second UV channel and lightmaps in order for SSR/Reflections to be displayed on your mesh.

    So I would check to make sure you have an appropriate lightmap channel and that you are using lightmass/light maps.
    "However, just using the cubemap reflections on a very rough surface results in an overly bright reflection that has significant leaking due to lack of local occlusion. This is solved by reusing the lightmap data generated by Lightmass. The cubemap reflection is mixed together with the lightmap indirect specular based on how rough the material is."

    https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/ReflectionEnvironment/index.html

  • JedTheKrampus
    Offline / Send Message
    JedTheKrampus polycounter lvl 8
    You definitely do get global-illumination reflections with LPV, but they're quite low-resolution compared to what you would get from an environment probe.

    In this screenshot I placed a large green metal wall behind me, and a perfect mirror ball and a prop in front of me. You can see that there are reflections from LPV on both the prop and the ball. Furthermore, you can see the reflection of the prop on the ball, which comes from screenspace reflections.

    xn9rcCw.jpg

    However, it is true that the reflections that you get from this are pretty low-resolution, even compared to the rather low-resolution 128x128 cubemaps that you get from baked reflection captures. I personally think the tradeoff is worth it because it means no more lightmap UVs and more destructible environments; although the initial setup can be a little complex to get LPVs and distance-field AO working together, I very much prefer it to setting up lightmap UVs for every single static mesh.

    OP, if you want to test out whether reflections are working or not, I would recommend using a sphere that's got a base color of 100% white (NOT 100% black; metalness makes the diffuse color black automagically and substitutes specular color of .06ish with the color from the base texture), a metalness of 1, and a roughness of 0. I'd recommend putting lightmap UVs on it and see what the results are like if you bake lighting. As I understand it you should build lighting if you want to use environment probes, and this should provide relatively high-quality reflections for displaying a prop.

    SSR "just works" without lightmaps, but the probes don't. You have to build lighting to get probes working. If your sky light is static or stationary you have to build lighting to get reflections working too, although I think that it should "just work" for a movable skylight as well.
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    36.jpg
    37.jpg
    38.jpg
    39.jpg

    Update: The big answer I've discovered is that I apparently always had reflections going, but simply need to experiment more with my color and gloss values. I think I underestimated how sensitive the gloss/roughness can be and how much it affects the reflections. The documentation on PBR talks so much about reflection being done with the albedo and metalness that I assumed the gloss wouldn't affect reflections as much, and/or that my map was glossier than it really was. Checking the reflection mode really helped. The last image comparison above really tells it.

    This is a good learning experience that had to take place. Thanks. Also the UVs, lightmaps and builds are fine. I didn't see the spheres or builds do anything because my maps weren't glossy enough to show a significant change. Also I wasn't familiar with LPV, not using that. :) :poly142:
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    One more question: How do I set up a background for a portfolio render? As soon as I place anything in the background, my lighting changes. In UDK, I could place a sphere in the back with a flat emissive color after baking the lighting. Now when I place it, the lighting becomes overpowering? If the sphere is gray, I get gray washing all around the model and the main light is overblown.

    Do I simply have to re-adjust the lights? Also if I make the sphere near black, I can see a color gradient as a result of the post process hdr.

    Out of curiosity, for those of you using Marmoset, are you setting up lights in a scene, or only using the HDR for all the light?
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 13
    43-1.jpg

    Here are some more of my ongoing experiments and thoughts, having spent several hours with this (there is a near black color sphere (static mesh) in the background surrounding the object in all four):

    1) Static lights destroy the metal reflections here. I'm going to try some full environment builds and see if there is a difference.
    2) Ambient cubemap in the post process seems to destroy the AO, like its reflecting it too much from every direction. What is this useful for? The documentation seems to admit that it has limited usage.
    3) I want the AO of the upper left image (or better if that's possible), but the reflections of the two right side images. Is this possible or is it a necessary evil to have less AO with the metal reflections?
    4) Is the skylight used more for colored lights over an environment than for reflections (like a substitute for placing colored lights all over a full environment)? The documentation seems to say so.

    Above all else, I'm having a very difficult time understanding how to control the background color. In Unity there is simply a background color button in the camera settings. Here, there is no such thing (that I know of), I place a sphere around the object, but the minute I make its color above pure black it goes light gray and washes out the lighting on the object by over-brightening. I want to figure out how to place a dark-gray background behind the model.

    Admittedly this is as much me collecting my thoughts at this point as it is asking questions. Any comments, corrections, directions, re-directions, help, suggestions or clarifications?
Sign In or Register to comment.