Bit of findings, what's the sweet Z spot?


#1

Hi,

after much complaining and such you may wonder where I am now, well fundamentally “I got it all going” but “because it’s maybe not the official way to get it going” I am not sure I can/should publish my result anywhere without an official “approvation” by LG.

Said that must be said that “if you do it totally from 0 pure OpenGL style” by the time you have all the code you need to sort out shaders/things and such that ‘example’ would come quite a bit of handful of code even if, nothing particularly special.

I’d dare to say “the most special part” would be probably reading/parsing that JSON string to extract the calibration params, once you have those and the correct camera/proj matrix everything else is left to your own implementation.

Some of my findings are that - I think - you can get ‘best results’ using a quilt 8192x8192 instead of 4096, the difference is noticeable.

But here comes a bit of a stuff I am still trying to figure it out “the sweet Z spot”, with the supplied proj/camera matrix it seems “Z = 0” is what you want, with let’s say a ‘margin’ between -0.2 < Z < 1.5 or sorta.

I mean what I see happening if you try to “push” an object “too forward” or “too close” you get to a point where “everything crases” the image gets “fuzzy” or even the whole thing seems to ‘come out the box’ but the whole parallax/focus things go banana.

And I meaning “not touching anything else but the World matrix” i.e. purely translating the object on the Z axis.

I noted anyway that it really seems that ‘there’s always a lightly bit of degradation’ as you move forward/backwards in Z, that seems to be unavoidable.

So what are the let’s say “suggested boundaries” for an object to live within the LG space ?

I mean do you have a “suggested world bounding box” to respect ?

Cheers.


#2

Thank you for your question, this is exactly the kind of information I also want to know :slight_smile:
In an other subject I asked if I could use a 8192x8192 texture (I have not the device yet) but noboby seems to know (except you).

I also asked for the true maximum size of a single view in order to get the max quality to be able to do all my calculations based on that value, do you know about it ?

What you call “the sweet Z spot” actually depends on the true size of the output, and that’s exactly why I want to know it :slight_smile:


#3

Hi,

a quick reply, remember that the quilt has ‘not much to do’ with the final output that is fixed at 2560x1600 but what I suspect happens by going more higher rez you get a sort of AA cause oversampling.

However the difference is noticeable between 4096x4096 and 8192x8192, I tried to push to 16384x16384 but at that point there’s not much improvement that I can see.

Note that I still render in that quilt moving the viewport/size so in reality each one of my renderings is 2048x1024, still quite a res.

Probably at this point could be worth trying make it so every viewport is precisely 2560x1600 ?

Cheers.


#4

Thank you for your message !
I think 2560x1600 is the real size but because every example I saw are based on 45 views inside a 4096x4096 texture, I had some doubts about it.

Concerning the z-position
Most of the time in 3D you use 2 differents matrix : one to create the perspective and the other to move/rotate/scale your mesh in the space. The perspective-matrix must be far enough from the mesh in order to show your mesh at the right dimension (not too close - it appears too big - , not too far - it appear too small - ; if your mesh become crasy , it means a part of your mesh is located somewhere behind your camera while you try to draw every triangles ).

The perspective-matrix is like a camera actually.
It’s right distance from the mesh in order to get the dimension for the mesh at z = 0 is called the “focal length” , you can compute it like that (in javascript) :

//first, I need to know the angle of the field of view
var h = screenHeight /2;
var aTop = Math.atan2(-h,f);
var aBottom = Math.atan2(h,f);
var fieldOfVision = (aBottom - aTop);

//from that value, I can compute the focal length
var focal = h * (Math.cos(fieldOfVision /2) / Math.sin(fieldOfVision /2));

the z-position of the camera should be equal to the value of the focal.

now, let’s say you have a normalized-geometry (filled with values between -1 and +1) - let’s imagine a plane - , if you want to obtain exactly a size of 123 x 456 (or the values your want) , you just need to scale your mesh (scaleX = 123 , scaleY = 456 , scaleZ = 1) , and to do that, you usually use another matrix (the model-matrix) that will be multiplied by the perspective-matrix in order to get the right matrix that show your mesh at the right size with a perspective.

The perspective imply that farrest points (from the camera) are closer to the center of the perspective while closer points (from the camera) are put away from the center.

you can compute the scaleRatio like that ( z is the z of each point in your mesh - this computation is made in your perspective-matrix -)

var scaleRatio = focalLength / (focalLength + z)

Hope it helps ! :slight_smile:


#5

Hi,

I made a few quick tests modifying the code the generates the quilt/stuff.

Let’s say so :

With TilesX = 4; and TilesY = 8; ( mind you I noted you can swap the stuff as well) another thing I was wondering if it was worth to have ‘more horizontal res than vert’ ?

	L_RenderResolution_X = 0.125*2560.0 * TilesX;
	L_RenderResolution_Y = 0.125*1600.0 * TilesY;

At 1/8, quite a degradation, “not really useable”.

	L_RenderResolution_X = 0.25*2560.0 * TilesX;
	L_RenderResolution_Y = 0.25*1600.0 * TilesY;

At 1/4, some degradation, could be useful for things not requiring much texture details.

	L_RenderResolution_X = 0.5*2560.0 * TilesX;
	L_RenderResolution_Y = 0.5*1600.0 * TilesY;

At 1/2 pretty good, sharp details on textures, not super sharp but good.

	L_RenderResolution_X = 0.5*2560.0 * TilesX;
	L_RenderResolution_Y = 0.5*1600.0 * TilesY;

At 1 very good, very sharp details on textures

	L_RenderResolution_X = 1.5*2560.0 * TilesX;
	L_RenderResolution_Y = 1.5*1600.0 * TilesY;

At 1.5 very good, very sharp details on textures but probably overkill, I tried a 2.0 but I think was pointless.

I suppose remaining at 8192 is not bad, even at 0.5 is not too bad at all.


#6

It should be a fraction of a power of two, it will allow you to get better result because each fraction of a power-of-two-value is a finite number.

for example 1/8192 = 0,0001220703125
while 1/8191 = 1,2208521548040532291539494567208e-4

so the corrects values possible for each view should be
4096 x 2048
2048 x 1024
1024 x 1024
512 x 1024


#7

Maybe I’m wrong, I have some doubts… It’s hard without being able to test

Can you please try what is the better result between a 512x512 view and a 640x400 view ; or between a 1024x1024 view and a 1280 x 800 view


#8

It is worth looking at X and Y separately, since X has to deal with RGB subpixels. The experiment I was going to run was to look at the density of quilt texels fetched. You want them to be approximately equal to the resolution of the quilt. If denser, you’re blurry, if much less dense you are undersampling and aliasing (plus wasting texture size). I fully expect it to be different for X and Y. Also, if you can afford bicubic interpolation things will look better than bilinear (but you won’t get HW acceleration).


#9

Can you please try - what matter in my suggestion is the power-of-two dimension of the view in the texture, not the fact X == Y ; it was just an example of values in power-of-two

Because we don’t know exactly how are processed the output between the view we send and the results on the looking glass. Each view may be draw in another texture before being processed. If it’s the case, the fact that a view have or not a power-of-two-dimension matter ; if not, it doesn’t matter. But because we don’t know, we need to try.


#10

Hi,
just want to say that ‘for a couple of days’ I literally need to disconnect the LG to work on another thing, as a matter of fact does anyone know of some ‘good HDMI switch’ that could allow to connect/switch more things to an HDMI given that my GTX1070 has limited HDMI outputs ?


#11

I’m using this one


#12

Hi,
mini update, “I am still alive and the OpenGL stuff I am doing works nicely”.

But at the moment I had to switch on some other works, we had some ‘developments’ in some other places that were a bit “latent” so for the moment my hands are lot busy with something else.

Said that “in the snippets of time” I continue to work with the glass, I love it, and fear not “there will be something coming out from it” … playable :slight_smile:

Cheers.