Favivon - Correção

This commit is contained in:
2026-05-30 19:59:39 -03:00
parent 76ddaa815d
commit d7dfd221f0
32859 changed files with 5459654 additions and 404 deletions
+17
View File
@@ -0,0 +1,17 @@
import { ShaderChunk } from 'three'
/**
* Recursively expands all `#include <xyz>` statements within string of shader code.
* Copied from three's WebGLProgram#parseIncludes for external use.
*
* @param {string} source - The GLSL source code to evaluate
* @return {string} The GLSL code with all includes expanded
*/
export function expandShaderIncludes( source ) {
const pattern = /^[ \t]*#include +<([\w\d./]+)>/gm
function replace(match, include) {
let chunk = ShaderChunk[include]
return chunk ? expandShaderIncludes(chunk) : match
}
return source.replace( pattern, replace )
}