<s> """<STR_LIT>""" <EOL> from panda3d . core import PTAInt <EOL> from rpcore . globals import Globals <EOL> from rpcore . util . shader_input_blocks import SimpleInputBlock <EOL> from rpcore . pluginbase . base_plugin import BasePlugin <EOL> from rpcore . stages . cull_lights_stage import CullLightsStage <EOL> from . probe_manager import ProbeManager <EOL> from . environment_capture_stage import EnvironmentCaptureStage <EOL> from . apply_envprobes_stage import ApplyEnvprobesStage <EOL> from . cull_probes_stage import CullProbesStage <EOL> class Plugin ( BasePlugin ) : <EOL> name = "<STR_LIT>" <EOL> author = "<STR_LIT>" <EOL> description = ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> version = "<STR_LIT>" <EOL> def on_stage_setup ( self ) : <EOL> self . probe_mgr = ProbeManager ( ) <EOL> self . probe_mgr . resolution = self . get_setting ( "<STR_LIT>" ) <EOL> self . probe_mgr . diffuse_resolution = self . get_setting ( "<STR_LIT>" ) <EOL> self . probe_mgr . max_probes = self . get_setting ( "<STR_LIT>" ) <EOL> self . probe_mgr . init ( ) <EOL> self . _setup_stages ( ) <EOL> def _setup_stages ( self ) : <EOL> """<STR_LIT>""" <EOL> self . capture_stage = self . create_stage ( EnvironmentCaptureStage ) <EOL> self . capture_stage . resolution = self . probe_mgr . resolution <EOL> self . capture_stage . diffuse_resolution = self . probe_mgr . diffuse_resolution <EOL> self . capture_stage . storage_tex = self . probe_mgr . cubemap_storage <EOL> self . capture_stage . storage_tex_diffuse = self . probe_mgr . diffuse_storage <EOL> self . cull_stage = self . create_stage ( CullProbesStage ) <EOL> self . apply_stage = self . create_stage ( ApplyEnvprobesStage ) <EOL> if self . is_plugin_enabled ( "<STR_LIT>" ) : <EOL> self . capture_stage . required_pipes += [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> if self . is_plugin_enabled ( "<STR_LIT>" ) : <EOL> self . capture_stage . required_pipes += [ "<STR_LIT>" ] <EOL> self . capture_stage . required_inputs += [ "<STR_LIT>" ] <EOL> self . _setup_inputs ( ) <EOL> def _setup_inputs ( self ) : <EOL> """<STR_LIT>""" <EOL> self . pta_probes = PTAInt . empty_array ( <NUM_LIT:1> ) <EOL> self . data_ubo = SimpleInputBlock ( "<STR_LIT>" ) <EOL> self . data_ubo . add_input ( "<STR_LIT>" , self . pta_probes ) <EOL> self . data_ubo . add_input ( "<STR_LIT>" , self . probe_mgr . cubemap_storage ) <EOL> self . data_ubo . add_input ( "<STR_LIT>" , self . probe_mgr . diffuse_storage ) <EOL> self . data_ubo . add_input ( "<STR_LIT>" , self . probe_mgr . dataset_storage ) <EOL> self . _pipeline . stage_mgr . input_blocks . append ( self . data_ubo ) <EOL> CullLightsStage . required_inputs . append ( "<STR_LIT>" ) <EOL> def on_pre_render_update ( self ) : <EOL> if self . _pipeline . task_scheduler . is_scheduled ( "<STR_LIT>" ) : <EOL> self . probe_mgr . update ( ) <EOL> self . pta_probes [ <NUM_LIT:0> ] = self . probe_mgr . num_probes <EOL> probe = self . probe_mgr . find_probe_to_update ( ) <EOL> if probe : <EOL> probe . last_update = Globals . clock . get_frame_count ( ) <EOL> self . capture_stage . active = True <EOL> self . capture_stage . set_probe ( probe ) <EOL> if self . is_plugin_enabled ( "<STR_LIT>" ) : <EOL> self . get_plugin_instance ( "<STR_LIT>" ) . scene_shadow_stage . request_focus ( <EOL> probe . bounds . get_center ( ) , probe . bounds . get_radius ( ) <EOL> ) <EOL> else : <EOL> self . capture_stage . active = False </s>
