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

Bitmap and Checkerboard - max() Method Not Implemented #707

Open
Microno95 opened this issue May 1, 2023 · 4 comments · May be fixed by #719
Open

Bitmap and Checkerboard - max() Method Not Implemented #707

Microno95 opened this issue May 1, 2023 · 4 comments · May be fixed by #719

Comments

@Microno95
Copy link
Contributor

Summary

I am using a 2d texture to represent a rotationally symmetric 3d volume (really useful in the case of certain types of volume emitters, refer to #678) but I'm finding that it is not possible to obtain the maximum of a bitmap or checkerboard texture.

System configuration

System information:

  OS: Windows-10
  CPU: AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD
  GPU: NVIDIA GeForce RTX 3090
  Python: 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:51:29) [MSC v.1929 64 bit (AMD64)]
  NVidia driver: 531.68
  CUDA: 11.7.99
  LLVM: 15.-1.-1

  Dr.Jit: 0.4.2
  Mitsuba: 3.3.0
     Is custom build? False
     Compiled with: MSVC 19.34.31937.0
Variants:
        scalar_rgb
        scalar_mono
        scalar_mono_double
        scalar_mono_polarized
        scalar_mono_polarized_double
        scalar_rgb_double
        scalar_rgb_polarized
        scalar_rgb_polarized_double
        scalar_spectral
        scalar_spectral_double
        scalar_spectral_polarized
        scalar_spectral_polarized_double
        llvm_mono
        llvm_mono_double
        llvm_mono_polarized
        llvm_mono_polarized_double
        llvm_rgb
        llvm_rgb_double
        llvm_rgb_polarized
        llvm_rgb_polarized_double
        llvm_spectral
        llvm_spectral_double
        llvm_spectral_polarized
        llvm_spectral_polarized_double
        llvm_ad_mono
        llvm_ad_mono_double
        llvm_ad_mono_polarized
        llvm_ad_mono_polarized_double
        llvm_ad_rgb
        llvm_ad_rgb_double
        llvm_ad_rgb_polarized
        llvm_ad_rgb_polarized_double
        llvm_ad_spectral
        llvm_ad_spectral_double
        llvm_ad_spectral_polarized
        llvm_ad_spectral_polarized_double
        cuda_mono
        cuda_mono_double
        cuda_mono_polarized
        cuda_mono_polarized_double
        cuda_rgb
        cuda_rgb_double
        cuda_rgb_polarized
        cuda_rgb_polarized_double
        cuda_spectral
        cuda_spectral_double
        cuda_spectral_polarized
        cuda_spectral_polarized_double
        cuda_ad_mono
        cuda_ad_mono_double
        cuda_ad_mono_polarized
        cuda_ad_mono_polarized_double
        cuda_ad_rgb
        cuda_ad_rgb_double
        cuda_ad_rgb_polarized
        cuda_ad_rgb_polarized_double
        cuda_ad_spectral
        cuda_ad_spectral_double
        cuda_ad_spectral_polarized
        cuda_ad_spectral_polarized_double

Description

Bitmap and Checkerboard should have very simple implementations of the max method given that bitmap computes the mean (which can compute the max alongside it) and checkerboard has known components.

Happy to implement this and create a PR if there's no plans to do it. Will also see if it's straightforward to do for the mesh_attribute texture as well.

@njroussel
Copy link
Member

Hi @Microno95

Indeed! The Texture::max() method is a relatively recent addition I believe, we never had time to cover all existing plugins. I'd welcome any PR that even partially covers the existing plugins 😄

@Microno95
Copy link
Contributor Author

Great! I'll work on that, though I won't have access to my computer til Sunday so not before then 😅

Is there any interest for volume textures that are swept or tiled versions of 2d textures like 3d rotated cross-sections and swept sections? And is there any interest in composing textures/volumes through plugins that implement combining them at runtime through simple operations like addition, multiplication, mixing (using a texture or constant)?

I can roll them into the same PR as extensions to textures/volumes.

@njroussel
Copy link
Member

Thank you!

Is there any interest for volume textures that are swept or tiled versions of 2d textures like 3d rotated cross-sections and swept sections? And is there any interest in composing textures/volumes through plugins that implement combining them at runtime through simple operations like addition, multiplication, mixing (using a texture or constant)?

I'm not quite sure I understand the second half. What types are we talking about here? Composing these by using TensorXf objects can already be done I believe.

Overall, I think these are nice features but don't have their place in the main repository. We've discussed the ability to write and publish extensions/plugins to Mitsuba 3 a few times. I think something like this would be a great candidate. There's still a bit more work to be done on our end for this to be available.

@Microno95
Copy link
Contributor Author

Ah, I meant in the context of specifying scenes in xml files. It's not the simplest to say combine two images directly in mitsuba 3 and rather that's left to external software. Perhaps, as you said, a separate mitsuba extensions library makes more sense. I'd be very happy to contribute to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants