Skip to content

Commit 2d86020

Browse files
committed
Fixed GLSL errors of mixing types
1 parent 5dc732d commit 2d86020

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shaders/osgssboComputeShader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ void main() {
9797
highp float _coeff_A = 1.0;
9898
highp float _coeff_B = 1.0;
9999
highp vec3 velocityNormalized = normalize(partPrevVelocity.xyz);
100-
highp float R = _coeff_A * r * velocityNormalized + _coeff_B * r * r * velocityNormalized * velocityNormalized;
100+
highp float R = _coeff_A * r * velocityNormalized.x + _coeff_B * r * r * velocityNormalized.y * velocityNormalized.z;
101101
highp vec3 fr = -R * vec3(partPrevVelocity.xyz);
102102
highp float mass = 1000.0 * r*r*r *3.141572 *0.75;
103103
highp float massInvers = 1.0 / mass;
104104
highp vec3 dv = fr * massInvers * osg_DeltaFrameTime;
105105

106106

107107
vec3 vortAxis = vec3(0, 1, 0);
108-
highp float l = vortAxis * ( partPrevPos.xyz - vec3(0.5, 0.5, 0.5));
108+
highp float l = dot(vortAxis, ( partPrevPos.xyz - vec3(0.5, 0.5, 0.5)));
109109
highp vec3 lc = vec3(0.5, 0.5, 0.5) + vortAxis * l;
110110
highp vec3 Ra = partPrevPos.xyz - lc;
111111
highp vec3 vVort = cross(Ra, vortAxis) * massInvers ;

0 commit comments

Comments
 (0)