diff --git a/Ops.Extension.GlParticles/Ops.Extension.GlParticles.Dev.VelocityArea_v5/Ops.Extension.GlParticles.Dev.VelocityArea_v5.js b/Ops.Extension.GlParticles/Ops.Extension.GlParticles.Dev.VelocityArea_v5/Ops.Extension.GlParticles.Dev.VelocityArea_v5.js index faf9447..a27bd49 100644 --- a/Ops.Extension.GlParticles/Ops.Extension.GlParticles.Dev.VelocityArea_v5/Ops.Extension.GlParticles.Dev.VelocityArea_v5.js +++ b/Ops.Extension.GlParticles/Ops.Extension.GlParticles.Dev.VelocityArea_v5/Ops.Extension.GlParticles.Dev.VelocityArea_v5.js @@ -1,7 +1,7 @@ const render = op.inTrigger("Render"), inArea = op.inValueSelect("Area", ["Everywhere", "Sphere", "Box"], "Everywhere"), - inMethod = op.inValueSelect("Method", ["Point", "Direction", "Collision", "Rotate"], "Point"), + inMethod = op.inValueSelect("Method", ["Point", "Direction", "Collision", "Rotate","Vortex"], "Point"), inInvArea = op.inBool("Invert Area", false), inStrength = op.inFloat("Strength", 1), inSize = op.inFloat("Size", 1), @@ -115,6 +115,7 @@ function updateDefines() velAreaSys.bgShader.toggleDefine("METHOD_DIR", inMethod.get() == "Direction"); velAreaSys.bgShader.toggleDefine("METHOD_COLLISION", inMethod.get() == "Collision"); velAreaSys.bgShader.toggleDefine("METHOD_ROTATE", inMethod.get() == "Rotate"); + velAreaSys.bgShader.toggleDefine("METHOD_VORTEX", inMethod.get() == "Vortex"); velAreaSys.bgShader.toggleDefine("HAS_TEX_MUL", inTexMultiply.isLinked()); velAreaSys.bgShader.toggleDefine("INVERT_SHAPE", inInvArea.get()); diff --git a/Ops.Extension.GlParticles/Ops.Extension.GlParticles.Dev.VelocityArea_v5/att_velocityarea.frag b/Ops.Extension.GlParticles/Ops.Extension.GlParticles.Dev.VelocityArea_v5/att_velocityarea.frag index 53f1e99..52f65e0 100644 --- a/Ops.Extension.GlParticles/Ops.Extension.GlParticles.Dev.VelocityArea_v5/att_velocityarea.frag +++ b/Ops.Extension.GlParticles/Ops.Extension.GlParticles.Dev.VelocityArea_v5/att_velocityarea.frag @@ -136,6 +136,19 @@ void main() + #ifdef METHOD_VORTEX + // if(length(direction)>0.0) + // col.xyz+=normalize(direction)*finalStrength3; + + vec3 np= vec3( -(pos.xyz+areaPos).y, (pos.xyz+areaPos).x ,(pos.xyz+areaPos).z) / dot(pos.xyz,pos.xyz); // field around a vortex + + col.xyz+=(pos.xyz-np)*strength; + + #endif + + + + #ifdef METHOD_POINT col.xyz+=normalize(pos.xyz-areaPos)*finalStrength3; #endif