R168 WebGPU - Chasing Shadows - fixed in r169

it’s not quite setup right ( the position of the light is fixed here and would actually need to rise and sink with it’s projected position on to the terrain to work as expected…) but here’s a basic demo of the concept…

https://codepen.io/forerunrun/full/YzodRdd

:sweat_smile: :person_facepalming: you’re correct here, from implementing the above demo i can now see your point… Spotlight would kind of need to be rewritten or extended as OrthographicSpotlight maybe
EDIT: or I’m confusing myself and the entry sentence above the codepen example (offsetting light position distance to terrain) may work :face_with_monocle:

EDIT 2: @phil_crowther I’ve updated the above pen with the suggested projected offset calculation however this may not be a viable option either way based on your needs…

EDIT 3: the spotLight.map.rotation would need to also be calculated with this suggestion as the image is always facing towards the direction the light is pointing… @Mugen87 is it a known limitation that the spotLight.map cannot be rotated the same as typical textures? there seems to be a similar thread to this question here… Spotlight.map rotation

3 Likes