Skip to content

Enable the use of threejs lightShadows with custom shaders #30842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Spiri0 opened this issue Apr 1, 2025 · 1 comment
Closed

Enable the use of threejs lightShadows with custom shaders #30842

Spiri0 opened this issue Apr 1, 2025 · 1 comment
Milestone

Comments

@Spiri0
Copy link
Contributor

Spiri0 commented Apr 1, 2025

Description

First of all: This point is not a high priority but it would be useful.
I can access the shadow map and shadow matrix of a light source and use it in my own shaders since r174. That's great. The problem, however, is that when I change the light position, the shadows rattle.

https://codepen.io/Spiri0/pen/NPWEQmB?editors=0010

This is probably caused by a frame delay. If I create a custom light source with its own shadow and control the update myself, it works smoothly. That's also the reason why it's not a high priority in my opinion. I can solve this by creating a customLight with a customShadow. That's just more work. Being able to use the shadow texture from Threejs light sources would be much nicer.

Solution

I suspect the cause is a frame delay. I'm not very familiar with the threejs shadow logic yet. The solution would therefore be to fix this frame delay.

Alternatives

I use my own light source with my own shadow camera. It works perfectly.

Additional context

No response

@Spiri0
Copy link
Contributor Author

Spiri0 commented Apr 9, 2025

By creating my own light source sufficiently well solved

@Spiri0 Spiri0 closed this as completed Apr 9, 2025
@Mugen87 Mugen87 added this to the r176 milestone Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants