-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[rlgl] BeginTextureMode()
doesn't update intenal framebuffer size for rendering in VR
#2420
Comments
BeginTextureMode()
doesn't update intenal framebuffer size for rendering in VR
@FireFlyForLife Oh! That's a good catch! I'll try to review it asap. By the way, nice to know the OpenXR binding! How is it going? Does it require many changes to raylib to work? I imagine you are processing the user-tracking-inputs directly yourself, right? |
Hi! very good timing :) I just created a pull request for this. Though you will know best if there is a better solution. The OpenXR binding is going pretty well, it's a Khronos library so my 7 function header has ballooned into a 1000 lines of source code for implementation. But it's going pretty well, it actually doesn't require any changes to raylib, I only have a function that replaces wraps BeginTextureMode() & EndTextureMode to do some swapchain book keeping but apart from that it should work out of the box thanks to Raylibs VR support! (Apart from this issue of course :p) For the API I'm trying to keep it small and directly giving you access to the OpenXR system so I don't restrict the user input tracking. (Also because I'm not that experienced yet with the system, I cannot design a good abstraction for it yet :) ) The current API I have is this, I'm planning to open source it when I get it works and when I get the paperwork back from work: // Setup
bool rlOpenXRSetup();
void rlOpenXRShutdown();
// Update
void rlOpenXRUpdate();
void rlOpenXRUpdateCamera(Camera3D* camera);
// Drawing
bool rlOpenXRBegin();
void rlOpenXREnd();
enum RLOpenXREye { RLOPENXR_LEFT = 1, RLOPENXR_RIGHT = 2, RLOPENXR_BOTH = 3 };
void rlOpenXRBlitFramebuffer(RLOpenXREye eye); |
Actually I had one issue I couldn't work around. I currently cannot go from OpenGL Texture format -> RLGL Texture format. Ideally there would be some way to consistently convert back and forth. Though I get away with it now because in |
@FireFlyForLife Merged the provided fix, I'm still considering if updating EDIT: Actually |
It seems current implementation storing viewport data when |
Redesigned, added a bit more code but now it's cleaner. |
Issue description
I'm building a OpenXR binding for Raylib. The issue I have is that
rlEnableFramebuffer()
orBeginTextureMode()
don't update the framebuffer size in RLGL (though will setCORE.Window.currentFbo
width/height in Raylibrcore.c
).The problem is that while rendering normally,
BeginTextureMode()
will callrlViewport()
to setup the new size. But in RLGL'srlDrawRenderBatch()
function, the VR codepath will overwrite the viewport size to each eye from the default screen size, instead of the enabled framebuffer and render texture.rlgl.h@L2505:
Environment
Windows 10,
Both Opengl 3.3 & 4.3,
NVidia GTX 980.
Issue Screenshot
Code Example
I'm obviously using OpenXR instead of the simulator. But taking the vr simulator example and modifying the render target resolution will reproduce the issue too:
The text was updated successfully, but these errors were encountered: