Skip to content
Permalink
Browse files

Fix material/texture selection in landscape shader (#1841)

  • Loading branch information...
aburgm authored and lluchs committed Aug 12, 2017
1 parent e59205c commit 02fa5abc660710952064b8e35462e61bbbbc53d8
Showing with 2 additions and 2 deletions.
  1. +2 −2 planet/Graphics.ocg/LandscapeShader.glsl
@@ -105,7 +105,7 @@ slice(material)
int matMapIx = f2i(landscapePx.r);
vec4 matMap = queryMatMap(2*matMapIx);
vec4 matMapX = queryMatMap(2*matMapIx+1);
float materialIx = f2i(matMap.a) / 256.0 * materialDepth;
float materialIx = int(matMap.a * (materialDepth - 1) + 0.5);
vec3 matEmit = matMap.rgb;
vec3 matSpot = matMapX.rgb * 255.9f / 16.0f;
float matAngle = matMapX.a;
@@ -117,7 +117,7 @@ slice(material)
int matMapIx2 = f2i(landscapePx2.r);
vec4 matMap2 = queryMatMap(2*matMapIx2);
vec4 matMapX2 = queryMatMap(2*matMapIx2+1);
float materialIx2 = f2i(matMap2.a) / 256.0 * materialDepth;
float materialIx2 = int(matMap2.a * (materialDepth - 1) + 0.5);
vec3 matEmit2 = matMap2.rgb;
vec3 matSpot2 = matMapX2.rgb * 255.9f / 16.0f;
float matAngle2 = matMapX2.a;

0 comments on commit 02fa5ab

Please sign in to comment.
You can’t perform that action at this time.