Skip to content

[Feature] Add fisheye rasterized rendering#44

Merged
ACMLCZH merged 15 commits into
Genesis-Embodied-AI:mainfrom
NoahLinckeScout:noah-fisheye_equidistant
Dec 21, 2025
Merged

[Feature] Add fisheye rasterized rendering#44
ACMLCZH merged 15 commits into
Genesis-Embodied-AI:mainfrom
NoahLinckeScout:noah-fisheye_equidistant

Conversation

@NoahLinckeScout
Copy link
Copy Markdown
Contributor

@NoahLinckeScout NoahLinckeScout commented Oct 27, 2025

Add two pass fisheye rendering

  1. Render in perspective as usual, staying in clip space
  2. Warp image to fisheye

This avoids large polygon interpolation errors that will occur if we attempt to render directly in fisheye.

Next steps could be to add more viewports or supersampling, by default we oversample the edges and undersample the center of images (lower resolution in the center)
ex: https://gfxcourses.stanford.edu/cs248/winter21content/media/vr/12_vr_sm.pdf
Screenshot 2025-10-28 at 3 57 11 PM

@YilingQiao YilingQiao requested a review from yuhongyi October 27, 2025 23:20
@yuhongyi
Copy link
Copy Markdown
Contributor

yuhongyi commented Oct 28, 2025

Add two pass fisheye rendering

  1. Render in perspective as usual, staying in clip space
  2. Warp image to fisheye

This avoids large polygon interpolation errors that will occur if we attempt to render directly in fisheye.

Next steps could be to add more viewports or supersampling, by default we oversample the edges and undersample the center of images (lower resolution in the center) ex: https://gfxcourses.stanford.edu/cs248/winter21content/media/vr/12_vr_sm.pdf Screenshot 2025-10-15 at 3 00 20 PM

The image link in the PR description seems broken or somehow I don't have access. Could you fix it?

@NoahLinckeScout
Copy link
Copy Markdown
Contributor Author

Ah it was a copied link, reuploaded it in this PR. In case you still can't see it it's the pic in the bottom right of page 43 of those Stanford slides: "Problem: oversampling at periphery"

Comment thread include/madrona/render/ecs.hpp Outdated
Comment thread include/madrona/render/ecs.hpp Outdated
};

Projection projection;
float fisheyeFovRadians;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does fisheyeFovRadians mean? How does it work different from fovScale?
It's better to write a documentation or README to explain how the fisheye camera is implemented and how each parameters that are added affect the final rendering result. The slides from the link in the PR description is not very detailed.

Comment thread include/madrona/render/ecs.hpp Outdated
float zNear;
float zFar;
int32_t worldIDX;
float fisheyeThetaMax;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is fisheyeThetaMax?

Comment thread include/madrona/render/ecs.hpp Outdated
Comment thread src/render/ecs_system.cpp Outdated
Comment thread src/render/ecs_system.cpp
some_value += (int)aabbs[0].data[0].x;

continue;
if (sm.camera.projectionType == MADRONA_PROJECTION_PERSPECTIVE) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like culling will be skipped when doing fisheye rendering. Could you explain why? Do you have benchmark data to show the performance impact on rendering without culling?

Comment thread src/render/shaders/shader_common.h Outdated
Comment thread src/render/shaders/draw_deferred_rgb.hlsl
float2 sample_px = float2(idx.xy);
bool sample_valid = true;

if (view_data.projectionType == MADRONA_PROJECTION_FISHEYE_EQUIDISTANT) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move fisheye-specific lighting code to a separate function?
The changes being made adds additional computation that was not necessary for perspective camera rendering.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also explain the core algorithm/approach here in documentation.

@Kashu7100
Copy link
Copy Markdown

@NoahLinckeScout do you have some time to check the @yuhongyi 's review?

@ACMLCZH ACMLCZH self-requested a review December 21, 2025 11:37
@ACMLCZH ACMLCZH merged commit 24b5a30 into Genesis-Embodied-AI:main Dec 21, 2025
2 checks passed
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.

4 participants