Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bug in OpenClonk
diff --git a/planet/Graphics.ocg/LandscapeShader.glsl b/planet/Graphics.ocg/LandscapeShader.glsl
index fd26967..45bc358 100644
--- a/planet/Graphics.ocg/LandscapeShader.glsl
+++ b/planet/Graphics.ocg/LandscapeShader.glsl
@@ -100,6 +100,8 @@ slice(texture+4)
slice(material)
{
+ float fix1 = 0.5;
+ float fix2 = 0.5;
// Get material properties from material map
int matMapIx = f2i(landscapePx.r);
@@ -111,8 +113,8 @@ slice(material)
float matAngle = matMapX.a;
// Query material texture pixels
- vec4 materialPx = texture(materialTex, vec3(materialCoo, materialIx));
- vec4 normalPx = texture(materialTex, vec3(materialCoo, materialIx+0.5 * materialDepth));
+ vec4 materialPx = texture(materialTex, vec3(materialCoo, materialIx + fix1));
+ vec4 normalPx = texture(materialTex, vec3(materialCoo, materialIx+0.5 * materialDepth + fix1));
// Same for second pixel
int matMapIx2 = f2i(landscapePx2.r);
vec4 matMap2 = queryMatMap(2*matMapIx2);
@@ -123,8 +125,8 @@ slice(material)
float matAngle2 = matMapX2.a;
// Query material texture pixels
- vec4 materialPx2 = texture(materialTex, vec3(materialCoo, materialIx2));
- vec4 normalPx2 = texture(materialTex, vec3(materialCoo, materialIx2+0.5 * materialDepth));
+ vec4 materialPx2 = texture(materialTex, vec3(materialCoo, materialIx2 + fix2));
+ vec4 normalPx2 = texture(materialTex, vec3(materialCoo, materialIx2+0.5 * materialDepth + fix2));
}
slice(normal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.