Download

Fresnel Function in Materials

Hi,

I’m using a fresnel function in one of my materials. However, it really looks messed up with the HMD, because wide areas of the right eye image seem to be rendered totally wrong (maybe “over-saturized” describes it best).

I found this post here: [Bug]? Fresnel on VR (oculus) : L/R eye different - UE4 AnswerHub but I’m not sure what exactly Roel is suggesting. How do I create such a Material Parameter Collection, how do I use it in the Fresnel function (or do I have to implement it on my own) and is there a better way (maybe a VR_Fresnel function)?

Thanks for advice,

Markus

Here’s an image showing the difference between the two eye images.

http://fs5.directupload.net/images/160830/p6qnvtwt.png

I have not experienced the issue, the following material:

,
Produces the following result in VR:

Might be something to do with your material setup, mind posting the relevant section of it. This seems unlikely, but my projects usually have instanced stereo enabled as does this one(I am not going to recompile the shaders to test this atm), try turning it on if you have it disabled. Or it could be something completely unrelated that I can not think of right now.

I’ll get back to you as soon as I’ve checked it. Thank you in the meantime :slight_smile:

Ok, I’ve tested it with your material function and that’s how it looks

https://picload.org/image/rrpiicir/buglitd.png

I’ve used default parameter settings for the fresnel function and this here is my material setup but if I change it to what you’ve posted before (color * fresnel = emissive) it’s the same strange effect.

http://fs5.directupload.net/images/160830/dovu6rsa.png

What exactly do you mean by instanced stereo enabled? And what engine version do you use?

I’ve checked whether Instanced Stereo is enabled and it is

Tried engine version 4.13 Preview 3 and the issue is gone. Looks like a bug in Version 4.12.5

Most of the issues with Shaders being rendered wrong in VR mode comes from Instanced Stereo Enabled.
try disabling it…