本文整理汇总了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)
示例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,
}),
})
})
示例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],
})
示例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
示例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,
示例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,
})
示例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,
})