galacean / engine

A typescript interactive engine, support 2D, 3D, animation, physics, built on WebGL and glTF.
https://galacean.antgroup.com/
MIT License
4.04k stars 289 forks source link

Fixed the problem that function macro declaration is lost after compilation #2087

Closed Sway007 closed 2 months ago

Sway007 commented 2 months ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Keep the complete function macro declaration.

Fix the bug:

// shaderlab
#define saturate(a) clamp( a, 0.0, 1.0 )

// after compilation
#define saturate

fix #2086 & #2091