Skip to content
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

Do all color-mapping on the GPU #1612

Closed
2 tasks done
emilk opened this issue Mar 20, 2023 · 2 comments · Fixed by #1865
Closed
2 tasks done

Do all color-mapping on the GPU #1612

emilk opened this issue Mar 20, 2023 · 2 comments · Fixed by #1865
Assignees
Labels
🔺 re_renderer affects re_renderer itself 📺 re_viewer affects re_viewer itself

Comments

@emilk
Copy link
Member

emilk commented Mar 20, 2023

Currently we color-map tensors and depth-images on the CPU. This has many downsides:

Instead, let's improve the re_renderer::TexturedRect API to handle:

  • Color map selector enum
  • A range for the color map
  • Gamma
  • Color maps for all 2D tensors in the image view
  • Color maps for all tensors in the tensor view

Misc TODO

  • Remove the extra enum Colormap that we have
  • Support texture filtering
@emilk emilk added 🔺 re_renderer affects re_renderer itself 📺 re_viewer affects re_viewer itself labels Mar 20, 2023
@emilk emilk self-assigned this Mar 21, 2023
@emilk
Copy link
Member Author

emilk commented Mar 21, 2023

We have a few different cases to cover.

The first is no color mapping, e.g. a normal RGBA / texture_2d<f32> / Rgba8UnormSrgb texture.

Then we have single-channel color mapping of:

  • texture_2d<u32> (R8Uint, R16Uint, R32Uint)
  • texture_2d<i32> (R8Sint, R16Sint, R32Sint)
  • texture_2d<f32> (R8Unorm, R8Snorm, R16Float R32Float)

Note that we have a choice for 8-bit integers if we want to normalize them (using texture_2d<f32>) or not (using texture_2d<i32> or texture_2d<u32>). For 16-bit and and 32-bit integers we don't have that choice, so we still need all three texture_2d types.

The non-color-mapped path should probably be separate, but for the color-mapped path we have the choice to either write three shaders, or combine them into one. For the latter we would use a runtime-switch to know what texture_2d to read from. The two unread ones would be bound to dummy textures.

@emilk
Copy link
Member Author

emilk commented Apr 3, 2023

Also: all images in our UI should be shown using the same re_renderer shader, and we should get rid of get_colormapped_view/ColoredTensorView

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔺 re_renderer affects re_renderer itself 📺 re_viewer affects re_viewer itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant