I want to generate uv map with pytorch3d. But it seems that renderer must set up lighting (shader), which interferes uv map? So I want to ask about how can I render without any light?
Thank you in advance!
The simplest solution is to set all the intensity values to (0, 0, 0) when initializing the Lights class. A cleaner approach would be to define your own shader which does not apply lighting e.g.
class HardShader(nn.Module):
def __init__(
self, device="cpu", cameras=None, blend_params=None
):
super().__init__()
self.cameras = cameras
self.blend_params = blend_params if blend_params is not None else BlendParams()
def forward(self, fragments, meshes, **kwargs) -> torch.Tensor:
cameras = kwargs.get("cameras", self.cameras)
if cameras is None:
msg = "Cameras must be specified either at initialization \
or in the forward pass of HardPhongShader"
raise ValueError(msg)
texels = interpolate_vertex_colors(fragments, meshes)
blend_params = kwargs.get("blend_params", self.blend_params)
images = hard_rgb_blend(texels, fragments, blend_params)
return images
The Shaders that we provide are only examples and are designed to be easily customized based on your use case!
@TheshowN do you still need help with this issue?
Most helpful comment
The simplest solution is to set all the intensity values to
(0, 0, 0)when initializing theLightsclass. A cleaner approach would be to define your own shader which does not apply lighting e.g.The Shaders that we provide are only examples and are designed to be easily customized based on your use case!