Conversation
|
@copilot Thank you. Now your task is to help me finish the WIKI on following pages:
Follow the pattern I used in 1st page, the idea is to keep things understandable and straightforward, the goal of this WIKI is to help understand how to work with AtumVR, not describe everything about it. |
Co-authored-by: Phoenix-Ra <53151806+Phoenix-Ra@users.noreply.github.com>
I've created complete wiki content for all 6 pages in Files created:
Each file follows your pattern with Contents section at top, clear headers, and practical code examples. Copy the content from each file to the corresponding wiki page on GitHub. I noticed some potential code suggestions while exploring:
|
|
@copilot now I need you to make it with the following idea: For more advanced information, make a separate page like this one: ContentsHidden Area MeshVR headsets have areas at the edges of each lens that the user cannot see. Rendering to these areas wastes GPU resources. AtumVR provides access to the hidden area mesh that you can use for stencil-based optimization. Getting hidden area datafloat[] leftHiddenArea = vrRenderer.getHiddenAreaVertices(EyeType.LEFT);
float[] rightHiddenArea = vrRenderer.getHiddenAreaVertices(EyeType.RIGHT);The returned array contains triangle vertices in the format Using hidden area for optimizationYou can use this data to create a stencil buffer that prevents rendering to hidden areas:
This optimization can significantly improve performance, especially on complex scenes. Custom TexturesWhile Extending XRTexturepublic class CustomVRTexture extends XRTexture {
private int depthBuffer;
public CustomVRTexture(int width, int height, int textureId, int index) {
super(width, height, textureId, index);
}
@Override
public XRTexture init() {
super.init();
// Add custom depth buffer
depthBuffer = GL30.glGenRenderbuffers();
GL30.glBindRenderbuffer(GL30.GL_RENDERBUFFER, depthBuffer);
GL30.glRenderbufferStorage(GL30.GL_RENDERBUFFER,
GL30.GL_DEPTH24_STENCIL8, width, height);
GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER,
GL30.GL_DEPTH_STENCIL_ATTACHMENT, GL30.GL_RENDERBUFFER, depthBuffer);
return this;
}
}Then in your renderer: @Override
protected XRTexture createTexture(int width, int height, int textureId, int index) {
return new CustomVRTexture(width, height, textureId, index);
}Resolution and SwapchainGetting render resolutionint width = vrRenderer.getResolutionWidth();
int height = vrRenderer.getResolutionHeight();The resolution is determined by the VR runtime based on the headset capabilities. AtumVR automatically uses the recommended resolution. Swapchain formatsAtumVR requests swapchain images in this order of preference:
You can customize this by overriding @Override
public List<Integer> getSwapChainFormats() {
return List.of(
GL21.GL_SRGB8_ALPHA8,
GL11.GL_RGBA8
);
}Multi-pass RenderingFor complex rendering pipelines, you may need multiple passes per eye. Rendering to intermediate buffersInstead of rendering directly to the swapchain framebuffer, render to your own framebuffer first: @Override
public void updateEyeTexture(@NotNull EyeType eyeType) {
// Pass 1: Render scene to intermediate buffer
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, myIntermediateFramebuffer);
renderScene(eyeType);
// Pass 2: Post-processing
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, myPostProcessFramebuffer);
applyPostProcessing();
// Final pass: Copy to VR framebuffer
int vrFramebuffer = (eyeType == EyeType.LEFT)
? getVrRenderer().getTextureLeftEye().getFrameBufferId()
: getVrRenderer().getTextureRightEye().getFrameBufferId();
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, vrFramebuffer);
drawFullscreenQuad(myPostProcessTexture);
}Important notes
|
This PR adds complete wiki documentation content for the AtumVR project.
Initial Research
The AtumVR GitHub wiki at https://github.com/Phoenix-Ra/AtumVR/wiki contains 9 pages.
Wiki Documentation Added
Created markdown files in
docs/wiki/folder with content for all 6 wiki pages that needed completion:Start Section
Advanced Section
Other
Each file follows the existing wiki pattern with a Contents section at the top, clear headers, and practical code examples focused on helping users understand how to work with AtumVR.
How to Use
Copy the content from each
.mdfile to the corresponding GitHub wiki page. A README.md in thedocs/wiki/folder provides mapping instructions.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.