-
Notifications
You must be signed in to change notification settings - Fork 248
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
Incorrect normal maps rendered using AOV integrator with normalmap
BSDF
#1331
Comments
normalmap
BSDFnormalmap
BSDF
I have been facing the same issue for a while. I'm not sure if it's the issue with the AOV integrator or the NormalMap BSDF. Under the same setting, the roughness map is rendered correctly according to the given roughness texture. However, the normal map is still flat (incorrect) with no texture mapped to it. |
Hi @stymbhrdwj , Could you please provide a copy of the scene file/assets that you used so that we can attempt to reproduce the issue you're encountering? |
I've added the scene file and assets in the above zip file. Run the provided python script to render the normal. |
I modified the file case Type::TexturedNormal: {
Normal3f n(0.f);
if (dr::any_or<true>(si.is_valid()))
{
Mask valid = active && si.is_valid();
BSDFPtr m_bsdf = si.bsdf(ray);
Frame3f frame = m_bsdf->frame(si, valid);
n = dr::normalize(si.to_world(frame.n));
}
*aovs++ = n.x();
*aovs++ = n.y();
*aovs++ = n.z();
}
break; with appropriate changes to
I'm sharing my changes to |
Hi @stymbhrdwj, As you've discovered the issue was that the shading frame perturbations are computed internally within the normalmap BSDF itself and so you need some mechanism to fetch them to write into the AOV buffer. We're focusing on putting out a new Mitsuba release at the moment, but we'll definitely revisit this to add support for users not developing with a custom build. |
@rtabbara Thanks for looking into this. For now, I would greatly appreciate any help in resolving the error encountered when running the code on |
Hi @stymbhrdwj, I had a look at this and the issue is in your implementation of the "default" vectorized function call
Unfortunately, when using JIT variants, the default constructor
should hopefully work. Indeed, if I make the change I get |
@rtabbara It works! Thanks a ton. |
Summary
I am trying to render normal maps after applying a normal texture on the object using
normalmap
BSDF with thesh_normal
variable of the AOV integrator. Below is the desired normal mapHowever, I am getting this normal map
System configuration
System information:
OS: Ubuntu 20.04.6 LTS
CPU: Intel(R) Core(TM) i9-14900K
GPU: NVIDIA RTX A5000
NVIDIA GeForce RTX 4090
Python: 3.11.8 (main, Feb 26 2024, 21:39:34) [GCC 11.2.0]
NVidia driver: 535.183.01
CUDA: 12.2.91
LLVM: 12.0.0
Dr.Jit: 0.4.6
Mitsuba: 3.5.2
Is custom build? True
Compiled with: Clang 10.0.0
Variants:
scalar_rgb
scalar_spectral
cuda_rgb
cuda_ad_rgb
cuda_mono
cuda_ad_mono
llvm_rgb
llvm_ad_rgb
llvm_mono
llvm_ad_mono
cuda_rgb_polarized
cuda_ad_rgb_polarized
cuda_mono_polarized
cuda_ad_mono_polarized
The text was updated successfully, but these errors were encountered: