本文整理汇总了TypeScript中shared-utils/painterState.getLayer函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getLayer函数的具体用法?TypeScript getLayer怎么用?TypeScript getLayer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getLayer函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getLayer
transform: () => state.scene.lightTransforms[0],
color: () => state.scene.lightColor,
},
{
transform: () => state.scene.lightTransforms[1],
color: () => state.scene.lightBackColor,
},
],
drawSettings: {
enable: [gl.CULL_FACE],
},
})
// Layers
const sceneLayer = getLayer(painter, 'scene').update({
sketches: [lightSketch, groundSketch],
uniforms: {
view: () => state.viewPort.camera.viewMat,
projection: () => state.viewPort.camera.projectionMat,
},
drawSettings: {
enable: [gl.DEPTH_TEST],
clearBits: makeClear(gl, 'color', 'depth'),
},
})
const bufferSpec: TextureData = { type: 'FLOAT' }
export const scene = getFrame(painter, 'scene').update({
layers: sceneLayer,
bufferStructure: [bufferSpec, bufferSpec, bufferSpec, bufferSpec],
示例2: getSketch
},
})
const groundSketch = getSketch(painter, 'ground').update({
form: groundForm,
shade: groundShade,
uniforms: {
transform: floorTransform,
reflection: '0',
size: () => [canvas.width, canvas.height],
},
})
// ===== layers =====
const mirrorScene = getLayer(painter, 'mirror scene').update({
sketches: [wallsSketch],
uniforms: {
view: () =>
mat4.multiply(
floorMirrorView,
state.viewPort.camera.viewMat,
floorMirrorMatrix as any,
),
projection: () => state.viewPort.camera.projectionMat,
},
drawSettings: {
clearBits: gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT,
},
})
示例3: getSketch
storeType: 'DYNAMIC',
},
},
itemCount: nodes.length,
})
// ===== objects =====
const pointsSketch = getSketch(painter, 'points').update({
form: pointsForm,
shade: pointsShade,
})
// ===== layers =====
const points = getLayer(painter, 'points').update({
sketches: [pointsSketch],
uniforms: { size: () => [canvas.width, canvas.height] },
drawSettings: {
clearColor: [0, 0, 0, 1],
clearBits: gl.COLOR_BUFFER_BIT,
enable: [gl.BLEND],
blendFunc: [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA],
},
})
const currentTriple = getEffect(painter, 'sides').update({
frag: sideFrag,
})
const current = getFrame(painter, 'current').update({