<s> """<STR_LIT>""" <EOL> import os <EOL> curr_dir = os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> os . chdir ( curr_dir ) <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , "<STR_LIT>" ) <EOL> sys . path . insert ( <NUM_LIT:0> , "<STR_LIT>" ) <EOL> from panda3d . core import load_prc_file_data , NodePath , Shader , Texture , ShaderAttrib <EOL> from panda3d . core import PNMImage <EOL> from direct . showbase . ShowBase import ShowBase <EOL> class Application ( ShowBase ) : <EOL> def __init__ ( self ) : <EOL> load_prc_file_data ( "<STR_LIT>" , """<STR_LIT>""" ) <EOL> ShowBase . __init__ ( self ) <EOL> dest_tex = Texture ( ) <EOL> dest_tex . setup_2d_texture ( <NUM_LIT> , <NUM_LIT> , Texture . T_unsigned_byte , Texture . F_rgba8 ) <EOL> cshader = Shader . load_compute ( Shader . SL_GLSL , "<STR_LIT>" ) <EOL> node = NodePath ( "<STR_LIT>" ) <EOL> node . set_shader ( cshader ) <EOL> node . set_shader_input ( "<STR_LIT>" , dest_tex ) <EOL> attr = node . get_attrib ( ShaderAttrib ) <EOL> self . graphicsEngine . dispatch_compute ( <EOL> ( <NUM_LIT> // <NUM_LIT:16> , <NUM_LIT> // <NUM_LIT:16> , <NUM_LIT:1> ) , attr , self . win . gsg ) <EOL> base . graphicsEngine . extract_texture_data ( dest_tex , base . win . gsg ) <EOL> img = PNMImage ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:255> ) <EOL> dest_tex . store ( img ) <EOL> img . set_num_channels ( <NUM_LIT:1> ) <EOL> tex = Texture ( ) <EOL> tex . load ( img ) <EOL> tex . write ( "<STR_LIT>" ) <EOL> Application ( ) </s>
