Skip to content

Commit

Permalink
Merge pull request BabylonJS#15760 from Popov72/fix-webgpu-glowlayer
Browse files Browse the repository at this point in the history
Glow layer: Fix crash when using vertex alpha in WebGPU
  • Loading branch information
sebavan authored Nov 2, 2024
2 parents baf83eb + 121165e commit eff57de
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/dev/core/src/ShadersWGSL/background.vertex.fx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn main(input : VertexInputs) -> FragmentInputs {

// Vertex color
#ifdef VERTEXCOLOR
vertexOutputs.vColor = color;
vertexOutputs.vColor = vertexInputs.color;
#endif

#include<logDepthVertex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var finalColor: vec4f = uniforms.glowColor;
#endif

#ifdef VERTEXALPHA
finalColor = vec4f(finalColor.rgb, finalColor.a * vColor.a);
finalColor = vec4f(finalColor.rgb, finalColor.a * fragmentInputs.vColor.a);
#endif

#ifdef ALPHATEST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ var worldPos: vec4f = finalWorld * vec4f(positionUpdated, 1.0);
#endif

#ifdef VERTEXALPHA
vertexOutputs.vColor = color;
vertexOutputs.vColor = vertexInputs.color;
#endif

#include<clipPlaneVertex>
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
Expand Up @@ -2250,6 +2250,11 @@
"referenceImage": "voxelShadows.png",
"renderCount": 15,
"excludedEngines": ["webgl1", "webgpu"]
},
{
"title": "Glow layer with vertex alpha",
"playgroundId": "#GWAX2G#7",
"referenceImage": "Glow-layer-with-vertex-alpha.png"
}
]
}

0 comments on commit eff57de

Please sign in to comment.