未验证 提交 dfc5efcc 编写于 作者: M Marco Fugaro 提交者: GitHub

Normalize CSM imports (#21566)

上级 7f7c529c
...@@ -7,8 +7,8 @@ import { ...@@ -7,8 +7,8 @@ import {
Matrix4, Matrix4,
Box3 Box3
} from '../../../build/three.module.js'; } from '../../../build/three.module.js';
import Frustum from './Frustum.js'; import { Frustum } from './Frustum.js';
import Shader from './Shader.js'; import { CSMShader } from './CSMShader.js';
const _cameraToLightMatrix = new Matrix4(); const _cameraToLightMatrix = new Matrix4();
const _lightSpaceFrustum = new Frustum(); const _lightSpaceFrustum = new Frustum();
...@@ -239,8 +239,8 @@ export class CSM { ...@@ -239,8 +239,8 @@ export class CSM {
injectInclude() { injectInclude() {
ShaderChunk.lights_fragment_begin = Shader.lights_fragment_begin; ShaderChunk.lights_fragment_begin = CSMShader.lights_fragment_begin;
ShaderChunk.lights_pars_begin = Shader.lights_pars_begin; ShaderChunk.lights_pars_begin = CSMShader.lights_pars_begin;
} }
......
import { ShaderChunk } from '../../../build/three.module.js'; import { ShaderChunk } from '../../../build/three.module.js';
export default { const CSMShader = {
lights_fragment_begin: /* glsl */` lights_fragment_begin: /* glsl */`
GeometricContext geometry; GeometricContext geometry;
...@@ -231,3 +231,5 @@ uniform float shadowFar; ...@@ -231,3 +231,5 @@ uniform float shadowFar;
#endif #endif
` + ShaderChunk.lights_pars_begin ` + ShaderChunk.lights_pars_begin
}; };
export { CSMShader };
...@@ -2,7 +2,7 @@ import { Vector3, Matrix4 } from '../../../build/three.module.js'; ...@@ -2,7 +2,7 @@ import { Vector3, Matrix4 } from '../../../build/three.module.js';
const inverseProjectionMatrix = new Matrix4(); const inverseProjectionMatrix = new Matrix4();
export default class Frustum { class Frustum {
constructor( data ) { constructor( data ) {
...@@ -148,3 +148,5 @@ export default class Frustum { ...@@ -148,3 +148,5 @@ export default class Frustum {
} }
} }
export { Frustum };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册