当前位置: 首页>>代码示例>>Python>>正文


Python PTAInt.empty_array方法代码示例

本文整理汇总了Python中panda3d.core.PTAInt.empty_array方法的典型用法代码示例。如果您正苦于以下问题:Python PTAInt.empty_array方法的具体用法?Python PTAInt.empty_array怎么用?Python PTAInt.empty_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在panda3d.core.PTAInt的用法示例。


在下文中一共展示了PTAInt.empty_array方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: init_internal_manager

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
    def init_internal_manager(self):
        """ Creates the light storage manager and the buffer to store the light data """
        self.internal_mgr = InternalLightManager()
        self.internal_mgr.set_shadow_update_distance(
            self.pipeline.settings["shadows.max_update_distance"])

        # Storage for the Lights
        per_light_vec4s = 4
        self.img_light_data = Image.create_buffer(
            "LightData", self.MAX_LIGHTS * per_light_vec4s, "RGBA16")
        self.img_light_data.set_clear_color(0)
        self.img_light_data.clear_image()

        self.pta_max_light_index = PTAInt.empty_array(1)
        self.pta_max_light_index[0] = 0

        # Storage for the shadow sources
        per_source_vec4s = 5
        self.img_source_data = Image.create_buffer(
            "ShadowSourceData", self.MAX_SOURCES * per_source_vec4s, "RGBA16")
        self.img_light_data.set_clear_color(0)
        self.img_light_data.clear_image()

        # Register the buffer
        inputs = self.pipeline.stage_mgr.inputs
        inputs["AllLightsData"] = self.img_light_data
        inputs["ShadowSourceData"] = self.img_source_data
        inputs["maxLightIndex"] = self.pta_max_light_index
开发者ID:aimoonchen,项目名称:RenderPipeline,代码行数:30,代码来源:light_manager.py

示例2: _init_internal_mgr

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
    def _init_internal_mgr(self):
        """ Creates the light storage manager and the buffer to store the light data """
        self._internal_mgr = InternalLightManager()

        # Storage for the Lights
        per_light_vec4s = 4
        self._img_light_data = Image.create_buffer(
            "LightData", self._MAX_LIGHTS * per_light_vec4s, Texture.T_float,
            Texture.F_rgba16)
        self._img_light_data.set_clear_color(0)
        self._img_light_data.clear_image()

        self._pta_max_light_index = PTAInt.empty_array(1)
        self._pta_max_light_index[0] = 0

        # Storage for the shadow sources
        per_source_vec4s = 5
        self._img_source_data = Image.create_buffer(
            "ShadowSourceData", self._MAX_SOURCES * per_source_vec4s, Texture.T_float,
            Texture.F_rgba16)
        self._img_light_data.set_clear_color(0)
        self._img_light_data.clear_image()

        # Register the buffer
        add_input = self._pipeline.stage_mgr.add_input
        add_input("AllLightsData", self._img_light_data.get_texture())
        add_input("ShadowSourceData", self._img_source_data.get_texture())
        add_input("maxLightIndex", self._pta_max_light_index)
开发者ID:MYheavyGo,项目名称:RenderPipeline,代码行数:30,代码来源:LightManager.py

示例3: _create_components

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
    def _create_components(self):
        """ Internal method to init the widgets components """

        # Create the buffer which stores the last FPS values
        self._storage_buffer = Image.create_buffer("FPSValues", 250, "R16")
        self._storage_buffer.set_clear_color(Vec4(0))
        self._storage_buffer.clear_image()

        self._store_index = PTAInt.empty_array(1)
        self._store_index[0] = 0

        self._current_ftime = PTAFloat.empty_array(1)
        self._current_ftime[0] = 16.0

        self._chart_ms_max = PTAFloat.empty_array(1)
        self._chart_ms_max[0] = 40

        # Create the texture where the gui component is rendered inside
        self._display_tex = Image.create_2d("FPSChartRender", 250, 120, "RGBA8")
        self._display_tex.set_clear_color(Vec4(0))
        self._display_tex.clear_image()
        self._display_img = Sprite(
            image=self._display_tex, parent=self._node, w=250, h=120, x=10, y=10)

        # Defer the further loading
        Globals.base.taskMgr.doMethodLater(0.3, self._late_init, "FPSChartInit")
开发者ID:croxis,项目名称:SpaceDrive,代码行数:28,代码来源:fps_chart.py

示例4: init_internal_manager

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
    def init_internal_manager(self):
        """ Creates the light storage manager and the buffer to store the light data """
        self.internal_mgr = InternalLightManager()
        self.internal_mgr.set_shadow_update_distance(
            self.pipeline.settings["shadows.max_update_distance"])

        # Storage for the Lights
        per_light_vec4s = 4
        self.img_light_data = Image.create_buffer(
            "LightData", self.MAX_LIGHTS * per_light_vec4s, "RGBA16")
        self.img_light_data.clear_image()

        self.pta_max_light_index = PTAInt.empty_array(1)
        self.pta_max_light_index[0] = 0

        # Storage for the shadow sources
        per_source_vec4s = 5

        # IMPORTANT: RGBA32 is really required here. Otherwise artifacts and bad
        # shadow filtering occur due to precision issues
        self.img_source_data = Image.create_buffer(
            "ShadowSourceData", self.MAX_SOURCES * per_source_vec4s, "RGBA32")
        self.img_light_data.clear_image()

        # Register the buffer
        inputs = self.pipeline.stage_mgr.inputs
        inputs["AllLightsData"] = self.img_light_data
        inputs["ShadowSourceData"] = self.img_source_data
        inputs["maxLightIndex"] = self.pta_max_light_index
开发者ID:ELMERzark,项目名称:RenderPipeline,代码行数:31,代码来源:light_manager.py

示例5: __init__

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
 def __init__(self, pipeline):
     DebugObject.__init__(self, "GPUCommandQueue")
     self._pipeline = pipeline
     self._commands_per_frame = 512
     self._command_list = GPUCommandList()
     self._pta_num_commands = PTAInt.empty_array(1)
     self._create_data_storage()
     self._create_command_target()
     self._commands = []
     self._register_defines()
开发者ID:wdmwdm,项目名称:RenderPipeline,代码行数:12,代码来源:GPUCommandQueue.py

示例6: __init__

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
 def __init__(self, pipeline):
     RenderStage.__init__(self, pipeline)
     self.resolution = 128
     self.diffuse_resolution = 4
     self.regions = []
     self.cameras = []
     self.rig_node = Globals.render.attach_new_node("EnvmapCamRig")
     self.pta_index = PTAInt.empty_array(1)
     self.storage_tex = None
     self.storage_tex_diffuse = None
开发者ID:gitter-badger,项目名称:RenderPipeline,代码行数:12,代码来源:environment_capture_stage.py

示例7: _setup_inputs

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
    def _setup_inputs(self):
        """ Sets all required inputs """
        self.pta_probes = PTAInt.empty_array(1)

        # Construct the UBO which stores all environment probe data
        self.data_ubo = SimpleInputBlock("EnvProbes")
        self.data_ubo.add_input("num_probes", self.pta_probes)
        self.data_ubo.add_input("cubemaps", self.probe_mgr.cubemap_storage)
        self.data_ubo.add_input("diffuse_cubemaps", self.probe_mgr.diffuse_storage)
        self.data_ubo.add_input("dataset", self.probe_mgr.dataset_storage)
        self._pipeline.stage_mgr.input_blocks.append(self.data_ubo)

        # Use the UBO in light culling
        CullLightsStage.required_inputs.append("EnvProbes")
开发者ID:ELMERzark,项目名称:RenderPipeline,代码行数:16,代码来源:plugin.py

示例8: __init__

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
 def __init__(self, pipeline):
     RenderStage.__init__(self, pipeline)
     self.area_tex = None
     self.search_tex = None
     self.use_reprojection = True
     self._jitter_index = PTAInt.empty_array(1)
开发者ID:jakogut,项目名称:RenderPipeline,代码行数:8,代码来源:smaa_stage.py

示例9: _create_ptas

# 需要导入模块: from panda3d.core import PTAInt [as 别名]
# 或者: from panda3d.core.PTAInt import empty_array [as 别名]
 def _create_ptas(self):
     self._pta_grid_pos = PTALVecBase3.empty_array(1)
     self._pta_grid_size = PTAFloat.empty_array(1)
     self._pta_grid_res = PTAInt.empty_array(1)
     self._pta_grid_size[0] = self._voxel_ws
     self._pta_grid_res[0] = self._voxel_res
开发者ID:MYheavyGo,项目名称:RenderPipeline,代码行数:8,代码来源:VoxelizationStage.py


注:本文中的panda3d.core.PTAInt.empty_array方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。