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"

[Suggestion/Bugfix] Orthographic projection Oculus Rift canvas rendering


We ran into an issue with the Console/stats UI having a strange offset when we adjust the world to meter scale to a larger value (3600 for example).

This is what it looks like it's when adjusted to that value: Incorrect per eye view

Adjusting the GetOrthoProjection function in FOculusRiftHMD (OculusRiftHMD.cpp:1195) to the following, makes the values readable and sharp again when looking through the Oculus.

 void FOculusRiftHMD::GetOrthoProjection(int32 RTWidth, int32 RTHeight, float /* OrthoDistance */, FMatrix OrthoProjection[2]) const
     const auto frame = GetFrame();
     const FSettings* FrameSettings = frame->GetSettings();
     const OVR::Vector2f orthoScale[2] = 
         OVR::Vector2f(1.f) / OVR::Vector2f(FrameSettings->EyeRenderDesc[0].PixelsPerTanAngleAtCenter),
         OVR::Vector2f(1.f) / OVR::Vector2f(FrameSettings->EyeRenderDesc[1].PixelsPerTanAngleAtCenter)
     OVR::Matrix4f SubProjection[2];
     SubProjection[0] = ovrMatrix4f_OrthoSubProjection(FrameSettings->PerspectiveProjection[0], orthoScale[0], 1.0f, FrameSettings->EyeRenderDesc[0].HmdToEyeViewOffset.x);
     SubProjection[1] = ovrMatrix4f_OrthoSubProjection(FrameSettings->PerspectiveProjection[1], orthoScale[1], 1.0f, FrameSettings->EyeRenderDesc[1].HmdToEyeViewOffset.x);
     OrthoProjection[0] = FTranslationMatrix(FVector(SubProjection[0].M[0][3] * RTWidth * .25, 0 , 0));
     //Right eye gets translated to right half of screen
     OrthoProjection[1] = FTranslationMatrix(FVector(SubProjection[1].M[0][3] * RTWidth * .25 + RTWidth * .5, 0 , 0));

This is what it looks like afterwards: correct per eye view

However I have some questions regarding this change. I removed the usage of the OrthoDistance argument. Why is distance involved in an orthographic projection? Orthographic projections usually don't have a variable distance as far as I know. Also, why is this scaled with the world to meter scale?

I have also removed the texture padding per eye. It would be nice to have more information on why texture padding is involved with the projection calculation.

Thanks in advance!

Product Version: UE 4.10
more ▼

asked Dec 15 '15 at 03:25 PM in C++ Programming

avatar image

1 2

avatar image san Dec 24 '15 at 02:58 PM

I noticed this behavior as well and the suggested solution seems to work pretty well.

@EpicGames, can acknowledge the issue and add it to the bugtracker? Or should I make a pull request although I agree that I'm not sure if this is the way you want to have this issue addressed?

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

1 answer: sort voted first

Hello sparkie,

I was able to reproduce this issue on our end. I have written up a report ( UE-24880) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Make it a great day

more ▼

answered Jan 04 '16 at 06:03 PM

avatar image

Rudy Q ♦♦ STAFF
47.4k 545 132 525

(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