Project

General

Profile

« Previous | Next » 

Revision c1fa9e3c

Added by Leszek Koltunski over 4 years ago

When blurring or glowing, we need to CLAMP_TO_EDGE the texture - otherwise part of the blur or glow could appear on the other end of the texture.

View differences:

src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
197 197
    buffer.bindForOutput(1);
198 198
    buffer.setAsInput(0);
199 199

  
200
    GLES30.glTexParameteri( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_CLAMP_TO_EDGE);
201
    GLES30.glTexParameteri( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_CLAMP_TO_EDGE);
202

  
200 203
    GLES30.glColorMask(true,true,true,true);
201 204
    GLES30.glClearColor(1.0f,1.0f,1.0f,0.0f);
202 205
    GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT);
......
218 221
    buffer.bindForOutput(0);
219 222
    buffer.setAsInput(1);
220 223

  
224
    GLES30.glTexParameteri( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_CLAMP_TO_EDGE);
225
    GLES30.glTexParameteri( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_CLAMP_TO_EDGE);
226

  
221 227
    GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT);
222 228

  
223 229
    GLES30.glUniform1f ( mProgram2.mUniform[0] , n );
src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
200 200
    buffer.bindForOutput(1);
201 201
    buffer.setAsInput(0);
202 202

  
203
    GLES30.glTexParameteri( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_CLAMP_TO_EDGE);
204
    GLES30.glTexParameteri( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_CLAMP_TO_EDGE);
205

  
203 206
    GLES30.glColorMask(true,true,true,true);
204 207
    GLES30.glClearColor(1.0f,1.0f,1.0f,0.0f);
205 208
    GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT);
......
221 224
    buffer.bindForOutput(0);
222 225
    buffer.setAsInput(1);
223 226

  
227
    GLES30.glTexParameteri( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_CLAMP_TO_EDGE);
228
    GLES30.glTexParameteri( GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_CLAMP_TO_EDGE);
229

  
224 230
    GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT);
225 231

  
226 232
    GLES30.glUniform1f ( mProgram2.mUniform[0] , n );

Also available in: Unified diff