Skip to content

Add wiki documentation content for AtumVR#3

Closed
Copilot wants to merge 2 commits intomasterfrom
copilot/check-wiki-pages
Closed

Add wiki documentation content for AtumVR#3
Copilot wants to merge 2 commits intomasterfrom
copilot/check-wiki-pages

Conversation

Copy link

Copilot AI commented Jan 21, 2026

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

  • Basics.md - Library organization, entry point, and lifecycle
  • Rendering-Basics.md - Setting up renderer, scenes, eye cameras, and textures with code examples
  • Input-Basics.md - Input handler, devices (HMD/controllers), actions, and haptic feedback

Advanced Section

  • Rendering-Advanced.md - Hidden area mesh optimization, custom textures, resolution/swapchain, multi-pass rendering
  • Input-Advanced.md - Custom action sets, profile sets, creating custom actions, action listeners

Other

  • Miscellaneous.md - Logging, error handling, state change callbacks, OpenXR extensions, tips and best practices

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 .md file to the corresponding GitHub wiki page. A README.md in the docs/wiki/ folder provides mapping instructions.

Original prompt

Lemme know how many pages of the WIKI you can find here on AtumVR project https://github.com/Phoenix-Ra/AtumVR/wiki

Don't start pull request or anything related to coding yet


💡 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.

Copilot AI changed the title [WIP] Check number of pages in AtumVR wiki Research: AtumVR Wiki page count investigation Jan 21, 2026
Copilot AI requested a review from Phoenix-Ra January 21, 2026 12:04
@Phoenix-Ra
Copy link
Owner

@copilot Thank you. Now your task is to help me finish the WIKI on following pages:

  1. https://github.com/Phoenix-Ra/AtumVR/wiki/Basics
  2. https://github.com/Phoenix-Ra/AtumVR/wiki/Rendering-Basics
  3. https://github.com/Phoenix-Ra/AtumVR/wiki/Input-Basics
  4. https://github.com/Phoenix-Ra/AtumVR/wiki/Rendering-Advanced
  5. https://github.com/Phoenix-Ra/AtumVR/wiki/Input-Advanced
  6. https://github.com/Phoenix-Ra/AtumVR/wiki/Miscellaneous

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.
If you find weird things in my code, bad structure or naming, you can suggest changes as well.

Co-authored-by: Phoenix-Ra <53151806+Phoenix-Ra@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 21, 2026

@copilot Thank you. Now your task is to help me finish the WIKI on following pages:

  1. https://github.com/Phoenix-Ra/AtumVR/wiki/Basics
  2. https://github.com/Phoenix-Ra/AtumVR/wiki/Rendering-Basics...

I've created complete wiki content for all 6 pages in docs/wiki/ folder (commit f91c893).

Files created:

  • Basics.md - Enhanced with your existing content
  • Rendering-Basics.md - Setting up renderer, scenes, eye cameras, textures with code examples
  • Input-Basics.md - Input handler, devices (HMD/controllers), actions, haptic feedback
  • Rendering-Advanced.md - Hidden area mesh optimization, custom textures, resolution/swapchain, multi-pass rendering
  • Input-Advanced.md - Custom action sets, profile sets, creating custom actions, action listeners
  • Miscellaneous.md - Logging, error handling, state callbacks, OpenXR extensions, tips/best practices

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:

  1. In XREyeCamera.updateProjectionMatrix(), the projection matrix is reassigned rather than updated in place - could use projectionMatrix.identity().setPerspectiveOffCenterFov(...) for consistency
  2. The ExampleScene.updateShaderVariables() creates new Matrix4f objects each frame - consider pre-allocating these for better performance

Copilot AI changed the title Research: AtumVR Wiki page count investigation Add wiki documentation content for AtumVR Jan 21, 2026
@Phoenix-Ra
Copy link
Owner

@copilot now I need you to make it with the following idea:
keep things understandable and straightforward, the goal of this WIKI is to help understand how to work with AtumVR, not describe everything about it.

For more advanced information, make a separate page like this one:

Contents

  1. Hidden Area Mesh
  2. Custom Textures
  3. Resolution and Swapchain
  4. Multi-pass Rendering

Hidden Area Mesh

VR 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 data

float[] leftHiddenArea = vrRenderer.getHiddenAreaVertices(EyeType.LEFT);
float[] rightHiddenArea = vrRenderer.getHiddenAreaVertices(EyeType.RIGHT);

The returned array contains triangle vertices in the format [x1, y1, x2, y2, x3, y3, ...] in pixel coordinates. These triangles represent the areas that should NOT be rendered.

Using hidden area for optimization

You can use this data to create a stencil buffer that prevents rendering to hidden areas:

  1. At the start of each eye render, draw the hidden area triangles to the stencil buffer
  2. Set stencil test to fail where hidden area was drawn
  3. Render your scene normally - pixels in hidden area will be skipped

This optimization can significantly improve performance, especially on complex scenes.

Custom Textures

While XRTexture works for most cases, you can create custom texture classes for more control.

Extending XRTexture

public 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 Swapchain

Getting render resolution

int 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 formats

AtumVR requests swapchain images in this order of preference:

  1. GL_SRGB8_ALPHA8 - sRGB with alpha (best quality)
  2. GL_SRGB8 - sRGB without alpha
  3. GL_RGB10_A2 - 10-bit RGB
  4. GL_RGBA16F - 16-bit float RGBA
  5. GL_RGBA8 - fallback

You can customize this by overriding getSwapChainFormats() in your XRProvider:

@Override
public List<Integer> getSwapChainFormats() {
    return List.of(
        GL21.GL_SRGB8_ALPHA8,
        GL11.GL_RGBA8
    );
}

Multi-pass Rendering

For complex rendering pipelines, you may need multiple passes per eye.

Rendering to intermediate buffers

Instead 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

  • Always end each eye's rendering with the final result in the VR framebuffer
  • The VR runtime expects the swapchain image to contain the final rendered frame
  • Be mindful of performance - VR requires high framerates (typically 72-120 FPS)

Copilot stopped work on behalf of Phoenix-Ra due to an error January 21, 2026 12:45
@Phoenix-Ra Phoenix-Ra closed this Jan 25, 2026
@Phoenix-Ra Phoenix-Ra deleted the copilot/check-wiki-pages branch January 25, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants