Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Fix the shadow anchor

Nguyen Xuan Anda9fd03b8a3e
diff --git a/src/impostor-shader.js b/src/impostor-shader.js
index 0524d0eb..015675da 100644
--- a/src/impostor-shader.js
+++ b/src/impostor-shader.js
@@ -86,8 +86,7 @@ export function addImpostorCode(source) {
if (!source.includes('uniform float wind;') || !source.includes('void main() {')) return source;
const withDefinitions = insertBefore(source, 'void main() {', impostorShader);
if (withDefinitions.includes('worldNormal = normalize(')) return insertBefore(withDefinitions, " // Metres along the object's own axes", COLOR_HOOK);
- return insertBefore(withDefinitions, ' textureUV = uv;
- gl_Position = lightProjection * world;', DEPTH_HOOK);
+ return insertBefore(withDefinitions, ' textureUV = uv;\n gl_Position = lightProjection * world;', DEPTH_HOOK);
}
shaderTransforms.push(addImpostorCode);