-
Notifications
You must be signed in to change notification settings - Fork 3
Update visual defaults #242
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
Conversation
Somewhat more conventional visual presentation: + Use a neutral gray background a-la most other CAD/modelling software for better contrast with the geometry (which defaults to a bright yellow). This is done with the "skybox-environment" image in model-viewer, so add a new setting value in settings.ts for this (it can be overriden in the URL just like other settings) + But using a skybox will cause that image to be used for lighting too, which is clearly not desired. So fetch a nice professional HDRI image from Polyhaven for lighting. This is much better (more directional, higher contrast) than the default light environment anyway. + The checkerboard texture isn't really a good default. Use a 1x1 white pixel instead, essentially presenting the model materials unchanged. Also collect the default color in gltf.py out of the code and put it next to the texture for clarity. This should probably be wired through to a setting at some point. Signed-off-by: Andy Ross <andy@plausible.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the visual defaults for the 3D model viewer to provide a more professional and conventional appearance. The changes replace the default checkerboard texture with a simple white pixel, introduce a neutral gray background for better contrast, and add professional HDRI lighting from Polyhaven.
- Replace checkerboard texture with 1x1 white pixel for cleaner material presentation
- Add separate skybox and environment image settings with neutral gray background and professional HDRI lighting
- Consolidate default color constants for better code organization
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
yacv_server/gltf.py | Updates default texture from checkerboard to white pixel and extracts default color constant |
frontend/viewer/ModelViewerWrapper.vue | Changes skybox-image binding from background to new skybox setting |
frontend/misc/settings.ts | Adds new skybox setting and updates background to use external HDRI image |
Thanks for the contribution! I will clean the code a little bit and merge it tomorrow. About the external HDRI, I prefer bundling it with the app so that the app is self-contained (it should work offline). The HDRI itself is almost as large as the uncompressed app, so I'm not sure if we should use it by default. I guess it is okay for most use cases. About exposing the default colors, you are missing the colors for edges, vertices, and axes, which also have defaults in the same file. I think all of them can be routed to the YACV instance so that they can be changed from code or with an environment variable like for |
[Mostly this just makes the default setup IMHO prettier. No significant functional changes. Note carefully the use of an external URL fetch from Polyhaven, not sure if that's kosher in this project or not.]
Somewhat more conventional visual presentation:
Use a neutral gray background a-la most other CAD/modelling software for better contrast with the geometry (which defaults to a bright yellow). This is done with the "skybox-environment" image in model-viewer, so add a new setting value in settings.ts for this (it can be overriden in the URL just like other settings)
But using a skybox will cause that image to be used for lighting too, which is clearly not desired. So fetch a nice professional HDRI image from Polyhaven for lighting. This is much better (more directional, higher contrast) than the default light environment anyway.
The checkerboard texture isn't really a good default. Use a 1x1 white pixel instead, essentially presenting the model materials unchanged.
Also collect the default color in gltf.py out of the code and put it next to the texture for clarity. This should probably be wired through to a setting at some point.