On SteamVR Plugin, for HMD screen resolution that the width is smaller than height, the rendering frame rate is very low.

On SteamVR plugin, for HMD screen resolution that width is smaller than height, the render texture size computed in SteamVR plugin will be so huge. This will cause that the rendering frame rate is very low. This issue exists on UE 4.15, 4.14 and also 4.13.

Through SteamVR Plugin code, I found that it only consider the landscape screen case(the width is larger than height), but not consider the portrait screen case ( the width is smaller than height).

Following code is from SteamVRHMD.cpp of Unreal Engine 4.15 code, for the portrait screen case ( the width is smaller than height), after RecommendedWidth *= 2, the ScreenPercentage computed is more than 2.0 which will cause the render texture is very large and the frame rate is very low.

In this case, maybe using RecommendedHeight *= 2 instead of double RecommendedWidth can solve the problem.

// determine our ideal screen percentage
uint32 RecommendedWidth, RecommendedHeight;
VRSystem->GetRecommendedRenderTargetSize(&RecommendedWidth, &RecommendedHeight);
RecommendedWidth *= 2;

int32 ScreenX, ScreenY;
uint32 ScreenWidth, ScreenHeight;
GetWindowBounds(&ScreenX, &ScreenY, &ScreenWidth, &ScreenHeight);

float WidthPercentage = ((float)RecommendedWidth / (float)ScreenWidth) * 100.0f;
float HeightPercentage = ((float)RecommendedHeight / (float)ScreenHeight) * 100.0f;

float ScreenPercentage = FMath::Max(WidthPercentage, HeightPercentage);

Hello bsufo111,

After reading over you post, it sounds as though you would like to provide a suggestion for a change in the engine. If this is the case, you could do so by creating a pull request on github and it will be sent to the developers for further consideration. I hope that this information helps.

Make it a great day

Hello bsufo111,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Thanks,

Hi ,

Thanks a lot for your reply.
One more question, which branch should I create pull request on?

If you would like to make a pull request. I would suggest using the master branch.

Got it. Thanks.

Hello ,

I created a new branch and commit my code change on it. I tried to make a pull request on master branch to request merge my commit into master from my new branch, but it failed, and seems I have no access to do this. Are there some steps I did it incorrectly or do I miss some step?

Could you try going here and let me know if you still run into this issue?

Link: https://github.com/EpicGames/UnrealEngine/compare/release...master

It seems there is no problem for your provided link and I can also create new pull request on it. But I can’t request my code change commit on this web and I also can’t sync my code change using the github client.

Hi bsufo111,

It seems that these two functions: GetRecommendedRenderTargetSize and GetWindowBounds are both implemented in OpenVR.

I’m curious about what are the specific values returned from your device? Would you mind paste them here?

I guess it’s hard for Epic to merge your changes, because they don’t have equipment to do the test.

You can override the function.

void FSteamVRHMD::GetWindowBounds(int32* X, int32* Y, uint32* Width, uint32* Height)
{

if (vr::IVRExtendedDisplay *VRExtDisplay = vr::VRExtendedDisplay())
{
	VRExtDisplay->GetWindowBounds(X, Y, Width, Height);
	if (*Width < *Height)
	{
		uint32 RecommendedWidth, RecommendedHeight;
		VRSystem->GetRecommendedRenderTargetSize(&RecommendedWidth, &RecommendedHeight);
		RecommendedWidth *= 2;
		*Width = RecommendedWidth;
		*Height = RecommendedHeight;
	}
}
else
{
	*X = 0;
	*Y = 0;
	*Width = WindowMirrorBoundsWidth;
	*Height = WindowMirrorBoundsHeight;
}

}