<s> """<STR_LIT>""" <EOL> from __future__ import division <EOL> import collections <EOL> from rpcore . globals import Globals <EOL> from rpcore . pluginbase . base_plugin import BasePlugin <EOL> from . voxelization_stage import VoxelizationStage <EOL> from . vxgi_stage import VXGIStage <EOL> class Plugin ( BasePlugin ) : <EOL> name = "<STR_LIT>" <EOL> author = "<STR_LIT>" <EOL> description = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> version = "<STR_LIT>" <EOL> def on_stage_setup ( self ) : <EOL> self . _voxel_stage = self . create_stage ( VoxelizationStage ) <EOL> self . _vxgi_stage = self . create_stage ( VXGIStage ) <EOL> self . _voxel_stage . voxel_resolution = self . get_setting ( "<STR_LIT>" ) <EOL> self . _voxel_stage . voxel_world_size = self . get_setting ( "<STR_LIT>" ) <EOL> if self . is_plugin_enabled ( "<STR_LIT>" ) : <EOL> self . _voxel_stage . required_pipes . append ( "<STR_LIT>" ) <EOL> self . _voxel_stage . required_inputs . append ( "<STR_LIT>" ) <EOL> def on_pre_render_update ( self ) : <EOL> task = self . _queue [ <NUM_LIT:0> ] <EOL> self . _queue . rotate ( - <NUM_LIT:1> ) <EOL> task ( ) <EOL> def on_pipeline_created ( self ) : <EOL> self . _queue = collections . deque ( ) <EOL> self . _queue . extend ( [ self . _voxelize_x , self . _voxelize_y , self . _voxelize_z ] ) <EOL> self . _queue . extend ( [ self . _generate_mipmaps ] ) <EOL> def _set_grid_pos ( self ) : <EOL> """<STR_LIT>""" <EOL> grid_pos = Globals . base . camera . get_pos ( Globals . base . render ) <EOL> voxel_size = <NUM_LIT> * self . get_setting ( "<STR_LIT>" ) / self . get_setting ( "<STR_LIT>" ) <EOL> snap_size = voxel_size * <NUM_LIT:2> ** <NUM_LIT:4> <EOL> for dimension in range ( <NUM_LIT:3> ) : <EOL> cell_val = grid_pos . get_cell ( dimension ) <EOL> grid_pos . set_cell ( dimension , cell_val - cell_val % snap_size ) <EOL> self . _voxel_stage . set_grid_position ( grid_pos ) <EOL> def _voxelize_x ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _set_grid_pos ( ) <EOL> self . _voxel_stage . state = VoxelizationStage . S_voxelize_x <EOL> def _voxelize_y ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _voxel_stage . state = VoxelizationStage . S_voxelize_y <EOL> def _voxelize_z ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _voxel_stage . state = VoxelizationStage . S_voxelize_z <EOL> def _generate_mipmaps ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _voxel_stage . state = VoxelizationStage . S_gen_mipmaps </s>
