triplex
triplex copied to clipboard
Lighting does not match between Browser environment and Triplex Environment
Hi! Thank you so much for building Triplex, this project is amazing 🤩 !!
I'm experiencing something, but can't tell if it's a bug or intended... the lighting is very different between Triplex and my own Browser's React/Vite app when I show them side by side. See below:
Is there anyway to turn this off or toggle it, so I can see what my scene will actually look like in Triplex?
Link to repository here, you should be able to get it running with bun install && bun dev
https://github.com/liamdanielduffy/triplex-lighting-repro
Thanks so much! :)
Hi! Thank you. Currently triplex has default lights when none were found in a scene. I agree it would be great to turn them off when appropriate - will put that in the next release.
It basically looks for a jsx element with light in it, so it's not the most resilient right now.
I'll pull your repo and have a look when I can.
Hey mate just pulled the repo, I had to remove App.tsx
from being picked up by Triplex else I'd get an error (...where the Canvas element couldn't have its props figured out, or something).
Either way running your app in Triplex (and running the "Scene" component) I actually see what you see when running:
Triplex has some logic to render or not render default lights. It's currently a bit magical, such that if, in the currently opened component, there is an element that has "Light" in it - no lights will be rendered. Otherwise it will. I'm thinking to move to a more explicit setup where in the triplex provider you can define your own custom lights, if you want.
And then when creating a new Triplex project there can be a default light in there setup that you can change if you want. How does that sound?
Yea, that would be super helpful! Thank you :)
Apologies this hasn't yet been resolved. I quite like the auto-light behavior out-of-the-box so I'm not sure if moving to the provider solution is the right move. It would make things easier overall though (less code to maintain, just move it to the template).
Do you have any thoughts around this / the potential UX of either direction?
No apologies needed, you don't owe me anything!
Is it possible to just keep the current solution in most cases, but have a well-documented way to ensure that the lighting setups will perfectly match.
I'm happy to eat the discomfort and walk the more painful path as a user, as long as there is some way to ensure my triplex studio lighting matches my browser lighting.
It's as much a documentation/capability problem as anything. I don't have strong UX preference, as long as I can figure it out :)
In the next release of Triplex a new control has been added that lets you turn off/on the editor default lights:
Available both in the standalone app and Triplex for VS Code.