Closed abhimanyuchadha96 closed 2 months ago
The color of the lighting is defaulted. See https://github.com/facebookresearch/pytorch3d/blob/main/pytorch3d/renderer/lighting.py#L164-L166 . So you can only see anything close to white at a specular highlight. If you want white things to be white, perhaps you could just use more ambient lighting, e.g. change the balance between the components, which should add to 1 in each channel, to something like
lights = DirectionalLights(
device=device,
ambient_color=((1.0, 1.0, 1.0),),
diffuse_color=((0., 0., 0.),),
specular_color=((0., 0., 0.),),
direction = [self.centroid])
If you do not know the root cause of the problem / bug, and wish someone to help you, please post according to this template:
🐛 Bugs / Unexpected behaviors
The renders don't look the real 3D object as the colors are off and details are also missing. Mostly the 3D objects that are white in color or have some amount of white in them are coming out grayish. Not sure if this is a bug or just the
SoftPhongShader
and/orRasterizationSettings
need to be updated with a specific value.NOTE: Please look at the existing list of Issues tagged with the label 'bug`. Only open a new issue if this bug has not already been reported. If an issue already exists, please comment there instead..
Instructions To Reproduce the Issue:
All other camera parameters are default taken from https://colab.research.google.com/github/facebookresearch/pytorch3d/blob/stable/docs/tutorials/render_textured_meshes.ipynb#scrollTo=CDQKebNNfBMI