Forum Discussion
opamp
11 years agoProtege
Bug Report: Changing HMD sp in VR preview
I was working on a surface shader the other day that uses 'ScreenPos' and was getting some very strange results that had me doubting my own sanity and my ability to do simple arithmatic and it turns out that it was due to me playing around with the screen percentage while in VR preview.
Changing the screen percentage while in VR preview seems to screw up screen coordinates for any shader that uses
the ScreenPos node.
Below is a list of screenshots to illustrate the problem.

Default startup SP = 100%.

SP reduced to 90%

SP set back to 100%

SP was then set to 115% and looked correct.

SP set back to 100%

sp was the set up to 115% then 135% and then to 150% Which all look correct.

Then back down to 135%

And finally back to 100%.
As you can see it seems fine al long as you are setting it to a new maximum.
Im assuming this must be something to do with the fact that VR preview isnt using the SDK rendering pipline as hmdwarp on/off work within VR Preview. And there this isnt an issue with standalone and packaged games.
Changing the screen percentage while in VR preview seems to screw up screen coordinates for any shader that uses
the ScreenPos node.
Below is a list of screenshots to illustrate the problem.

Default startup SP = 100%.

SP reduced to 90%

SP set back to 100%

SP was then set to 115% and looked correct.

SP set back to 100%

sp was the set up to 115% then 135% and then to 150% Which all look correct.

Then back down to 135%

And finally back to 100%.
As you can see it seems fine al long as you are setting it to a new maximum.
Im assuming this must be something to do with the fact that VR preview isnt using the SDK rendering pipline as hmdwarp on/off work within VR Preview. And there this isnt an issue with standalone and packaged games.
11 Replies
Replies have been turned off for this discussion
- cyberealityGrand ChampionInteresting. I'll see what I can find out.
- opampProtege
"cybereality" wrote:
Interesting. I'll see what I can find out.
Cheers Cyber,
I also posted a bug report on unreal answerhub. - artyom17Expert ProtegeWhich version of UE4 is this? I recently found a bug in main UE4 (which is already marked as 4.8.0) and fixed it, this was a bug introduced by Epic guys (however, it wasn't related to VR Preview only).
I can't repro this issue in the latest 4.7. - opampProtege
"artyom17" wrote:
Which version of UE4 is this? I recently found a bug in main UE4 (which is already marked as 4.8.0) and fixed it, this was a bug introduced by Epic guys (however, it wasn't related to VR Preview only).
I can't repro this issue in the latest 4.7.
this is 4.6.0 Oculus build.
Edit* to be clear im changing the screen percentage via the console after the preview has started.
I,ll download 4.7 and see if that fixes it. - artyom17Expert ProtegeCan't repro it in 4.6.1 Oculus build either (the latest from Oculus github).
Edit: this issue could be shader-specific (but in this case it shouldn't be VR Preview specific). Have you tried your sample in standalone game? - opampProtege
"artyom17" wrote:
Can't repro it in 4.6.1 Oculus build either (the latest from Oculus github).
Edit: this issue could be shader-specific (but in this case it shouldn't be VR Preview specific). Have you tried your sample in standalone game?
Yep standalone and package game work fine. The results of the full shader are here.
https://forums.oculus.com/viewtopic.php?f=28&t=19619
Which is just a suface shader that masks depending on the pixel location in screenspace.
This previous screen shots are just a postprocess shader coloring dependant on location.
A 'ScreenPosition' node a couple of 'if' nodes 4 floats and 2 float3's
let me see what happens with 4.7. - artyom17Expert ProtegeWeird. It definitely uses the same rendering pipeline. Can you share the sample to investigate?
"opamp" wrote:
"artyom17" wrote:
Can't repro it in 4.6.1 Oculus build either (the latest from Oculus github).
Edit: this issue could be shader-specific (but in this case it shouldn't be VR Preview specific). Have you tried your sample in standalone game?
Yep standalone and package game work fine. The results of the full shader are here.
https://forums.oculus.com/viewtopic.php?f=28&t=19619
Which is just a suface shader that masks depending on the pixel location in screenspace.
This previous screen shots are just a postprocess shader coloring dependant on location.
A 'ScreenPosition' node a couple of 'if' nodes 4 floats and 2 float3's
let me see what happens with 4.7. - opampProtege
"artyom17" wrote:
Weird. It definitely uses the same rendering pipeline. Can you share the sample to investigate?
The only other thing i can think of is that its somehow connected to the editor viewport.
Ill get something uploaded tommorrow for you.
Cheers. - artyom17Expert ProtegeIt might. Yeah, will have a look on it once I can repro.
"opamp" wrote:
"artyom17" wrote:
Weird. It definitely uses the same rendering pipeline. Can you share the sample to investigate?
The only other thing i can think of is that its somehow connected to the editor viewport.
Ill get something uploaded tommorrow for you.
Cheers. - artyom17Expert ProtegeOk, finally was able to repro the issue, thanks opamp.
So, at the moment I am sure - this is a bug in UE4. You can easily repro it w/o VR Preview (and w/o Rift connected at all). Just run preview in "New Editor Window", press tilde, type 'r.ScreenPercentage 150' (w/o quotes) then try 'r.ScreenPercentage 200' and then back to 'r.ScreenPercentage 100'. You'll see the same effect.
I think the issue is that Epic uses size of the render target to calculate coords in those shaders. And changing screenpercentage back to 100 does not cause rendertarget to be reallocated in the editor (unlike in the game, where this happens).
You need to file a bug report to Epic. I guess https://answers.unrealengine.com/ should work for this.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 years ago
- 7 months ago
- 5 years ago
- 2 years ago