Buckets:
ktongue/docker_container / simsite /frontend /node_modules /three /examples /jsm /postprocessing /OutputPass.js
| import { | |
| ColorManagement, | |
| RawShaderMaterial, | |
| UniformsUtils, | |
| LinearToneMapping, | |
| ReinhardToneMapping, | |
| CineonToneMapping, | |
| AgXToneMapping, | |
| ACESFilmicToneMapping, | |
| SRGBTransfer | |
| } from 'three'; | |
| import { Pass, FullScreenQuad } from './Pass.js'; | |
| import { OutputShader } from '../shaders/OutputShader.js'; | |
| class OutputPass extends Pass { | |
| constructor() { | |
| super(); | |
| // | |
| const shader = OutputShader; | |
| this.uniforms = UniformsUtils.clone( shader.uniforms ); | |
| this.material = new RawShaderMaterial( { | |
| name: shader.name, | |
| uniforms: this.uniforms, | |
| vertexShader: shader.vertexShader, | |
| fragmentShader: shader.fragmentShader | |
| } ); | |
| this.fsQuad = new FullScreenQuad( this.material ); | |
| // internal cache | |
| this._outputColorSpace = null; | |
| this._toneMapping = null; | |
| } | |
| render( renderer, writeBuffer, readBuffer/*, deltaTime, maskActive */ ) { | |
| this.uniforms[ 'tDiffuse' ].value = readBuffer.texture; | |
| this.uniforms[ 'toneMappingExposure' ].value = renderer.toneMappingExposure; | |
| // rebuild defines if required | |
| if ( this._outputColorSpace !== renderer.outputColorSpace || this._toneMapping !== renderer.toneMapping ) { | |
| this._outputColorSpace = renderer.outputColorSpace; | |
| this._toneMapping = renderer.toneMapping; | |
| this.material.defines = {}; | |
| if ( ColorManagement.getTransfer( this._outputColorSpace ) === SRGBTransfer ) this.material.defines.SRGB_TRANSFER = ''; | |
| if ( this._toneMapping === LinearToneMapping ) this.material.defines.LINEAR_TONE_MAPPING = ''; | |
| else if ( this._toneMapping === ReinhardToneMapping ) this.material.defines.REINHARD_TONE_MAPPING = ''; | |
| else if ( this._toneMapping === CineonToneMapping ) this.material.defines.CINEON_TONE_MAPPING = ''; | |
| else if ( this._toneMapping === ACESFilmicToneMapping ) this.material.defines.ACES_FILMIC_TONE_MAPPING = ''; | |
| else if ( this._toneMapping === AgXToneMapping ) this.material.defines.AGX_TONE_MAPPING = ''; | |
| this.material.needsUpdate = true; | |
| } | |
| // | |
| if ( this.renderToScreen === true ) { | |
| renderer.setRenderTarget( null ); | |
| this.fsQuad.render( renderer ); | |
| } else { | |
| renderer.setRenderTarget( writeBuffer ); | |
| if ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil ); | |
| this.fsQuad.render( renderer ); | |
| } | |
| } | |
| dispose() { | |
| this.material.dispose(); | |
| this.fsQuad.dispose(); | |
| } | |
| } | |
| export { OutputPass }; | |
Xet Storage Details
- Size:
- 2.4 kB
- Xet hash:
- 44aa2e22b681fa19648520990e537becdd33741ef5c2c50b34df14ebb26313a1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.