x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Bug]? Fresnel on VR (oculus) : L/R eye different

Hello everyone !

I am having a little bit of an issue on my shaders :

I am using some Fresnel (on pretty much everything) but I noticed that the left eye and the right eye are not rendering the same effect.

[i]It's absolutely logical and normal but it's a big issue as it create a disturbing effect.[/i]

I will be okay with a Fresnel averaging on both eye "the middle eye" but I have no idea if that is possible.

So that pose also a more general question of : can camera based effect be based on the "middle eye" ?

I look forward to your enlightenment, thanks.

Product Version: Not Selected
Tags:
more ▼

asked Aug 24 '14 at 12:06 AM in Bug Reports

avatar image

olivierJT
71 11 15 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

This is logical, Here is what is going on behind the scene of a fresnel operation.

alt text

The most important part is the top left node. CameraVector. This is the world space camera direction. Since virtual reality glasses use 2 separate camera's ingame, with both a slightly different direction, you won't get the same result.

Fixing this would be easy internally. It would be cool if epic added a ViewVector for virtual reality, so we could access it in the material editor.

Since this is not the case you would have to set it up yourself. The easiest way would be to make a Material Parameter Collection in the content browser, and within there add a new Vector Parameter. Give it a nice name, like VRViewDir. In any material you can now add this Parameter Collection.

Now from within blueprint you can set the VRViewDir with the "Set Vector Parameter Value" node. This way every shader just used that view direction instead of the CameraVector.

Good luck!

material.jpg (312.0 kB)
more ▼

answered Aug 24 '14 at 11:41 AM

avatar image

Roel
2.2k 63 35 135

avatar image olivierJT Aug 25 '14 at 06:30 PM

Awesome answer,
So you are basically redoing a fresnel just for VR.
This is perfect, merci !
I will add a request to Epic regarding that kind of camera effects.

avatar image 3dlight Aug 26 '14 at 08:04 PM

I'm about to start something that would have a lot of fresnel in VR. Is the discrepancy really problematic? Logically, they should have a slightly different look based on slightly different views, but just how distracting is that in stereo? I haven't tested it yet.

avatar image Roel Aug 27 '14 at 01:20 PM

Me neither, You would have to try it out. If someone could post a picture of how it actually looks through VR, that would be great!

avatar image E1andri1 Aug 29 '16 at 04:37 AM

Hi, I've got some questions regarding your answer, Roel.

What do you mean by Material Parameter Collection in particular? How can you retrieve the view direction of a specific eye camera of a helmet? And do you have to implement a Fresnel function using this particular VRViewDir on your own? And is there an engine update on this topic? Like a VR_Fresnel function?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I fixed this here by changing, in MaterialTemplate.usf, the following line of code:

 Parameters.CameraVector = normalize(-Parameters.WorldPosition_CamRelative.xyz);

to this:

 Parameters.CameraVector = normalize(ResolvedView.WorldCameraOrigin - Parameters.AbsoluteWorldPosition);
more ▼

answered May 06 '16 at 06:54 PM

avatar image

slpalmer
6 2 1

avatar image slpalmer May 12 '16 at 12:28 AM

btw this fix does not work with Tessellation enabled, not sure how to fix that yet.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question