-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Differentiable rednering #1855
Comments
It depends on the exact settings of the renderer. Different configurations are differentiable in different ways. Perhaps you can share more of your code. |
Thanks a lot, following is the code. # This is the code to define the renderer
renderer = init_renderer(cameras,
shader=init_soft_phong_shader(
camera=cameras,
blend_params=BlendParams(),
device=device),
image_size=image_size,
faces_per_pixel=faces_per_pixel
) # This is the definition of the init_renderer() function
def init_renderer(camera, shader, image_size, faces_per_pixel):
raster_settings = RasterizationSettings(image_size=image_size, faces_per_pixel=faces_per_pixel)
renderer = MeshRendererWithFragments(
rasterizer=MeshRasterizer(
cameras=camera,
raster_settings=raster_settings
),
shader=shader
)
return renderer # This is the definition of the init_soft_phong_shader() function
def init_soft_phong_shader(camera, blend_params, device):
lights = AmbientLights(device=device)
shader = SoftPhongShader(
cameras=camera,
lights=lights,
device=device,
blend_params=blend_params
)
return shader |
Perhaps share the complete code? And also, what is |
This is quite complicated and I can't get to the bottom of it for you. can you gradually simplify? Are you trying to simulate actual PBR? I wonder if there may be other mesh differentiable rendering libraries which support PBR now |
Hi, I have a uv map named 'init_texture' which is a nn.parameters, I send it to TexturesUV and render a image:
TexturesUV(
maps=init_texture.unsqueeze(0).to(device) / 255,
faces_uvs=faces.textures_idx[None, ...],
verts_uvs=verts_uvs[None, ...])
images, fragments = renderer(mesh)
Then I compute loss between this image and a generated image, the images and nn.param did have grad but is very small
render image and generated image:
the grad for render image and nn.param:
Seems like the grad didn't pass back to my 'init_texture', I wonder is TexturesUV() or renderer() can't pass the grad?
The text was updated successfully, but these errors were encountered: