Comments (5)
Thanks for the feature request. We will add this to our backlog. However, if you would like to add these changes, please read CONTRIBUTING.md and follow the process. Patches are welcome. The right place for adding this feature would be within the CardboardDistortionRenderer module, where a variant for _renderEyeToDisplay would be needed, that takes in a list of layer descriptions, each of them containing type, geometry and a texture. We are not familiar with VDDC and are uncertain if it makes sense to add it as a dependency.
from cardboard.
Hello jballoffet,
Let me first explain what dependencies / modifications would be needed for adding V.D.D.C to Cardboard:
- The cardboard undistortion already distorts Vertices instead of Texture coordinates. However, its lens distortion model ( respectively the ViewportParams ) are calculated for a Full Screen OpenGL Viewport in contrast to V.D.D.C, which renders left and right eye in 2 different draw calls with a Viewport of Half the screen.
Therefore, I had to make some changes to lens_distortion
Most notably adding a new struct for calculating the undistortionViewportParams
in HSNDC ( Half screen normalized device coordinates )
-
V.D.D.C needs a
PolynomialRadialInverse
to calculate the inverse radial distortion more eficiently. I Have placed all this code in its own folder PolynomialRadialDistortion
It adds a PolynomialRadialInverse together with the Math for caclulating it.
Note: The old cardboard java library had the appropriate methods for calculating a PolynomialRadialInverse - I mostly only translated google java code to cpp there ) -
For rendering textured geometry with V.D.D.C I have a simple OpenGL shader that can both sample from a 'normal' and 'external' texture and optionally applies V.D.D.C to the vertices: GLProgramTexture
You can find more details /helper for V.D.D.C in OpenGL shaders in this file:
VDDC.h
Additionally, these Files come with some Header-only dependencies, most notably 'glm' for Matrices and some Helper
GLHelper
GLBuffer
Also they are compiled using c++17 ( I think Cardboard still uses c++11 )
Obviosly, Since some of these files have little in common with the original cardboard files ( For example, I could not get the protobuff library to compile-> therefore I decided to create a new struct MVrHeadsetParams that obtains all device / headset parameters from the gvr library )
However, I can help merging the code into cardboard if you decide to add V.D.D.C to either its core sdk or maybe as an extension.
from cardboard.
Benefits of adding V.D.D.C:
As already mentioned above, using V.D.D.C we can add all layer types that are for example already supported on oculus:
unity-ovroverlay
Later, depending on their adoption ( for example I expect a high demand for the Equirect layer aka 360* video layer ) we can add customized shaders for these specific layer types.
I already experimented with creating a VrCompositorRenderer.h
That holds some VRLayer's
and draws all of them using V.D.D.C . I also created an example that contains both a 360Β° video layer and a 2D ui layer :
Renderer360Video
from cardboard.
Sorry for the delay here. Your proposed changes seem reasonable and valuable for the Cardboard SDK and we would like to take this to the PR phase. Taking into the account the magnitude of the required changes, another good option would be to propose a design first before moving forward with the required changes. Please read CONTRIBUTING.md and follow the process. Thanks for your proposal!
from cardboard.
Any update? @Consti10 @jballoffet
from cardboard.
Related Issues (20)
- Recenter fails, and different lighting on terrain, bugs in Cardboard SDK 1.22.0 HOT 1
- Pixel Format mismatch error with URP + Linear with Unity iOS HOT 2
- iPhone 15 Pro Max displays VR and non-VR at the same time when MSAA is enabled HOT 1
- Parameters file not found for reading: java.io.FileNotFoundException: /storage/emulated/0/Cardboard/current_device params: open failed: ENOENT (No such file or directory)
- Error reading device parameters from URI HOT 2
- jumps out of application after pressing switch back to VR button in the default sample
- VR view not working in IOS. HOT 2
- Remove eye mask HOT 5
- How to import The SDK into Android Studio HOT 1
- Camera rotation too slow HOT 2
- Compatibility with Unity Sentis: can't display image in VR mode HOT 1
- Canβt display VR mode on iPhone in Unity 2023.2+ HOT 3
- Abnormal darken color in VR mode on iPhone, Unity 2021.3+ HOT 1
- VR View Orientation Issue HOT 1
- It's time to stop hiding the parameters HOT 1
- Anti Aliasing (MSXAA 4x) causes black screen in VR on some phones HOT 3
- [iOS] HelloCardboardInputSystem: IsTriggerPressed does not work periodically HOT 1
- Video Pixelation in Google Cardboard VR Mode HOT 3
- Camera Constantly Points Down and Jerks Up During Movement HOT 2
- [Bug] Minature hello-carboard render on AVD 33
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cardboard.