|
@@ -88,15 +88,11 @@ class DirShadowMap extends Shadows {
|
|
if( mode == Dynamic ) {
|
|
if( mode == Dynamic ) {
|
|
// intersect with frustum bounds
|
|
// intersect with frustum bounds
|
|
var cameraBounds = new h3d.col.Bounds();
|
|
var cameraBounds = new h3d.col.Bounds();
|
|
- cameraBounds.zMin = bounds.zMin;
|
|
|
|
for( pt in ctx.camera.getFrustumCorners() ) {
|
|
for( pt in ctx.camera.getFrustumCorners() ) {
|
|
pt.transform(camera.mcam);
|
|
pt.transform(camera.mcam);
|
|
- if( pt.x < cameraBounds.xMin ) cameraBounds.xMin = pt.x;
|
|
|
|
- if( pt.x > cameraBounds.xMax ) cameraBounds.xMax = pt.x;
|
|
|
|
- if( pt.y < cameraBounds.yMin ) cameraBounds.yMin = pt.y;
|
|
|
|
- if( pt.y > cameraBounds.yMax ) cameraBounds.yMax = pt.y;
|
|
|
|
- if( pt.z > cameraBounds.zMax ) cameraBounds.zMax = pt.z;
|
|
|
|
|
|
+ cameraBounds.addPos(pt.x, pt.y, pt.z);
|
|
}
|
|
}
|
|
|
|
+ cameraBounds.zMin = bounds.zMin;
|
|
bounds.intersection(bounds, cameraBounds);
|
|
bounds.intersection(bounds, cameraBounds);
|
|
}
|
|
}
|
|
|
|
|