Forum Discussion
tmason101
11 years agoHonored Guest
Complete "Extended" Mode Modern OpenGL Example (SDK 0.4.3)
Hello, Thanks to all of the help from the various posters (jherico and nuclear especially) here is a complete "Extended" mode example of using the latest version of the SDK (0.4.3) with Modern Open...
jherico
11 years agoAdventurer
I'm able to get the provided demo running, but there's a few issues.
For DirectX, there doesn't seem to be any relationship between the onscreen window size and the actual Rift resolution. However for OpenGL, at least on my setup, the GLFW window must be of the same resolution as the Rift, or the image gets cut off. Changing SizeDivizor here to 1 solved the problem.
If I disable rift mode, I actually don't get any rendering output.
Inside your per-eye loop you're doing this:
This is an incredibly bad idea. You need to divide your state modification from your rendering. In particular this bit of code being inside the per-eye loop means that the left and right eyes will see different rotations of the a given object. Updating state should happen once per frame while rendering should happen twice per frame in Rift mode and once per frame in non-Rift mode.
I don't get the point of calling glDrawElementsInstanced to draw one instance.
if (UseApplicationWindowFrame) {
SizeDivizor = 2;
}
For DirectX, there doesn't seem to be any relationship between the onscreen window size and the actual Rift resolution. However for OpenGL, at least on my setup, the GLFW window must be of the same resolution as the Rift, or the image gets cut off. Changing SizeDivizor here to 1 solved the problem.
If I disable rift mode, I actually don't get any rendering output.
Inside your per-eye loop you're doing this:
for (auto & C : Cubes) {
if (RotateCubes) {
C.RotateMe(0.001f);
}
C.DrawMe();
}
This is an incredibly bad idea. You need to divide your state modification from your rendering. In particular this bit of code being inside the per-eye loop means that the left and right eyes will see different rotations of the a given object. Updating state should happen once per frame while rendering should happen twice per frame in Rift mode and once per frame in non-Rift mode.
I don't get the point of calling glDrawElementsInstanced to draw one instance.
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
- 4 years ago
- 4 months ago