Project

General

Profile

« Previous | Next » 

Revision 3273dce2

Added by Leszek Koltunski 8 months ago

fix the 'holes in textures' problem.

View differences:

src/main/java/org/distorted/library/effect/VertexEffectDeform.java
133 133
      + "float denomV = 1.0 / (aForce.y + Aw.x);                             \n"
134 134
      + "float denomH = 1.0 / (aForce.x + Aw.y);                             \n"
135 135

  
136
      + "vec3 vertCorr= ONE - aPS / ( aForce+C*aPS + (ONE-sign(aForce)) );   \n"  // avoid division by 0 when force and PS both are 0
136
      + "vec3 one_over_aforce = aForce - 0.001*(sign(aForce)-ONE);           \n"  // avoid division by 0 when force and PS both are 0
137
      + "vec3 vertCorr= ONE - aPS/(C*aPS + one_over_aforce);                 \n"  // avoid division by 0 when force and PS both are 0
137 138

  
138 139
      + "float mvXvert = -B * ps.x * aForce.y * (1.0-quot.y) * denomV;       \n"  // impact the vertical   component of the force vector has on horizontal movement
139 140
      + "float mvYhorz = -B * ps.y * aForce.x * (1.0-quot.x) * denomH;       \n"  // impact the horizontal component of the force vector has on vertical   movement

Also available in: Unified diff