Project

General

Profile

« Previous | Next » 

Revision c90aca24

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/library/main/DistortedNode.java
157 157
      {
158 158
      mState.apply();
159 159
      GLES31.glDisable(GLES31.GL_BLEND);
160
      DistortedLibrary.drawPriv(mEffects.getQueues(), mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
160
      DistortedLibrary.drawPriv(mEffects, mMesh, surface, currTime);
161 161
      GLES31.glEnable(GLES31.GL_BLEND);
162 162
      return 1;
163 163
      }
......
175 175
    if( input.setAsInput() )
176 176
      {
177 177
      mState.apply();
178
      DistortedLibrary.drawPrivOIT(mEffects.getQueues(), mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
178
      DistortedLibrary.drawPrivOIT(mEffects, mMesh, surface, currTime);
179 179
      return 1;
180 180
      }
181 181

  
......
192 192
    if( input.setAsInput() )
193 193
      {
194 194
      mState.apply();
195
      DistortedLibrary.drawPriv(mEffects.getQueues(), mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
195
      DistortedLibrary.drawPriv(mEffects, mMesh, surface, currTime);
196 196
      return 1;
197 197
      }
198 198

  
......
240 240

  
241 241
  private DistortedFramebuffer allocateNewFBO()
242 242
    {
243
    int width  = mFboW <= 0 ? mSurface.getWidth()  : mFboW;
244
    int height = mFboH <= 0 ? mSurface.getHeight() : mFboH;
243
    int width  = mFboW <= 0 ? mEffects.getStartchX() : mFboW;
244
    int height = mFboH <= 0 ? mEffects.getStartchY() : mFboH;
245 245
    return new DistortedFramebuffer(1,mFboDepthStencil, InternalSurface.TYPE_TREE, width, height);
246 246
    }
247 247

  
......
273 273
    mRenderWayOIT  = false;
274 274

  
275 275
    mFboW            = 0;  // i.e. take this from
276
    mFboH            = 0;  // mSurface's dimensions
276
    mFboH            = 0;  // mEffects's stretch{X,Y}
277 277
    mFboDepthStencil = DistortedFramebuffer.DEPTH_NO_STENCIL;
278 278

  
279 279
    mData = InternalNodeData.returnData(generateIDList());
......
307 307
      }
308 308
    else
309 309
      {
310
      int w = node.mSurface.getWidth();
311
      int h = node.mSurface.getHeight();
312

  
313 310
      if( node.mSurface instanceof DistortedTexture )
314 311
        {
315
        mSurface = new DistortedTexture(w,h, InternalSurface.TYPE_TREE);
312
        mSurface = new DistortedTexture(InternalSurface.TYPE_TREE);
316 313
        }
317 314
      else if( node.mSurface instanceof DistortedFramebuffer )
318 315
        {
316
        int w = node.mSurface.getWidth();
317
        int h = node.mSurface.getHeight();
319 318
        int depthStencil = DistortedFramebuffer.NO_DEPTH_NO_STENCIL;
320 319

  
321 320
        if( ((DistortedFramebuffer) node.mSurface).hasDepth() )

Also available in: Unified diff