From a28e325f45ea89399e606c1a200bdd55db2d8e24 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Tue, 22 Jan 2019 22:23:30 +0900 Subject: [PATCH] glsl works differently on my macbook? --- assets/tiling.frag | 14 +++++++------- src/net/torvald/terrarum/AppLoader.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/tiling.frag b/assets/tiling.frag index 2d5bf058d..4d44aca66 100644 --- a/assets/tiling.frag +++ b/assets/tiling.frag @@ -87,18 +87,18 @@ void main() { ivec2 breakageXY = getTileXY(breakage + 5); // +5 is hard-coded constant that depends on the atlas - mediump vec2 coordInTile = mod(pxCoord, tileSizeInPx) / tileSizeInPx; // 0..1 regardless of tile position in atlas + vec2 coordInTile = mod(pxCoord, tileSizeInPx) / tileSizeInPx; // 0..1 regardless of tile position in atlas // don't really need highp here; read the GLES spec - mediump vec2 singleTileSizeInUV = vec2(1) / tilesInAtlas; // constant 0.00390625 for unmodified default uniforms + vec2 singleTileSizeInUV = vec2(1) / tilesInAtlas; // constant 0.00390625 for unmodified default uniforms - mediump vec2 uvCoordForTile = coordInTile * singleTileSizeInUV; // 0..0.00390625 regardless of tile position in atlas + vec2 uvCoordForTile = coordInTile * singleTileSizeInUV; // 0..0.00390625 regardless of tile position in atlas - mediump vec2 uvCoordOffsetTile = tileXY * singleTileSizeInUV; // where the tile starts in the atlas, using uv coord (0..1) - mediump vec2 uvCoordOffsetBreakage = breakageXY * singleTileSizeInUV; + vec2 uvCoordOffsetTile = tileXY * singleTileSizeInUV; // where the tile starts in the atlas, using uv coord (0..1) + vec2 uvCoordOffsetBreakage = breakageXY * singleTileSizeInUV; - mediump vec2 finalUVCoordForTile = uvCoordForTile + uvCoordOffsetTile;// where we should be actually looking for in atlas, using UV coord (0..1) - mediump vec2 finalUVCoordForBreakage = uvCoordForTile + uvCoordOffsetBreakage; + vec2 finalUVCoordForTile = uvCoordForTile + uvCoordOffsetTile;// where we should be actually looking for in atlas, using UV coord (0..1) + vec2 finalUVCoordForBreakage = uvCoordForTile + uvCoordOffsetBreakage; // blending a breakage tex with main tex diff --git a/src/net/torvald/terrarum/AppLoader.java b/src/net/torvald/terrarum/AppLoader.java index 1546f9792..16676a474 100644 --- a/src/net/torvald/terrarum/AppLoader.java +++ b/src/net/torvald/terrarum/AppLoader.java @@ -675,7 +675,7 @@ public class AppLoader implements ApplicationListener { public static ShaderProgram loadShader(String vert, String frag) { ShaderProgram s = new ShaderProgram(Gdx.files.internal(vert), Gdx.files.internal(frag)); - if (s.getLog().contains("error C")) { + if (s.getLog().toLowerCase().contains("error")) { throw new Error(String.format("Shader program loaded with %s, %s failed:\n%s", vert, frag, s.getLog())); }