[code-simplifier] Simplify GaussianSplatting ShaderMaterial creation by extracting helper method#18166
Conversation
…er method Extract common ShaderMaterial creation logic into a private static helper method to reduce duplication between makeDepthRenderingMaterial and _MakeGaussianSplattingShadowDepthWrapper. Both methods were creating ShaderMaterial with nearly identical configuration and setting backFaceCulling = false. The new _CreateGaussianSplattingDepthShaderMaterial helper consolidates this logic while maintaining all existing functionality. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
|
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18166/merge/index.html#WGZLGJ#4600 Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves): https://playground.babylonjs.com/?snapshot=refs/pull/18166/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/18166/merge#BCU1XR#0 If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools. |
|
WebGL2 visualization test reporter: |
|
Visualization tests for WebGPU |
Code Simplification - March 25, 2026
This PR simplifies recently modified code to improve clarity, consistency, and maintainability while preserving all functionality.
Files Simplified
packages/dev/core/src/Materials/GaussianSplatting/gaussianSplattingMaterial.ts- Extracted helper method to reduce duplication in ShaderMaterial creationImprovements Made
1. Reduced Duplication
Extracted common ShaderMaterial creation logic into a private static helper method
_CreateGaussianSplattingDepthShaderMaterial. This eliminates code duplication between two methods:makeDepthRenderingMaterial(instance method)_MakeGaussianSplattingShadowDepthWrapper(static method)Before:
Both methods contained nearly identical ShaderMaterial construction code with the same configuration properties and
backFaceCulling = falseassignment.After:
Common logic consolidated in a single helper method, called from both locations with appropriate parameters.
2. Enhanced Maintainability
3. Applied Project Standards
_MethodName)Changes Based On
Recent changes from:
backFaceCulling = falseto two ShaderMaterial instancesTesting
Review Focus
Please verify:
Impact
Lines changed:
Automated by Code Simplifier Agent - analyzing code from the last 24 hours