immersive-web / model-element

Repository for the <model> tag. Feature leads: Marcos Cáceres and Laszlo Gombos
https://immersive-web.github.io/model-element/
Other
62 stars 11 forks source link

Means of controlling the shadow #48

Open marcoscaceres opened 1 year ago

marcoscaceres commented 1 year ago

There are cases where it may not be desirable to have a shadow being cast, because the shadow can be larger than the viewport in which an object is being show. Also, as the "camera" rotates, the shadow can end up looking weird and exposing the boundary of the <model> element.

For example:

Screen Shot 2022-08-09 at 2 25 31 pm

It might be good to disable the shadow entirely? Or some other means for developers to express where the light source should be to cast the shadow where they might want.

mikkoh commented 1 year ago

A boolean operation of show or hide would be great. I do wonder if there should be a method to adjust the "intensity" of the shadow. In css I believe users often pass in a rgba value where a adjusts the "intensity" but this in a 3D scenario would produce unrealistic shadows in some cases. I also wonder as technology/performance/techniques of 3D rendering improves whether having the ability to adjust the intensity of a shadow becomes moot anyway.

marcoscaceres commented 1 year ago

As a start, it might be nice to just disable the shadow... we can start getting into fancier shadow casting/light(s) position/control down the line.

AdaRoseCannon commented 1 year ago

I think at least with regards to direction and type of shadow GLTF has support for providing a light source, although can't dictate whether lights and objects cast shadow in the model itself I would be surprised if USDZ didn't also have light support

On Wed, 10 Aug 2022, 08:27 Marcos Cáceres, @.***> wrote:

As a start, it might be nice to just disable the shadow... we can start getting into fancier shadow casting/light(s) position/control down the line.

— Reply to this email directly, view it on GitHub https://github.com/immersive-web/model-element/issues/48#issuecomment-1210271558, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAHSMRKYYJGGHE72G6EL33VYNKXLANCNFSM557KHO2A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

cabanier commented 1 year ago

As a start, it might be nice to just disable the shadow... we can start getting into fancier shadow casting/light(s) position/control down the line.

The UA can decide if they want to render shadows or not, or how they are rendered. A UA that actually draws models in 3D is going to want to control the light source and shadow.