Skip to content
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

Mesh3d ignores lighting with orthographic projection #4759

Open
thyu opened this issue Sep 11, 2024 · 2 comments
Open

Mesh3d ignores lighting with orthographic projection #4759

thyu opened this issue Sep 11, 2024 · 2 comments
Labels
bug something broken P3 backlog

Comments

@thyu
Copy link

thyu commented Sep 11, 2024

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.

@empet
Copy link

empet commented Sep 11, 2024

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.

@thyu
Copy link
Author

thyu commented Sep 11, 2024

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.

@gvwilson gvwilson changed the title Mesh3d ignores lighting with orhographic projection Mesh3d ignores lighting with orthographic projection Sep 11, 2024
@gvwilson gvwilson added bug something broken P3 backlog labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

3 participants