(
name: string,
{ depthVelocity, shadowLength }: RenderTargetOptions
)
| 35 | } |
| 36 | |
| 37 | function createRenderTarget( |
| 38 | name: string, |
| 39 | { depthVelocity, shadowLength }: RenderTargetOptions |
| 40 | ): RenderTarget { |
| 41 | const renderTarget: WebGLRenderTarget & { |
| 42 | depthVelocity?: Texture |
| 43 | shadowLength?: Texture |
| 44 | } = new WebGLRenderTarget(1, 1, { |
| 45 | depthBuffer: false, |
| 46 | stencilBuffer: false, |
| 47 | type: HalfFloatType |
| 48 | }) |
| 49 | renderTarget.texture.minFilter = LinearFilter |
| 50 | renderTarget.texture.magFilter = LinearFilter |
| 51 | renderTarget.texture.name = name |
| 52 | |
| 53 | let depthVelocityBuffer |
| 54 | if (depthVelocity) { |
| 55 | depthVelocityBuffer = renderTarget.texture.clone() |
| 56 | depthVelocityBuffer.isRenderTargetTexture = true |
| 57 | renderTarget.depthVelocity = depthVelocityBuffer |
| 58 | renderTarget.textures.push(depthVelocityBuffer) |
| 59 | } |
| 60 | let shadowLengthBuffer |
| 61 | if (shadowLength) { |
| 62 | shadowLengthBuffer = renderTarget.texture.clone() |
| 63 | shadowLengthBuffer.isRenderTargetTexture = true |
| 64 | shadowLengthBuffer.format = RedFormat |
| 65 | renderTarget.shadowLength = shadowLengthBuffer |
| 66 | renderTarget.textures.push(shadowLengthBuffer) |
| 67 | } |
| 68 | |
| 69 | return Object.assign(renderTarget, { |
| 70 | depthVelocity: depthVelocityBuffer ?? null, |
| 71 | shadowLength: shadowLengthBuffer ?? null |
| 72 | }) |
| 73 | } |
| 74 | |
| 75 | export interface CloudsPassOptions extends PassBaseOptions { |
| 76 | parameterUniforms: CloudParameterUniforms |
no test coverage detected