Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 2D EAC #1

Open
eemasal opened this issue Aug 2, 2018 · 12 comments
Open

Support 2D EAC #1

eemasal opened this issue Aug 2, 2018 · 12 comments

Comments

@eemasal
Copy link

eemasal commented Aug 2, 2018

How can we modify it to support 2D EAC projection??

@hakanai
Copy link
Owner

hakanai commented Aug 3, 2018

Good question. You'd have to look at how it's packed, and maybe either scale by 2 or rotate the whole thing, depending on the layout.

@adrianoperez
Copy link

Hi, very good work. I have a question, I can not see it in stereoscopic in virtual reality, the shader does not have 3D LAYOUT options. Any ideas to incorporate it?
Best

@hakanai
Copy link
Owner

hakanai commented Sep 12, 2018 via email

@adrianoperez
Copy link

Hi,
I have tried it in virtual reality, and although the video is stereoscopic, in virtual reality it is shown as monoscopic, that is, the same panorama in each eye, it is as if one of the eyes was lost. You can do the test, you can check that it really looks monoscopic. That's why I was asking you about layout 3d.
Best

@hakanai
Copy link
Owner

hakanai commented Sep 12, 2018

I'm not sure what the difference between our setups is, but in mine, it's definitely 3D. I originally tested it with a screen with red and blue squares to make absolutely sure.

The line which does it:
https://github.com/trejkaz/EACSkyboxShader/blob/master/Assets/EACSkyboxShader/EACPanorama.cginc#L102

@adrianoperez
Copy link

Thank you very much for the test, I will do the same as you, a cube of different colors in each eye, I am testing it with samsung gear vr, as soon as I have done the test I tell you. Exactly that line of code makes reference to stereoscopy, it should work for me.

@onkelandy
Copy link

Hi!
Thanks for the cool work - it works perfectly for 3D content.. but as mentioned it doesn't work with 2D over-under like this one: https://www.youtube.com/watch?v=9KfT6nE19I0

Could you give us a hint what to change exactly? I guess it's all about the Orient and Offset lines but have some problems to figure out how exactly.

Thanks alot!

@hakanai
Copy link
Owner

hakanai commented Oct 26, 2019

If it's over-under I'm just guessing but you might have to do something where you manipulate st.y at the end of the EquiAngularCubemap function to account for which eye the video is for, perhaps using unity_StereoEyeIndex.

@yibinfan
Copy link

yibinfan commented Jan 12, 2020

Hi,
Thanks for your work! I am also trying to modify this work to support 2D EAC.
Could you please tell me what is the "matrics for orient a [0..+1] square for each side" in lines 21~27 (EACPanorama.cginc) means? I think they define the orientation of each square(side) but didn't figure out what exactly are the elements in the matrics?
Thank you!

@hakanai
Copy link
Owner

hakanai commented Jan 12, 2020

Those are rotation matrices to orient the square correctly for each face.

@yibinfan
Copy link

yibinfan commented Jan 13, 2020

Hi,
Thanks for trejkaz's prompt response. I have successfully made it support 2D EAC. I paste the diff between the original EACPanorama.cginc and the modified one below as the reference for the people that also want the 2D support. The basic idea is to reposition and reorientate the 6 faces and scale the faces region by two (0.25->0.5).

 $ diff EACPanorama.org EACPanorama.cginc 
22,27c22,27
< static const float3x3 ORIENT_POS_X = float3x3( 0, -1, 1, -1,  0, 1, 0, 0, 1);
< static const float3x3 ORIENT_NEG_X = float3x3(-1,  0, 1,  0, -1, 1, 0, 0, 1);
< static const float3x3 ORIENT_POS_Y = float3x3( 0,  1, 0,  1,  0, 0, 0, 0, 1);
< static const float3x3 ORIENT_NEG_Y = float3x3( 0, -1, 1,  1,  0, 0, 0, 0, 1);
< static const float3x3 ORIENT_POS_Z = float3x3( 0,  1, 0, -1,  0, 1, 0, 0, 1);
< static const float3x3 ORIENT_NEG_Z = float3x3( 0, -1, 1, -1,  0, 1, 0, 0, 1);
---
> static const float3x3 ORIENT_POS_X = float3x3( 0, 1, 0, 1,  0, 0, 0, 0, 1);
> static const float3x3 ORIENT_NEG_X = float3x3(-1, 0, 1, 0, -1, 1, 0, 0, 1);
> static const float3x3 ORIENT_POS_Y = float3x3(-1, 0, 1, 0,  1, 0, 0, 0, 1);
> static const float3x3 ORIENT_NEG_Y = float3x3(-1, 0, 1, 0, -1, 1, 0, 0, 1);
> static const float3x3 ORIENT_POS_Z = float3x3(-1, 0, 1, 0, -1, 1, 0, 0, 1);
> static const float3x3 ORIENT_NEG_Z = float3x3(-1, 0, 1, 0,  1, 0, 0, 0, 1);
30,35c30,35
< static const float2 OFFSET_POS_X = float2(0.0,  0.33333333);
< static const float2 OFFSET_NEG_X = float2(0.25, 0.33333333);
< static const float2 OFFSET_POS_Y = float2(0.25, 0.66666666);
< static const float2 OFFSET_NEG_Y = float2(0.25, 0.0       );
< static const float2 OFFSET_POS_Z = float2(0.0,  0.0       );
< static const float2 OFFSET_NEG_Z = float2(0.0,  0.66666666);
---
> static const float2 OFFSET_POS_X = float2(0.33333333,  0.0);
> static const float2 OFFSET_NEG_X = float2(0.33333333,  0.5);
> static const float2 OFFSET_POS_Y = float2(0.66666666,  0.0);
> static const float2 OFFSET_NEG_Y = float2(0.0,         0.0);
> static const float2 OFFSET_POS_Z = float2(0.66666666,  0.5);
> static const float2 OFFSET_NEG_Z = float2(0.0,         0.5);
87c87
<     tc = mul(float2x2(0.25, 0, 0, 0.33333333), tc);
---
> 	tc = mul(float2x2(0.33333333, 0, 0, 0.5), tc);
93c93
<     tc = clamp(tc, edgeSize, float2(0.25, 0.33333333) - edgeSize);
---
> 	tc = clamp(tc, edgeSize, float2(0.33333333, 0.5) - edgeSize);
102c102
< #if UNITY_SINGLE_PASS_STEREO
---
> //#if UNITY_SINGLE_PASS_STEREO
104,105c104,105
<     tc.x += 0.5 * unity_StereoEyeIndex;
< #endif
---
> //    tc.x += 0.5 * unity_StereoEyeIndex;
> //#endif

However, I haven't solved the minor alignment issue mentioned in the README yet...

@hakanai
Copy link
Owner

hakanai commented Jan 13, 2020

The alignment issue I even get on the official player so I'm convinced that the video has the issue.

That said, the absolute correct way to render these is completely different to what we're doing here. They store mesh data into the video metadata now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants