What's the idea behind "viewCone" and the uniforms "center" and "subp"?


Hello !

Yesterday, I rewrite Holoplay.js in typescript , I decomposed everything into different classes, optimized what can be optimized in the shader and modify a bit the rendering structure to make it working in every size (fullscreen is not a particular case anymore)…

I will post the code soon, but before to do that, I would like to understand something about the shader itself because the results are weird.

The uniform “center” is based on a value given by the epprom : -0.028532594442367554

Looks like a very accurate (and magic) number , but it’s weird because I don’t see any difference if I change the value by 0 or 1 or 100 or 10000 or 1000000.
It’s really weird , I definitly don’t understand how works (or should works) this value.


Concerning the “subp” uniform

You set the “subp” value to 1 / (screenW * 3)

But the “multiView-texture” width is not at all the value of screenW and the shader is based on the texture, not on the screen then I don’t understand…

My texture width is 8192.
I don’t see a big difference if I set “subp” to 1 / (8192 * 3) instead of 1 / (2560 * 3)

Can you confirm to me that the correct value is 2560 , not 8192 ?


Concerning the viewCone, by default we use a value given by the epprom : 40
But the results are not good in a smaller window (it’s good actually, but it create some “broken view” if the angle of vision become too wide.

I tryed to combine some value to generate a dynamic value for this variable relative to the size of the window. It works well but to be honnest, I didn’t understood what I did, I just tryed, tryed, tryed until I found a better and better approximation of the expected result.

What was the idea behind the value 40 ?

Thank you for you help !

1 Like