Home Unreal Engine

Green strip in reflections

polycounter lvl 9
Offline / Send Message
JoshWilkinson polycounter lvl 9
I have a reflective material set up but I am getting a terrible green strip in my reflection. It seems the more distortion I apply to the reflection, the worse the green strip gets. Any news on how to solve this issue?

CuB90.jpg
WHIsK.jpg

Replies

  • Skillmister
    Options
    Offline / Send Message
    Skillmister polycounter lvl 11
    From what i researched on the matter some time ago there isn't a fix for it.

    Something that helped make it less obvious though was adding a one minus node part way through the material and multiplying it back in, now it only shows up on the very edges and much fainter along the bottom

    invertgreen.JPG
  • imbueFX
  • JoshWilkinson
    Options
    Offline / Send Message
    JoshWilkinson polycounter lvl 9
    Thanks for the write up dude. Here's the new materials with the oneMinus node. May not hurt to check off on it because I've learned I'm not a tech artist and can't always trust my eye; I make tons and tons of rookie mistakes.
    ehd6Z.jpg

    Looking at the reflection, it appears to have muted the green strip (1), but it also appears as though it muted what it was reflecting (2).
    8phPX.jpg
  • JoshWilkinson
    Options
    Offline / Send Message
    JoshWilkinson polycounter lvl 9
    imbueFX, thanks for the find. I tried out the UV clamp method it mentioned just now, but it produced almost identical results. Was about to try the bilinear filter but I quickly realized that I have no idea what I'm looking at.

    As I mentioned before, I'm not tech artist. In the bilinear filter material, what is off screen on the right? And what is the green filter's "If" plugged into on the bottom?

    Either way though, the bilinear filter write up sounded like it would mute the green channel similar to the OneMinus node, which is not ideal for my scene right?
  • Skillmister
    Options
    Offline / Send Message
    Skillmister polycounter lvl 11
    Thats odd it didn't seem to mute my reflections at all really. Have you tried plugging the reflections into emissive and seeing how that looks rather than combining it with the diffuse?
  • JoshWilkinson
    Options
    Offline / Send Message
    JoshWilkinson polycounter lvl 9
    Oh man, thanks a lot skillmaster; the answer was in the OneMinus node. Emissive only really brightened up a lot of the diffuse, which wasn't desired, but it did get me experimenting. I plugged the OneMinus in the alpha and got these results:
    cQrz5.jpg

    It seems that many of the highlights in my reflections are coming from the green channel so the OneMinus in the green was not a good solution. I'm not sure why it killed the green and preserved the highlights in the alpha but I'm happy to see the results! If you look though, there is still a sliver of green stroking the muted green, but it's something I can fix in photoshop because the end goal for this is a portfolio piece; not an interactive environment.
  • JamesWild
    Options
    Offline / Send Message
    JamesWild polycounter lvl 8
    No, no, filtering out the green channel is NOT the way to fix this.
    Either scale the reflection image about the centre so the green bit is pushed offscreen or remove the normal map offset.

    The problem is that the reflection will match screen space perfectly with normal UVs, but your normal map UVs are shifting the image between centred up and left. There's no data there so you're seeing a default colour. Give me 15 minutes and I'll have a workaround.
  • JamesWild
    Options
    Offline / Send Message
    JamesWild polycounter lvl 8
    wMFJc.jpg
    Right, let's start out with a basic reflective surface. No turbulence, very obvious bilinear filtering of a low res reflection buffer. A slight bleed.

    si0gE.jpg
    So what I think you're doing right now is adding the normal map to the screen coordinates to add some noise that roughly follows the surface. Tangent space has no relevance to screen space, so it rarely distorts in the right direction, but nobody seems to notice.

    WORKAROUND A
    ============
    yKtBw.jpg
    If we work out how much of the buffer is filled with useful data in script and pass it in as a parameter, we can scale the buffer about the screen centre, causing a slight zoom effect in the reflection and adding a padding border around the edge.

    HgRxV.jpg
    If the noise is thrown back on with this padding and the noise is scaled back enough to not escape the padding, it's a pretty convincing result. The scale issue isn't pretty however.

    WORKAROUND B
    ============
    ziDTt.jpg
    Given we know where the buffer ends from our parameter passed in by script, we might as well just clamp it there instead. Also adding a slight offset to get away from the bleed.
  • JamesWild
    Options
    Offline / Send Message
    JamesWild polycounter lvl 8
    Oh, one last thing; I think if your normal map is imported as default compression, it reads as 0->1 space in all three channels, while normal map compression reads as -1->1. If you're not using the specific normal map compression you'll need to use it as the alpha of a lerp between -1 and 1 to get a shift that goes both ways rather than just up and left.
  • mbullister
    Options
    Offline / Send Message
    mbullister polycounter lvl 18
    Do NOT use the one minus trick! I was partially responsible for spreading that peice of misinformation a while back and I'm really sorry; it's a bad solution.

    The fix on UDN will almost get you where you want to be, you just need a small tweak:

    ReflectionFix.jpg

    If you leave the constant clamp values at their defaults, the problem will remain. You need to truncate the clamp very slightly on both ends-- too little and you'll still get (smaller) green errors; too much and you'll get obvious clamping artefacts on the edges of the screen. You may have to play with those values, depending on the resolution of your scene capture map-- I think that once you've clamped the values, the error is coming from texture filtering instead of UVs outside the bounds.
  • Skillmister
    Options
    Offline / Send Message
    Skillmister polycounter lvl 11
    Well when i did it i tried every single other solution available on the net and the oneminus was the only one that got anywhere close to desirable results. I'll give that a go sometime james
  • |*BILLY$CLINT*|
    Options
    Offline / Send Message
    |*BILLY$CLINT*| polycounter lvl 11
    Try looking at this in the game instead of the editor and see if you get the same issue. AFAIK this only should happen when you are in the editor and not in the game. I can not remember off the top of my head but it has some thing to do with the way render targets are used in the editor versus how they are used in the game.
Sign In or Register to comment.