model-element icon indicating copy to clipboard operation
model-element copied to clipboard

Means of controlling the shadow

Open marcoscaceres opened this issue 1 year ago • 4 comments

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.

marcoscaceres avatar Aug 09 '22 04:08 marcoscaceres

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.

mikkoh avatar Aug 10 '22 05:08 mikkoh

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.

marcoscaceres avatar Aug 10 '22 07:08 marcoscaceres

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: @.***>

AdaRoseCannon avatar Aug 10 '22 07:08 AdaRoseCannon

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.

cabanier avatar Aug 22 '22 04:08 cabanier