【文件属性】:
文件名称:glsl-extract-reflect:将 glsl-extract 变成 JSON 树
文件大小:5KB
文件格式:ZIP
更新时间:2021-06-04 10:27:50
JavaScript
glsl-提取-反射
从获取类型数据并将名称转换为 JSON 结构,其中每个叶节点都是给定map函数的返回值。
这对于为统一和属性结构/数组创建包装器很有用。
var reflect = require ( 'glsl-extract-reflect' )
var uniforms = [
{ name : 'lights[0].position' , type : 'vec4' } ,
{ name : 'projection' , type : 'mat4' } ,
{ name : 'color' , type : 'vec3' }
]
var locations = reflect ( uniforms , function ( uniform ) {
return {
type : uniform . type ,
location : g
【文件预览】:
glsl-extract-reflect-master
----.gitignore(56B)
----package.json(790B)
----LICENSE.md(1KB)
----index.js(1KB)
----README.md(2KB)
----.npmignore(96B)
----test()
--------expected.json(3KB)
--------index.js(356B)
--------types.json(1KB)