UNPKG

playcanvas

Version:

PlayCanvas WebGL game engine

27 lines (24 loc) 967 B
import { CULLFACE_NONE } from '../../platform/graphics/constants.js'; import { DebugGraphics } from '../../platform/graphics/debug-graphics.js'; import { DepthState } from '../../platform/graphics/depth-state.js'; import { RenderPass } from '../../platform/graphics/render-pass.js'; /** * A render pass implementing rendering of a QuadRender. */ class RenderPassQuad extends RenderPass { execute() { var { device } = this; DebugGraphics.pushGpuMarker(device, this.name + ":" + this.quad.shader.name); device.setCullMode(CULLFACE_NONE); device.setDepthState(DepthState.NODEPTH); device.setStencilState(null, null); this.quad.render(this.rect, this.scissorRect); DebugGraphics.popGpuMarker(device); } constructor(device, quad, rect, scissorRect){ super(device); this.quad = quad; this.rect = rect; this.scissorRect = scissorRect; } } export { RenderPassQuad };