Author : polygoo


Reply
Reply
 
Thread Tools Display Modes
BringMeASunkist's Avatar
Old (#1)
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?


Offline , triangle, 313 Posts, Join Date Oct 2011,  
   Reply With Quote

Skillmister's Avatar
Old (#2)
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

Portfolio Twitter
Environment Artist
Offline , polycounter, 818 Posts, Join Date Jan 2010, Location UK Send a message via Skype™ to Skillmister  
   Reply With Quote

imbueFX's Avatar
Old (#3)
Strangely enough I was just reading about this problem on UDN

http://udn.epicgames.com/Three/Devel...y reflections?
Offline , triangle, 252 Posts, Join Date Nov 2011, Location Denver, CO  
   Reply With Quote

BringMeASunkist's Avatar
Old (#4)
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.


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).
Offline , triangle, 313 Posts, Join Date Oct 2011,  
   Reply With Quote

BringMeASunkist's Avatar
Old (#5)
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?
Offline , triangle, 313 Posts, Join Date Oct 2011,  
   Reply With Quote

Skillmister's Avatar
Old (#6)
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?
Portfolio Twitter
Environment Artist
Offline , polycounter, 818 Posts, Join Date Jan 2010, Location UK Send a message via Skype™ to Skillmister  
   Reply With Quote

BringMeASunkist's Avatar
Old (#7)
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:


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.
Offline , triangle, 313 Posts, Join Date Oct 2011,  
   Reply With Quote

JamesWild's Avatar
Old (#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.
Offline , polygon, 661 Posts, Join Date Nov 2011,  
   Reply With Quote

JamesWild's Avatar
Old (#9)

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.


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
============

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.


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
============

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.
Offline , polygon, 661 Posts, Join Date Nov 2011,  
   Reply With Quote

JamesWild's Avatar
Old (#10)
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.
Offline , polygon, 661 Posts, Join Date Nov 2011,  
   Reply With Quote

mbullister's Avatar
Old (#11)
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:



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.
Offline , line, 55 Posts, Join Date Apr 2005, Location Seattle, WA  
   Reply With Quote

Skillmister's Avatar
Old (#12)
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
Portfolio Twitter
Environment Artist
Offline , polycounter, 818 Posts, Join Date Jan 2010, Location UK Send a message via Skype™ to Skillmister  
   Reply With Quote

|*BILLY$CLINT*|'s Avatar
Old (#13)
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.
Offline , spline, 116 Posts, Join Date Apr 2008, Location Mesa Az  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch