model-element
model-element copied to clipboard
Means of controlling the shadow
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:
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.
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.
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.
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: @.***>
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.
I personally think that no UA should be placing shadows unless an element is out in the world / on the ground, which wasn't the original context for the issue - To talk about that I'd prefer to open a new issue more closely-related to that context.