Skip to content

Commit

Permalink
making sure that an incompatible 'mapRepeat' setting on the Displacem…
Browse files Browse the repository at this point in the history
…entMapFilter doesn't cause trouble (closes #1009)
  • Loading branch information
PrimaryFeather committed Nov 29, 2017
1 parent d18de04 commit 6fcc9c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion starling/src/starling/filters/DisplacementMapFilter.as
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,13 @@ class DisplacementMapEffect extends FilterEffect

sClampUV[0] = texture.width / texture.root.width - 0.5 / texture.root.nativeWidth;
sClampUV[1] = texture.height / texture.root.height - 0.5 / texture.root.nativeHeight;
var mapRepeat:Boolean = _mapRepeat && _mapTexture.root.isPotTexture;

vertexFormat.setVertexBufferAt(2, vertexBuffer, "mapTexCoords");
context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 0, sOffset);
context.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 1, sClampUV);
context.setProgramConstantsFromMatrix(Context3DProgramType.FRAGMENT, 2, sMatrix, true);
RenderUtil.setSamplerStateAt(1, _mapTexture.mipMapping, textureSmoothing, _mapRepeat);
RenderUtil.setSamplerStateAt(1, _mapTexture.mipMapping, textureSmoothing, mapRepeat);
context.setTextureAt(1, _mapTexture.base);
}
}
Expand Down

0 comments on commit 6fcc9c2

Please sign in to comment.