瀏覽代碼

Fix morph targets using texture when max texture width is less than 8192 pixels

Popov72 4 年之前
父節點
當前提交
020448bc30
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.fx

+ 1 - 1
src/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.fx

@@ -10,7 +10,7 @@
 		{			
 			float y = floor(vertexIndex / morphTargetTextureInfo.y);
 			float x = vertexIndex - y * morphTargetTextureInfo.y;
-			vec3 textureUV = vec3((x + 0.5) / morphTargetTextureInfo.y, y / morphTargetTextureInfo.z, targetIndex);
+			vec3 textureUV = vec3((x + 0.5) / morphTargetTextureInfo.y, (y + 0.5) / morphTargetTextureInfo.z, targetIndex);
 			return texture(morphTargets, textureUV).xyz;
 		}
 	#endif