Project

General

Profile

« Previous | Next » 

Revision 4aa38649

Added by Leszek Koltunski over 5 years ago

Redefine the Vertex Region from (x,y,r,unused) to (x,y,z,r). This takes into account the 'Z', which makes it possible to warp only one side of a 3D Mesh like Sphere.

Also corresponding changes in applications.

View differences:

src/main/java/org/distorted/library/effect/VertexEffectSink.java
65 65
    {
66 66
    addEffect(EffectName.SINK,
67 67

  
68
        "vec2 center = vUniforms[effect+1].yz; \n"
69
      + "vec2 ps = center-v.xy; \n"
68
        "vec3 center = vUniforms[effect+1].yzw; \n"
69
      + "vec3 ps = center-v.xyz; \n"
70 70
      + "float h = vUniforms[effect].x; \n"
71 71
      + "float t = degree(vUniforms[effect+2],center,ps) * (1.0-h)/max(1.0,h); \n"
72 72

  
73
      + "v.xy += t*ps;"
73
      + "v.xy += t*ps.xy;"
74 74
      );
75 75
    }
76 76

  
......
104 104
    super(EffectName.SINK);
105 105
    mSink   = sink;
106 106
    mCenter = center;
107
    mRegion = new Static4D(0,0,Float.MAX_VALUE, Float.MAX_VALUE);
107
    mRegion = new Static4D(0,0,0, Float.MAX_VALUE);
108 108
    }
109 109
  }

Also available in: Unified diff