plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Mesh3d ignores lighting with orthographic projection

Open thyu opened this issue 1 year ago • 2 comments

It seems like lighting of Mesh3d is ignored when orhogonal projection is used, example image:

image

With exactly the same plot, but with perspective projection, lighting is fine:

image

I just wonder if this is a known issue, or is it a bug somewhere?

I tried to play around with camera locations and lighting parameters (diffuse, ambient, etc.).

Only ambient lighting has effect when orthographic projection is enabled (as you can see in the picture above the whole mesh only has a single flat color) - maybe shader issue?

The version of plotly.py that I am using is 5.6.0.

thyu avatar Sep 11 '24 07:09 thyu

I don't think lighting has ever worked with orthographic projection of a mesh3d or surface. Orthographic projection is less used by plotly users. I tested it with the latest plotly version (5.24) and here https://chart-studio.plotly.com/~empet/16215/lighting-doesnt-work-with-orth/#/ is the confirmation of the reported bug. Googling for "Does lighting work with orthographic projection?" returns a lot of complaints for different graphic libraries.

empet avatar Sep 11 '24 10:09 empet

I understand perhaps not many people use orthographic projection. But at the same time, I was not expecting changing the projection would break the whole 3d shading thing, there could be a bug here? (I also do not see any documentation saying "Hey if you use orthographic projection, lighting will not be supported, I think at least we need to update the doc?).

Without a properly working lighting/shading control, orthographic project is not useful here.

thyu avatar Sep 11 '24 18:09 thyu