-
Notifications
You must be signed in to change notification settings - Fork 996
[DRAFT] implementation of Shadowmapping #7592
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
base: master
Are you sure you want to change the base?
Conversation
Extensions/3D/DirectionalLight.ts
Outdated
this.light.position.set(1, 0, 0); | ||
this.light.castShadow = true; | ||
this.light.shadow.mapSize.width = 1024; | ||
this.light.shadow.mapSize.height = 1024; | ||
this.light.shadow.camera.near = 0.1; | ||
this.light.shadow.camera.far = 10; | ||
this.light.shadow.camera.right = 10; | ||
this.light.shadow.camera.left = 10; | ||
this.light.shadow.camera.top = 10; | ||
this.light.shadow.camera.bottom = 10; | ||
this.light.position.set(0, 20, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change of position?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgotten small change for better visualization of the light with the lightHelper in my gdevelop game (does not modify behavior)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change of axis is not an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not, it only changes the "direction" of the directionalLight, but it still is a light that (should) casts shadow normally
I tried implementing the built-in shadowmapping system of threeJS exposed here (this implementation is only for DirectionalLight, but the concept is the same for each type of light):
https://threejs.org/examples/webgl_shadowmap_viewer.html
a course on the subject (very short) : https://threejs-journey.com/lessons/shadows#
In my implementation, i forced every required booleans absolutely everywhere it could be necessary. I did not have any good result with this way, nor with a more precise implementation. I push this for clarity.
I have only two theories to explain why there is no shadows :