@@ -471,7 +471,7 @@ void ViewDependentState::traverse(RecordTraversal& rt) const
471
471
return bounds;
472
472
};
473
473
474
- // info("\n\ nViewDependentState::traverse(", &rt, ", ", &view, ") numShadowMaps = ", numShadowMaps);
474
+ // info("nViewDependentState::traverse(", &rt, ", ", &view, ") numShadowMaps = ", numShadowMaps);
475
475
476
476
// set up the light data
477
477
auto light_itr = lightData->begin ();
@@ -518,7 +518,7 @@ void ViewDependentState::traverse(RecordTraversal& rt) const
518
518
519
519
// light direction in world coords
520
520
auto light_direction = normalize (light->direction * (inverse_3x3 (mv * inverse_viewMatrix)));
521
- #if 0
521
+ #if 1
522
522
info (" directional light : light direction in world = " , light_direction, " , light->shadowMaps = " , light->shadowMaps );
523
523
info (" light->direction in model = " , light->direction );
524
524
info (" view_direction in world = " , view_direction);
@@ -555,10 +555,6 @@ void ViewDependentState::traverse(RecordTraversal& rt) const
555
555
auto lookAt = camera->viewMatrix .cast <LookAt>();
556
556
auto ortho = camera->projectionMatrix .cast <Orthographic>();
557
557
558
- #if 0
559
- info(" lookAt = ", lookAt);
560
- info(" ortho = ", ortho);
561
- #endif
562
558
auto ws_bounds = computeFrustumBounds (clip_near_z, clip_far_z, clipToWorld);
563
559
auto center = (ws_bounds.min + ws_bounds.max ) * 0.5 ;
564
560
@@ -591,12 +587,28 @@ void ViewDependentState::traverse(RecordTraversal& rt) const
591
587
ortho->nearDistance = ls_bounds.min .z ;
592
588
ortho->farDistance = ls_bounds.max .z ;
593
589
}
590
+ #if 0
591
+ ortho->left = -1;
592
+ ortho->right = 1;
593
+ ortho->nearDistance = -30.0;
594
+ ortho->farDistance = 10.0;
595
+ #endif
596
+ #if 1
597
+ info (" updateCamera( clip_near_z = " , clip_near_z, " , clip_far_z = " , clip_far_z);
598
+ info (" ws_bounds = " , ws_bounds);
599
+ info (" ls_bounds = " , ls_bounds);
600
+ info (" lookAt : eye [" , lookAt->eye , " ], center [" , lookAt->center ," ], up [" , lookAt->up ," ]" );
601
+ info (" ortho : left = " , ortho->left , " , left = " , ortho->right , " , bottom = " , ortho->left , " , top = " , ortho->top , " , near = " , ortho->nearDistance , " , far = " , ortho->farDistance );
602
+ #endif
603
+
594
604
595
605
dmat4 shadowMapProjView = camera->projectionMatrix ->transform () * camera->viewMatrix ->transform ();
596
606
597
607
dmat4 shadowMapTM = scale (0.5 , 0.5 , 1.0 ) * translate (1.0 , 1.0 , shadowMapBias) * shadowMapProjView * inverse_viewMatrix;
598
608
599
609
// convert tex gen matrix to float matrix and assign to light data
610
+
611
+
600
612
mat4 m (shadowMapTM);
601
613
602
614
(*light_itr++) = m[0 ];
@@ -610,13 +622,13 @@ void ViewDependentState::traverse(RecordTraversal& rt) const
610
622
shadowMapIndex++;
611
623
};
612
624
613
- #if 0
625
+ #if 1
614
626
info (" light_x = " , light_x);
615
627
info (" light_y = " , light_y);
616
628
info (" light_z = " , light_z);
617
629
#endif
618
630
619
- #if 0
631
+ #if 1
620
632
double range = f - n;
621
633
info (" n = " , n, " , f = " , f, " , range = " , range);
622
634
#endif
@@ -668,7 +680,7 @@ void ViewDependentState::traverse(RecordTraversal& rt) const
668
680
669
681
if (requiresPerRenderShadowMaps && preRenderCommandGraph)
670
682
{
671
- // info("ViewDependentState::traverse(RecordTraversal&) doing pre render command graph. shadowMapIndex = ", shadowMapIndex);
683
+ info (" ViewDependentState::traverse(RecordTraversal&) doing pre render command graph. shadowMapIndex = " , shadowMapIndex);
672
684
preRenderCommandGraph->accept (rt);
673
685
}
674
686
}
0 commit comments