Buckets:
ktongue/docker_container / simsite /frontend /node_modules /three /src /renderers /webgl /WebGLRenderStates.js
| import { WebGLLights } from './WebGLLights.js'; | |
| function WebGLRenderState( extensions, capabilities ) { | |
| const lights = new WebGLLights( extensions, capabilities ); | |
| const lightsArray = []; | |
| const shadowsArray = []; | |
| function init() { | |
| lightsArray.length = 0; | |
| shadowsArray.length = 0; | |
| } | |
| function pushLight( light ) { | |
| lightsArray.push( light ); | |
| } | |
| function pushShadow( shadowLight ) { | |
| shadowsArray.push( shadowLight ); | |
| } | |
| function setupLights( useLegacyLights ) { | |
| lights.setup( lightsArray, useLegacyLights ); | |
| } | |
| function setupLightsView( camera ) { | |
| lights.setupView( lightsArray, camera ); | |
| } | |
| const state = { | |
| lightsArray: lightsArray, | |
| shadowsArray: shadowsArray, | |
| lights: lights | |
| }; | |
| return { | |
| init: init, | |
| state: state, | |
| setupLights: setupLights, | |
| setupLightsView: setupLightsView, | |
| pushLight: pushLight, | |
| pushShadow: pushShadow | |
| }; | |
| } | |
| function WebGLRenderStates( extensions, capabilities ) { | |
| let renderStates = new WeakMap(); | |
| function get( scene, renderCallDepth = 0 ) { | |
| const renderStateArray = renderStates.get( scene ); | |
| let renderState; | |
| if ( renderStateArray === undefined ) { | |
| renderState = new WebGLRenderState( extensions, capabilities ); | |
| renderStates.set( scene, [ renderState ] ); | |
| } else { | |
| if ( renderCallDepth >= renderStateArray.length ) { | |
| renderState = new WebGLRenderState( extensions, capabilities ); | |
| renderStateArray.push( renderState ); | |
| } else { | |
| renderState = renderStateArray[ renderCallDepth ]; | |
| } | |
| } | |
| return renderState; | |
| } | |
| function dispose() { | |
| renderStates = new WeakMap(); | |
| } | |
| return { | |
| get: get, | |
| dispose: dispose | |
| }; | |
| } | |
| export { WebGLRenderStates }; | |
Xet Storage Details
- Size:
- 1.69 kB
- Xet hash:
- 6cc737aef436246d3401d02413e44b92b1db3b59eb43002c67cd35bc51400318
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.