本文整理匯總了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({