-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
[WIP][Rendering] Blendshapes (on behalf of Noa7/Noah7071) #2136
Draft
Eideren
wants to merge
18
commits into
stride3d:master
Choose a base branch
from
Noah7071:master
base: master
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.
Draft
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ed0e939
BASE COMM
noa7 a3f044a
Updates on Shader and resource marshaling
noa7 8a3c13f
Update- cleanup
noa7 a679906
Updates- clean up
noa7 afe10c0
Updates
noa7 0a516fd
Updates as by Eidren & IXLLEGACYIXL on Github PR review
noa7707 6649b09
Update shader- remove commented test code
Noah7071 6ed75b6
Update: Clean up to effect class & shader
Noah7071 5db94d9
Scale Factor moved to Importer
Noah7071 c04c84d
Removed extra class Vec4
Noah7071 e66c0c8
Fix to update scale factor in impoter
Noah7071 36c3daf
Normal fix on blendshapes
Noah7071 06c130b
Normal fix
Noah7071 1751b13
IMPORTER CKECIIN
Noah7071 af97e33
Importer
Noah7071 96f878d
Spell fix
Noah7071 58ead58
Updates to animation importer
Noah7071 f13c8f0
Animation Updates
Noah7071 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,20 +182,13 @@ public void AddBlendShapes(Shape shape, float weight) | |
public float[] GetBlendWeights(out float cummulativeWeight) | ||
{ | ||
float[] shapeWeights = new float[Shapes.Count]; | ||
cummulativeWeight = 0f; | ||
|
||
cummulativeWeight = 0f; | ||
for (int i = 0; i < Shapes.Count; i++) | ||
{ | ||
var shapeKV = Shapes.ElementAt(i); | ||
var shape = shapeKV.Key; | ||
var shapeWeight = Math.Clamp(shapeKV.Value, 0f, 1f); | ||
float adjustedWeight = shapeWeight; | ||
// if (cummulativeWeight >= 1f) { adjustedWeight = 0f; } | ||
// else if (cummulativeWeight + shapeWeight > 1) { adjustedWeight = 1 - cummulativeWeight; } | ||
//else | ||
//{ | ||
// adjustedWeight = shapeWeight; | ||
//} | ||
cummulativeWeight += adjustedWeight; | ||
shapeWeights[i] = adjustedWeight; | ||
} | ||
|
@@ -216,15 +209,14 @@ public List<Vector3> AdjustPositionToDrawInstance() | |
{ | ||
if (!mappings.ContainsKey(tup_id_vec.Item2)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use the new TryAdd of the dictionary to avoid double lookup in the dictionary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
{ | ||
mappings.Add(tup_id_vec.Item2, tup_id_vec.Item3); | ||
mappings.TryAdd(tup_id_vec.Item2, tup_id_vec.Item3); | ||
} | ||
} | ||
var positions = Draw.VCPOLYIN.Select(c => c.Item3).ToArray(); | ||
List<int> updatedVertexMapping = Draw.VertexMapping.ToList(); | ||
|
||
|
||
Vector3[] NewVectices = new Vector3[updatedVertexMapping.Count]; | ||
|
||
for (var i = 0; i < updatedVertexMapping.Count; i++) | ||
{ | ||
var v = posBlend[originalVerticesIDS[updatedVertexMapping[i]]]; | ||
|
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
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.
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.
did you mean to write
blendPos+=float4...
instead ofblendPos=+float4...
?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.
Yes, error on my part, fixed to standard a= a+b format in latest