Project

General

Profile

« Previous | Next » 

Revision afa15877

Added by Leszek Koltunski over 7 years ago

Bugfix in calculating blur offsets.

View differences:

src/main/java/org/distorted/library/effect/PostprocessEffectBlur.java
163 163
    GLES30.glViewport(0, 0, (int)w1, (int)h1);
164 164

  
165 165
    // horizontal blur
166
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/h1;
166
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/w1;
167 167

  
168 168
    mProgram1.useProgram();
169 169
    buffer.bindForOutput(1);
......
179 179
    GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, 4);
180 180

  
181 181
    // vertical blur
182
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/w1;
182
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/h1;
183 183

  
184 184
    mProgram2.useProgram();
185 185
    buffer.bindForOutput(0);
src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
169 169
    GLES30.glViewport(0, 0, (int)w1, (int)h1);
170 170

  
171 171
    // horizontal glow
172
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/h1;
172
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/w1;
173 173

  
174 174
    mProgram1.useProgram();
175 175
    outBuffer.bindForOutput(1);
......
186 186
    GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, 4);
187 187

  
188 188
    // vertical glow
189
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/w1;
189
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/h1;
190 190

  
191 191
    mProgram2.useProgram();
192 192
    outBuffer.bindForOutput(0);

Also available in: Unified diff