#NEWLINE# def on_pipeline_created( self ) : #NEWLINE# #INDENT# self . debug ( 'Initializing pssm ..' ) #NEWLINE# self . node = Globals . base . render . attach_new_node ( 'PSSMCameraRig' ) #NEWLINE# self . node . hide ( ) #NEWLINE# self . camera_rig = PSSMCameraRig ( self . get_setting ( 'split_count' ) ) #NEWLINE# self . camera_rig . set_sun_distance ( self . get_setting ( 'sun_distance' ) ) #NEWLINE# self . camera_rig . set_pssm_distance ( self . get_setting ( 'max_distance' ) ) #NEWLINE# self . camera_rig . set_logarithmic_factor ( self . get_setting ( 'logarithmic_factor' ) ) #NEWLINE# self . camera_rig . set_border_bias ( self . get_setting ( 'border_bias' ) ) #NEWLINE# self . camera_rig . set_use_stable_csm ( True ) #NEWLINE# self . camera_rig . set_use_fixed_film_size ( True ) #NEWLINE# self . camera_rig . set_resolution ( self . get_setting ( 'resolution' ) ) #NEWLINE# self . camera_rig . reparent_to ( self . node ) #NEWLINE# for i in range ( self . get_setting ( 'split_count' ) ) : #NEWLINE# #INDENT# camera_np = self . camera_rig . get_camera ( i ) #NEWLINE# camera_np . node ( ) . set_scene ( Globals . base . render ) #NEWLINE# region = self . shadow_stage . split_regions [ i ] #NEWLINE# region . set_camera ( camera_np ) #NEWLINE# self . _pipeline . tag_mgr . register_camera ( 'shadow' , camera_np . node ( ) ) #NEWLINE# #UNINDENT# Globals . base . accept ( 'u' , self . toggle_update_enabled ) #NEWLINE# self . pssm_stage . set_shader_input ( 'pssm_split_count' , self . get_setting ( 'split_count' ) ) #NEWLINE# self . pssm_stage . set_shader_input ( 'pssm_mvps' , self . camera_rig . get_mvp_array ( ) ) #NEWLINE# self . pssm_stage . set_shader_input ( 'pssm_nearfar' , self . camera_rig . get_nearfar_array ( ) ) #NEWLINE# self . pssm_stage . set_shader_input ( 'pssm_sun_vector' , region . pta_sun_vector )