Forum Discussion
nuclear
9 years agoExplorer
libgoatvr: my modular VR abstraction library
In case anyone is interested, I just finished a first working version of the clean redesign/rewrite of GoatVR, my modular VR abstraction library: https://github.com/jtsiomb/libgoatvr. It's a bit rough...
galopin
9 years agoHeroic Explorer
Little advice, do not hesitate to expose values, even if it means capability flags for some hardware. If you do not know why something can be useful, some one else may crave for it. An easy example, why limiting the projection to a basic near far pair with a depth test set to less or equal. infinite far projection with a greater than depth test are not popular for nothing :)
And i am gonna give you a magical tips too, your stereo projection is really bad, tonight you will learn the best matrix setup for an incredible depth effect in a stereoscopic rendering, nothing less than that, and all it needs is a translation on the X axis before AND after the projection matrix with well craft values :)
With the code below, you get two things :
1) you have the full control of the convergence plane with S. Objects farther than S appear inside the TV, closer than S appear in front of the TV, and at S appear on the TV plane.
2) By using the physical TV width in the formula, you now are able to generate a maximum separation of the inter-ocular distance at the infinity, maximizing by doing so the depth effect without creating a dangerous divergence.
You will notice that i use a 60 degrees FOV, it is because the human effective vision focus cone is 60 degrees, and if you seat at the correct distance to your TV, you match the screen into that human natural cone. This is also the story behind PC players using 90 degrees, it is not to be fancy, it is because you seat closer to the monitor and doing so, your vision cone is only covering a portion of the surface and using 90 degrees put in fact the effective 60 degrees where they belong :)
And i am gonna give you a magical tips too, your stereo projection is really bad, tonight you will learn the best matrix setup for an incredible depth effect in a stereoscopic rendering, nothing less than that, and all it needs is a translation on the X axis before AND after the projection matrix with well craft values :)
With the code below, you get two things :
1) you have the full control of the convergence plane with S. Objects farther than S appear inside the TV, closer than S appear in front of the TV, and at S appear on the TV plane.
2) By using the physical TV width in the formula, you now are able to generate a maximum separation of the inter-ocular distance at the infinity, maximizing by doing so the depth effect without creating a dangerous divergence.
You will notice that i use a 60 degrees FOV, it is because the human effective vision focus cone is 60 degrees, and if you seat at the correct distance to your TV, you match the screen into that human natural cone. This is also the story behind PC players using 90 degrees, it is not to be fancy, it is because you seat closer to the monitor and doing so, your vision cone is only covering a portion of the surface and using 90 degrees put in fact the effective 60 degrees where they belong :)
float I = 6.4f; // interoccular distance
float W = 60.f; // screen width of your 3DTV
float r = 0.5f; // depth effect strength [0..1]
float S = 100.f; // focal plane distance
float F = 60.f * 3.1415f / 180.f; // horizontal FOVfloat A = r * I/W;
float B = A * S * std::tan(F * 0.5f);
// Left eye VP = V . Tx(+B) . P . Tx(-A)
// Right eye VP = V . Tx(-B) . P . Tx(+A)
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
- 11 years ago
- 7 months ago