-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Make SkinnedMeshes of the local player head cast shadows: #78
Open
hai-vr
wants to merge
2
commits into
BasisVR:lts
Choose a base branch
from
hai-vr:local-head-casts-shadows
base: lts
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
hai-vr
commented
Dec 21, 2024
•
edited
Loading
edited
- The SkinnedMeshes of the local player that reference any bone under the Head bone should now cast shadows of the head onto the world and other players.
- SkinnedMeshes placed directly under the Head bone without any bone reference are not supported in this version.
- MeshRenderers placed directly under the Head bone are not supported in this version.
- This implementation:
- Evaluates at runtime.
- Creates a copy of all the transforms under the Head hierarchy.
- Creates copies of SkinnedMeshes that reference any bone under the Head.
- Bones under Head will reference the aforementionned copy.
- Bones not under Head will reference a zero-scale bone under the neck.
- Those SkinnedMeshes are set to Shadow Only.
- This implementation currently uses "Update When Offscreen" OFF and an off-world "Bounds" value to prevent the shadow from displaying when rendering the local player avatar in third person.
- This implementation was chosen because it's currently unclear how to manage the camera layers, and should be discussed further.
- Just before any camera is rendered, once per frame, we copy the transforms, SkinnedMesh component enabled-ness, and blendshapes, so that the shadow reflects the visual state of the original SkinnedMesh.
hai-vr
force-pushed
the
local-head-casts-shadows
branch
2 times, most recently
from
December 21, 2024 22:59
4a70f63
to
52542fd
Compare
hai-vr
changed the title
Make SkinnedMeshes of the local player cast shadows:
Make SkinnedMeshes of the local player head cast shadows:
Dec 21, 2024
hai-vr
force-pushed
the
local-head-casts-shadows
branch
2 times, most recently
from
December 22, 2024 21:08
48f34fe
to
5abe7c7
Compare
- The SkinnedMeshes of the local player that reference any bone under the Head bone should now cast shadows of the head onto the world and other players. - SkinnedMeshes placed directly under the Head bone without any bone reference are not supported in this version. - MeshRenderers placed directly under the Head bone are not supported in this version. - This implementation: - Evaluates at runtime. - Creates a copy of all the transforms under the Head hierarchy. - Creates copies of SkinnedMeshes that reference any bone under the Head. - Bones under Head will reference the aforementionned copy. - Bones not under Head will reference a zero-scale bone under the neck. - Those SkinnedMeshes are set to Shadow Only. - This implementation currently uses "Update When Offscreen" OFF and an off-world "Bounds" value to prevent the shadow from displaying when rendering the local player avatar in third person. - This implementation was chosen because it's currently unclear how to manage the camera layers, and should be discussed further. - Just before any camera is rendered, once per frame, we copy the transforms, SkinnedMesh component enabled-ness, and blendshapes, so that the shadow reflects the visual state of the original SkinnedMesh.
- Make object state after rendering camera more consistent: - When first-person camera finishes rendering: - rescale head back to one. - make first-person head shadow invisible. - This fixes an issue where having a mirror turned on would cause the head to be scaled to zero, which was messing the head shadow processing on the next frame. - Defensively protect access to the HeadShadowDriver field, which is null for a short time window on application load, but non-null of the time.
hai-vr
force-pushed
the
local-head-casts-shadows
branch
from
December 27, 2024 07:10
5abe7c7
to
fa7cfcf
Compare
is this ready? |
Is it functional, but ideally I'd like a second opinion from someone who is familiar with shadow "clones", i.e. Lyuma. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.