-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checkpoint. Waiting to implement constraint.
- Loading branch information
1 parent
ac3c0be
commit af3e89b
Showing
19 changed files
with
456 additions
and
908 deletions.
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
102 changes: 0 additions & 102 deletions
102
...ysLabResources/Shaders/Compute/DynamicStrands/Constraints/StiffRodProjectConstraints.comp
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
...Resources/Shaders/Compute/DynamicStrands/Constraints/StiffRodStretchShearConstraints.comp
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require | ||
#extension GL_KHR_shader_subgroup_basic : require | ||
#extension GL_KHR_shader_subgroup_ballot : require | ||
#extension GL_KHR_shader_subgroup_vote : require | ||
#extension GL_ARB_shading_language_include : enable | ||
#extension GL_EXT_control_flow_attributes : require | ||
#define DYNAMIC_STRANDS_SET 0 | ||
#include "DynamicStrands.glsl" | ||
|
||
const uint WORKGROUP_SIZE = EXT_TASK_SUBGROUP_COUNT * EXT_TASK_SUBGROUP_SIZE; | ||
|
||
const uint ITERATIONS_PER_TASK = ((EXT_INVOCATIONS_PER_TASK + WORKGROUP_SIZE - 1) / WORKGROUP_SIZE); | ||
|
||
uint baseID = gl_WorkGroupID.x * EXT_INVOCATIONS_PER_TASK; | ||
uint laneID = gl_LocalInvocationID.x; | ||
|
||
layout(local_size_x = WORKGROUP_SIZE, local_size_y = 1, local_size_z = 1) in; | ||
|
||
#define BARRIER() \ | ||
memoryBarrierShared(); \ | ||
barrier(); | ||
|
||
layout(push_constant) uniform PUSH_CONSTANTS { | ||
uint strand_size; | ||
}; | ||
|
||
#define DYNAMIC_STRANDS_PHYSICS_SET 1 | ||
#include "DynamicStrandsPhysics.glsl" | ||
|
||
void project_constraint(in int constraint_handle); | ||
|
||
void main(){ | ||
|
||
[[unroll]] | ||
for (uint i = 0; i < ITERATIONS_PER_TASK; i++) | ||
{ | ||
uint local_index = laneID + i * WORKGROUP_SIZE; | ||
uint strand_index = baseID + local_index; | ||
|
||
if(strand_index >= strand_size) break; | ||
|
||
PerStrandData strand_data = per_strand_data_list[strand_index]; | ||
int constraint_handle = strand_data.begin_constraint_handle; | ||
while(constraint_handle != strand_data.end_constraint_handle){ | ||
project_constraint(constraint_handle); | ||
constraint_handle = floatBitsToInt(constraints[constraint_handle].bending_and_torsion_compliance_next_constraint_handle.w); | ||
} | ||
project_constraint(constraint_handle); | ||
} | ||
} | ||
|
||
void project_constraint(in int constraint_handle){ | ||
Constraint constraint = constraints[constraint_handle]; | ||
int segment0_handle = floatBitsToInt(constraint.stiffness_coefficient_k_segment0_index.w); | ||
int segment1_handle = floatBitsToInt(constraint.rest_darboux_vector_segment1_index.w); | ||
Segment segment0 = segments[segment0_handle]; | ||
Segment segment1 = segments[segment1_handle]; | ||
|
||
} |
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
Oops, something went wrong.