當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。