Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t include code using vertex_tangent unless needed #5176

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/scene/shader-lib/chunks/lit/vert/tangentBinormal.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ vec3 getTangent() {
vec3 getBinormal() {
return cross(vNormalW, vTangentW) * vertex_tangent.w;
}

vec3 getObjectSpaceUp() {
return normalize(dNormalMatrix * vec3(0, 1, 0));
}
`;
3 changes: 1 addition & 2 deletions src/scene/shader-lib/programs/lit-shader.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ class LitShader {
codeBody += " vTangentW = getTangent();\n";
codeBody += " vBinormalW = getBinormal();\n";
} else if (options.enableGGXSpecular || !device.extStandardDerivatives) {
code += chunks.tangentBinormalVS;
codeBody += " vObjectSpaceUpW = getObjectSpaceUp();\n";
codeBody += " vObjectSpaceUpW = normalize(dNormalMatrix * vec3(0, 1, 0));\n";
}
}

Expand Down