triplex icon indicating copy to clipboard operation
triplex copied to clipboard

Lighting does not match between Browser environment and Triplex Environment

Open ajroberts0417 opened this issue 1 year ago • 6 comments

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?

image

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! :)

ajroberts0417 avatar Sep 27 '23 14:09 ajroberts0417

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.

itsdouges avatar Sep 27 '23 21:09 itsdouges

I'll pull your repo and have a look when I can.

itsdouges avatar Oct 04 '23 20:10 itsdouges

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:

image

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?

itsdouges avatar Oct 13 '23 07:10 itsdouges

Yea, that would be super helpful! Thank you :)

ajroberts0417 avatar Oct 13 '23 13:10 ajroberts0417

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?

itsdouges avatar Dec 04 '23 10:12 itsdouges

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 :)

ajroberts0417 avatar Dec 04 '23 17:12 ajroberts0417

In the next release of Triplex a new control has been added that lets you turn off/on the editor default lights:

image

Available both in the standalone app and Triplex for VS Code.

itsdouges avatar Sep 13 '24 21:09 itsdouges