Project

General

Profile

« Previous | Next » 

Revision 687263cc

Added by Leszek Koltunski about 4 years ago

Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)

View differences:

src/main/java/org/distorted/examples/postprocesstree/PostprocessTreeRenderer.java
76 76
      radiusDyn.add(mRadius);
77 77
      PostprocessEffectBlur blurEffect = new PostprocessEffectBlur(radiusDyn);
78 78

  
79
      mLeaf = new DistortedTexture(LEAF_SIZE,LEAF_SIZE);
79
      mLeaf = new DistortedTexture();
80 80

  
81 81
      MeshRectangles mesh = new MeshRectangles(1,1);
82 82
      mMove = new Static3D(0,0,0);
83 83
      mScale= new Static3D(1,1,1);
84 84

  
85
      DistortedEffects rootEffects  = new DistortedEffects();
86
      DistortedEffects innerEffects = new DistortedEffects();
85
      DistortedEffects rootEffects  = new DistortedEffects(mScreenW,mScreenH,0);
86
      DistortedEffects innerEffects = new DistortedEffects(INNER*LEAF_SIZE,INNER*LEAF_SIZE,0);
87 87
      DistortedEffects[] innerLeafEffects= new DistortedEffects[NUM_LEAVES];
88 88
      DistortedEffects[] outerLeafEffects= new DistortedEffects[NUM_LEAVES];
89 89

  
90
      DistortedNode root = new DistortedNode(new DistortedTexture(mScreenW,mScreenH), rootEffects, mesh);
90
      DistortedNode root = new DistortedNode(new DistortedTexture(), rootEffects, mesh);
91 91

  
92 92
      rootEffects.apply(new MatrixEffectScale(mScale));
93 93
      rootEffects.apply(new MatrixEffectMove(mMove));
......
107 107

  
108 108
      for(int j=0; j<NUM_LEAVES; j++)
109 109
        {
110
        outerLeafEffects[j] = new DistortedEffects();
110
        outerLeafEffects[j] = new DistortedEffects(LEAF_SIZE,LEAF_SIZE,0);
111 111
        outerLeafEffects[j].apply(new MatrixEffectMove(outerMoveVector));
112 112
        outerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, outerCenter) );
113 113

  
......
119 119
      innerEffects.apply( new FragmentEffectChroma(new Static1D(0.5f), new Static3D(1,0,0) ) );
120 120
      innerEffects.apply(blurEffect);
121 121

  
122
      DistortedNode innerNode = new DistortedNode( new DistortedTexture(INNER*LEAF_SIZE,INNER*LEAF_SIZE), innerEffects, mesh);
122
      DistortedNode innerNode = new DistortedNode( new DistortedTexture(), innerEffects, mesh);
123 123
      root.attach(innerNode);
124 124

  
125 125
      for(int j=0; j<NUM_LEAVES; j++)
126 126
        {
127
        innerLeafEffects[j] = new DistortedEffects();
127
        innerLeafEffects[j] = new DistortedEffects(LEAF_SIZE,LEAF_SIZE,0);
128 128
        innerLeafEffects[j].apply(new MatrixEffectMove(innerMoveVector));
129 129
        innerLeafEffects[j].apply( new MatrixEffectRotate(new Static1D(j*(360/NUM_LEAVES)), axis, innerCenter) );
130 130

  

Also available in: Unified diff