SpotLightShadow: Introduce aspect property#31020
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
I think the aspect should be automatic: set to 1 if there is no texture, and equal to the texture's aspect otherwise. There is no need for a separate |
I think it could be useful for rectangular lighting. |
I do not think that is necessary. |
|
Also, I think a rectangular projection is a bit too complex to ask a user to implement themselves in TSL, and it should be a built-in feature like "focus" and "penumbra". Support for "cookies" would also be a reasonable built-in feature for a spotlight. |
What would be support for cookies? |
Here is a good explanation: https://docs.unity3d.com/Manual/Cookies-introduction.html. |
|
TSL is great. However, I do not see it as the best solution for the "projector light" use case. Users should not have to code this particular feature themselves, IMHO. |
It seems like the article is talking about shadow baking like this and The idea of a projector is interesting especially if we integrate it with a |
|
I'm going to merge this PR and will work on creating a ProjectorLight that supports procedural shader, it seems like a good opportunity. |
|
Cookies can have an alpha channel, which can be used to attenuate the intensity. Here is another example: https://developer.playcanvas.com/tutorials/light-cookies/
A projector light that projects a movie would be good. It should just work, without the user have to write TSL to make it work. |
* TSL: Fix convert `.set*()` value to node-object * SpotLightShadow: Introduce `aspect` * improve custom aspect example * cleanup * Update webgpu_lights_spotlight.html * Update webgpu_lights_spotlight.html
* TSL: Fix convert `.set*()` value to node-object * SpotLightShadow: Introduce `aspect` * improve custom aspect example * cleanup * Update webgpu_lights_spotlight.html * Update webgpu_lights_spotlight.html
Related issue: #31013 (comment)
Summary
Example 1

Example 2
