Esempio n. 1
0
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,
		}),
	})
})
Esempio n. 2
0
				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],
})
Esempio n. 3
0
	uniforms: {
		view: () =>
			mat4.multiply(
				state.ground.groundMirrorView,
				state.viewPort.camera.viewMat,
				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',
		},
	],
})