當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript painterState.getFrame函數代碼示例

本文整理匯總了TypeScript中shared-utils/painterState.getFrame函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getFrame函數的具體用法?TypeScript getFrame怎麽用?TypeScript getFrame使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了getFrame函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: each

			each((img, key) => {
				textures[key] = getFrame(painter, key).update({
					texture: {
						minFilter: 'LINEAR_MIPMAP_LINEAR',
						magFilter: 'LINEAR',
						asset: img,
					},
				})
			}, s.tiles.images)
開發者ID:trivial-space,項目名稱:playground,代碼行數:9,代碼來源:renderer.ts

示例2: getFrame

export const videoLights = videoTextures.map((t, i) => {
	const id = 'vref' + i
	return getFrame(painter, id).update({
		bufferStructure: [
			{
				minFilter: 'LINEAR',
				magFilter: 'LINEAR',
			},
		],
		width: reflSize,
		height: reflSize,
		layers: getBlurByAlphaEffect(painter, id, {
			strength: 4,
			size: [reflSize, reflSize],
			startFrame: t,
		}),
	})
})
開發者ID:trivial-space,項目名稱:playground,代碼行數:18,代碼來源:renderer.ts

示例3: getLayer

				state.viewPort.camera.viewMat,
				floorMirrorMatrix as any,
			),
		projection: () => state.viewPort.camera.projectionMat,
	},
	drawSettings: {
		clearBits: gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT,
	},
})

const scene = getLayer(painter, 'scene').update({
	sketches: [groundSketch, wallsSketch],
	uniforms: {
		view: () => state.viewPort.camera.viewMat,
		projection: () => state.viewPort.camera.projectionMat,
	},
	drawSettings: {
		clearBits: gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT,
	},
})

const blurEffect = getBlurByAlphaEffect(painter, 'blur', {
	strength: 10,
	strengthOffset: 0.3,
	blurRatioVertical: 3,
})

export const main = getFrame(painter, 'main').update({
	layers: [mirrorScene, blurEffect, scene],
})
開發者ID:trivial-space,項目名稱:playground,代碼行數:30,代碼來源:renderer.ts

示例4: plane

// Forms

const geometry = plane(10, 10, 0, 0)
const planeForm = getForm(painter, 'plane').update(geometry)

// Shades

const geoShade = getShade(painter, 'geo').update({
	frag,
	vert,
})

// Textures

const texture = getFrame(painter, 'tex').update({ texture: {} })

const img = new Image()
img.onload = () => {
	texture.update({
		texture: {
			asset: img,
			minFilter: 'LINEAR_MIPMAP_LINEAR',
			magFilter: 'LINEAR',
		},
	})
}
img.src = 'tree.jpg'

// Sketches
開發者ID:trivial-space,項目名稱:playground,代碼行數:29,代碼來源:renderer.ts

示例5: getFrame

	getEffect,
	getForm,
	getFrame,
	getShade,
	getSketch,
} from 'shared-utils/painterState'
import { makeClear } from 'tvs-painter/dist/utils/context'
import { plane } from 'tvs-painter/dist/utils/geometry/plane'
import { events, gl, paint, painter } from './context'
import base from './glsl/base.frag'
import planeFrag from './glsl/plane-material.frag'
import planeVert from './glsl/plane-material.vert'

// ===== gof layers =====

const paintFrame = getFrame(painter, 'paint')

const bufferSize = 256

const effect = getEffect(painter, 'layer').update({
	frag: base,
	uniforms: {
		size: bufferSize,
		paint: () => paintFrame.image(),
		previous: '0',
	},
})

export const automaton = getFrame(painter, 'automaton').update({
	layers: effect,
	selfReferencing: true,
開發者ID:trivial-space,項目名稱:playground,代碼行數:31,代碼來源:renderer.ts

示例6: getLayer

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({
	layers: [points, currentTriple],
})

const blend = getEffect(painter, 'blend').update({
	frag: blendFrag,
	uniforms: {
		previous: '0',
		current: () => current.image(),
	},
})

const main = getFrame(painter, 'main').update({
	layers: blend,
	selfReferencing: true,
})
開發者ID:trivial-space,項目名稱:playground,代碼行數:31,代碼來源:index.ts

示例7: getBlurByAlphaEffect

				state.ground.mirrorMatrix as any,
			),
		projection: () => state.viewPort.camera.projectionMat,
		withDistance: 1,
		groundHeight: () => state.ground.position[1],
	},
})

const blurEffect = getBlurByAlphaEffect(painter, 'blur', {
	strength: 4,
	strengthOffset: 0.3,
	blurRatioVertical: 3,
	size: [256, 256],
})

export const mirrorScene = getFrame(painter, 'mirror').update({
	layers: [mirrorSceneLayer, blurEffect],
	width: 256,
	height: 256,
	bufferStructure: [
		{
			magFilter: 'LINEAR',
			minFilter: 'LINEAR',
		},
	],
})

export const scene = getFrame(painter, 'scene').update({
	layers: sceneLayer,
})
開發者ID:trivial-space,項目名稱:playground,代碼行數:30,代碼來源:renderer.ts


注:本文中的shared-utils/painterState.getFrame函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。