mirror of
https://github.com/tiennm99/webgl-heart.git
synced 2026-10-11 12:28:55 +00:00
changed params
This commit is contained in:
1 parent
b5c62b8094
commit
503f0dfa90
1 file changed
+8
-5
@@ -106,18 +106,21 @@
|
||||
float nullPoint = 0.5;
|
||||
float scaledT = time * 1.3;
|
||||
float dt = scaledT - pLimit * ( 2. * floor( scaledT / (pLimit* 2.)) + 1.);
|
||||
float r = 15. + 1.25 * pow(sin(2. * PI * dt), 4.);
|
||||
float r = 15. + 1.2 * pow(sin(2. * PI * dt), 4.);
|
||||
if (dt < -nullPoint || dt > nullPoint) {
|
||||
r = 15.;
|
||||
}
|
||||
float dCell = length(h) - r;
|
||||
float dDyn = length(h) - r;
|
||||
float dConst = length(h) - 15.;
|
||||
|
||||
vec3 c = vec3(247. / 255., 89. / 255., 183. / 255.);
|
||||
if (dCell > 0.) c = vec3(250. / 255., 182. / 255., 223. / 255.);;
|
||||
if (dDyn > -1.) c = vec3(245. / 255., 100. / 255., 186. / 255.);
|
||||
vC = c;
|
||||
pos = pos - pos / length(pos) * (dCell) * 2.5;
|
||||
pos = pos - pos / length(pos) * (dDyn) * 2.5;
|
||||
|
||||
vec3 vPos = pos;
|
||||
vDiscard = dCell > 0. || dCell < -1.0 ? 1. : 0.;
|
||||
vDiscard = dConst > 0. || dConst < -1.0 ? 1. : 0.;
|
||||
|
||||
vec4 mvPosition = modelViewMatrix * vec4( pos, 1.0 );
|
||||
gl_PointSize = sqrt(length(pos)/30.) * size * ( 300.0 / -mvPosition.z ) * ratio;
|
||||
gl_Position = projectionMatrix * mvPosition;
|
||||
|
||||
Reference in new issue
Block a user