Skip to content

Commit

Permalink
fix fragdepthblock issue (#15204)
Browse files Browse the repository at this point in the history
  • Loading branch information
deltakosh authored Jun 15, 2024
1 parent 9094099 commit bc093c4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class FragDepthBlock extends NodeMaterialBlock {
} else if (this.worldPos.isConnected && this.viewProjection.isConnected) {
state.compilationString += `
${state._declareLocalVar("p", NodeMaterialBlockConnectionPointTypes.Vector4)} = ${this.viewProjection.associatedVariableName} * ${this.worldPos.associatedVariableName};
${state._declareLocalVar("v", NodeMaterialBlockConnectionPointTypes.Vector4)} = p.z / p.w;
${state._declareLocalVar("v", NodeMaterialBlockConnectionPointTypes.Float)} = p.z / p.w;
#ifndef IS_NDC_HALF_ZRANGE
v = v * 0.5 + 0.5;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class ShadowMapBlock extends NodeMaterialBlock {

state._emitUniformFromString("biasAndScaleSM", NodeMaterialBlockConnectionPointTypes.Vector3);
state._emitUniformFromString("lightDataSM", NodeMaterialBlockConnectionPointTypes.Vector3);
state._emitUniformFromString("depthValuesSM", NodeMaterialBlockConnectionPointTypes.Vector3);
state._emitUniformFromString("depthValuesSM", NodeMaterialBlockConnectionPointTypes.Vector2);

state._emitFunctionFromInclude("packingFunctions", comments);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/tools/tests/test/visualization/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"root": "https://cdn.babylonjs.com",
"tests": [
{
"title": "NME Shadow Map",
"playgroundId": "#M3QR7E#83",
"referenceImage": "nmeshadowmap.png"
},
{
"title": "NMEGLTF",
"playgroundId": "#WGZLGJ#10320",
Expand Down

0 comments on commit bc093c4

Please sign in to comment.