Forum Discussion
michalsuchanek
11 years agoHonored Guest
Using OculusWorldDemo and adding Model+DX11 Geometry shader
Hey everyone!
I've recently started programming for the Oculus and to get started without having to write a ton of code first, I've decided to take the OculusWorldDemo, remove the XML-file-based scene loading process, and construct/inject my own 3d models using the Model, Texture, Fill, etc classes. I think this is a pretty straight forward way to have a reasonably good 3d engine with input controls, audio, lots of debug features, etc. Is this a good or bad idea? What is the license like on these libraries - can they be used as the engine underlying commercial projects? At any rate, it seems to work quite well at the moment.
I would like to add a Geometry Shader to my shader set, yet it is unclear to me how to add an arbitrary Geometry Shader to the LibOVR/OculusWorldDemo engine. I have made some attempts with the OculusTinyDemo and had some success but I get some strange behavior (for instance, setting a geometry shader for any model will cause OTHER models in the scene to render on only one eye, or neither eye, depending on whether they were added to the scene before or after the object with the Geometry shader). I had to modify LibOVR a bit to get Geometry shaders in there and perhaps I either modified too much or not enough. :) I suspect there is something wrong with my implementation, as I'm a novice to 3d programming, and the LibOVR engine doesn't appear to have any examples of Geometry shader integration to look at and work from.
I'm hoping someone can provide me an example of a working implementation of a LibOVR/OculusWorldDemo project with Geometry Shaders (or just the relevant parts of the code). I'm using VS2013 on Windows 8 (64 bit) using a DX11-capable GPU. I have read a lot about geometry shaders online and have a good understanding of DX11, the rendering pipeline, and C++ programming (I have been programming for 15+ years, but never doing 3d programming).
Any other relevant advice would be much appreciated. Thank you!
I've recently started programming for the Oculus and to get started without having to write a ton of code first, I've decided to take the OculusWorldDemo, remove the XML-file-based scene loading process, and construct/inject my own 3d models using the Model, Texture, Fill, etc classes. I think this is a pretty straight forward way to have a reasonably good 3d engine with input controls, audio, lots of debug features, etc. Is this a good or bad idea? What is the license like on these libraries - can they be used as the engine underlying commercial projects? At any rate, it seems to work quite well at the moment.
I would like to add a Geometry Shader to my shader set, yet it is unclear to me how to add an arbitrary Geometry Shader to the LibOVR/OculusWorldDemo engine. I have made some attempts with the OculusTinyDemo and had some success but I get some strange behavior (for instance, setting a geometry shader for any model will cause OTHER models in the scene to render on only one eye, or neither eye, depending on whether they were added to the scene before or after the object with the Geometry shader). I had to modify LibOVR a bit to get Geometry shaders in there and perhaps I either modified too much or not enough. :) I suspect there is something wrong with my implementation, as I'm a novice to 3d programming, and the LibOVR engine doesn't appear to have any examples of Geometry shader integration to look at and work from.
I'm hoping someone can provide me an example of a working implementation of a LibOVR/OculusWorldDemo project with Geometry Shaders (or just the relevant parts of the code). I'm using VS2013 on Windows 8 (64 bit) using a DX11-capable GPU. I have read a lot about geometry shaders online and have a good understanding of DX11, the rendering pipeline, and C++ programming (I have been programming for 15+ years, but never doing 3d programming).
Any other relevant advice would be much appreciated. Thank you!
3 Replies
- michalsuchanekHonored GuestIf it helps anyone - I discovered a solution to the behavior I was seeing with the geometry shader. Using the disparity between the output to each eye as a hint, I tried clearing the Geometry Shader (GSSetShader NULL etc) after each scene Render call in the main render loop and that fixed the problem. It seems that the engine will not clear the active Geometry shader unless you actually specify a replacement (meaning shadersets without geometry shaders will simply use the geometry shader of the previously rendered model).
- RobustarHonored GuestCan you give me your Source File?? (NO XML FileLoad OculusWorldDemo)
- michalsuchanekHonored GuestRobustar, your best bet is to simply comment out the following code in the OculusWorldDemoApp::PopulateScene method:
XmlHandler xmlHandler;
if(!xmlHandler.ReadFile(fileName, pRender, &MainScene, &CollisionModels, &GroundCollisionModels))
{
Menu.SetPopupMessage("FILE LOAD FAILED");
Menu.SetPopupTimeout(10.0f, true);
}
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
- 5 years ago
- 12 years ago