当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript painterState.getLayer函数代码示例

本文整理汇总了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],
开发者ID:trivial-space,项目名称:playground,代码行数:31,代码来源:renderer.ts

示例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,
	},
})
开发者ID:trivial-space,项目名称:playground,代码行数:30,代码来源:renderer.ts

示例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({
开发者ID:trivial-space,项目名称:playground,代码行数:31,代码来源:index.ts


注:本文中的shared-utils/painterState.getLayer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。