Exemple #1
0
 def start(self):
     # load over lay resources
     self._font_mat_res = h3d.addResource(h3d.ResTypes.Material,
                                          "overlays/font.material.xml", 0)
     self._panel_mat_res = h3d.addResource(h3d.ResTypes.Material,
                                           "overlays/panel.material.xml", 0)
     # TODO: get resource data from Engine interface
     self._enable = h3d.utils.loadResourcesFromDisk('../../Data/Common')
Exemple #2
0
 def __init__(self):
     # Load character with walk animation
     self.character = h3d.addResource(h3d.ResTypes.SceneGraph,
                                      "models/man/man.scene.xml", 0)
     self.characterWalk = h3d.addResource(h3d.ResTypes.Animation,
                                          "animations/man.anim", 0)
     self.particles = []
     self.setRange(32)
Exemple #3
0
	def _h3dAddResources(self):
		# add resources
		class H3DRes:
			pass
		h3dres = H3DRes()
		self._h3dres = h3dres

		h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/forward.pipeline.xml", 0)
		h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material, "overlays/font.material.xml", 0)
		h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material, "overlays/logo.material.xml", 0)
Exemple #4
0
 def load_res(self) :
     
     class H3DRes: pass
         
     h3dres = H3DRes()
     self._h3dres = h3dres
     # Pipelines
     h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/forward.pipeline.xml", 0)
     h3dres.deferredPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/sphvol.pipeline.xml", 0)
     # Overlays
     h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material, "overlays/font.material.xml", 0)
     h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material, "overlays/panel.material.xml", 0)
     h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material, "overlays/logo.material.xml", 0)
     # Shader for deferred shading
     h3dres.lightMat = h3d.addResource(h3d.ResTypes.Material, "materials/sphLight.material.xml", 0)
     # Environment
     h3dres.env = h3d.addResource(h3d.ResTypes.SceneGraph, "models/platform/platform.scene.xml", 0)
     # Skybox
     h3dres.skyBox = h3d.addResource(h3d.ResTypes.SceneGraph, "models/skybox/skybox_desert.scene.xml", 0)
     # Volume box
     h3dres.volBox = h3d.addResource(h3d.ResTypes.SceneGraph, "models/sphvolbox/box.scene.xml", 0)
     if not h3d.utils.loadResourcesFromDisk(DataDir):
         print 'loading of some resources failed: See Horde3D_Log.html'
     # Load sph volume
     h3dres.sphVol = SPH.LoadVolumeData('./frame_273.fr')
     if h3dres.sphVol != 0:
         material =  h3d.findResource( h3d.ResTypes.Material, "models/sphvolbox/box.material.xml" )
         h3d.setResParamI(material, h3d.MatRes.SamplerElem, 0, h3d.MatRes.SampTexResI, h3dres.sphVol)
     else :
         print 'can not laod sph raw volume data'
Exemple #5
0
    def load_res(self):
        class H3DRes:
            pass

        h3dres = H3DRes()
        self._h3dres = h3dres
        # Pipelines
        h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline,
                                             "pipelines/forward.pipeline.xml",
                                             0)
        h3dres.deferredPipe = h3d.addResource(
            h3d.ResTypes.Pipeline, "pipelines/deferred.pipeline.xml", 0)
        # Overlays
        h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material,
                                         "overlays/font.material.xml", 0)
        h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material,
                                          "overlays/panel.material.xml", 0)
        h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material,
                                         "overlays/logo.material.xml", 0)
        # Shader for deferred shading
        h3dres.lightMat = h3d.addResource(h3d.ResTypes.Material,
                                          "materials/light.material.xml", 0)
        # Environment
        h3dres.env = h3d.addResource(h3d.ResTypes.SceneGraph,
                                     "models/platform/platform.scene.xml", 0)
        # Skybox
        h3dres.skyBox = h3d.addResource(
            h3d.ResTypes.SceneGraph, "models/skybox/skybox_desert.scene.xml",
            0)
        # Load character animations
        self._crowdSim = CrowdSim()
        if not h3d.utils.loadResourcesFromDisk(DataDir):
            print 'loading of some resources failed: See Horde3D_Log.html'
    def _h3dAddResources(self):
        class H3DRes:
            pass

        h3dres = H3DRes()
        self._h3dres = h3dres

        # Pipelines
        h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/forward.pipeline.xml", 0)
        # Overlays
        h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material, "overlays/font.material.xml", 0)
        h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material, "overlays/panel.material.xml", 0)
        h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material, "overlays/logo.material.xml", 0)
        # Terrain
        h3dres.terrain = h3d.addResource(h3d.ResTypes.SceneGraph, "terrains/terrain1/terrain1.scene.xml", 0)
        h3dres.matRes = h3d.findResource(h3d.ResTypes.Material, "terrains/terrain1/terrain1.material.xml" );
Exemple #7
0
 def load_res(self) :
     
     class H3DRes: pass
         
     h3dres = H3DRes()
     self._h3dres = h3dres
     # Pipelines
    # Pipelines
     h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/forward.pipeline.xml", 0)
     # Overlays
     h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material, "overlays/font.material.xml", 0)
     h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material, "overlays/panel.material.xml", 0)
     h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material, "overlays/logo.material.xml", 0)
     # Terrain
     h3dres.terrain = h3d.addResource(h3d.ResTypes.SceneGraph, "terrains/terrain1/terrain1.scene.xml", 0)
     h3dres.matRes = h3d.findResource(h3d.ResTypes.Material, "terrains/terrain1/terrain1.material.xml" );
     if not h3d.utils.loadResourcesFromDisk(DataDir + "|../../Data/Terrain"):
         print 'loading of some resources failed: See Horde3D_Log.html'
    def _h3dAddResources(self):
        class H3DRes:
            pass

        h3dres = H3DRes()
        self._h3dres = h3dres

        # Pipelines
        h3dres.hdrPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/hdr.pipeline.xml", 0)
        h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/forward.pipeline.xml", 0)
        # Overlays
        h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material, "overlays/font.material.xml", 0)
        h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material, "overlays/panel.material.xml", 0)
        h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material, "overlays/logo.material.xml", 0)
        # Environment
        h3dres.env = h3d.addResource(h3d.ResTypes.SceneGraph, "models/sphere/sphere.scene.xml", 0)
        # Knight
        h3dres.knight = h3d.addResource(h3d.ResTypes.SceneGraph, "models/knight/knight.scene.xml", 0)
        h3dres.knightAnim1 = h3d.addResource(h3d.ResTypes.Animation, "animations/knight_order.anim", 0)
        h3dres.knightAnim2 = h3d.addResource(h3d.ResTypes.Animation, "animations/knight_attack.anim", 0)
        # Particle system
        h3dres.particleSys = h3d.addResource(h3d.ResTypes.SceneGraph, "particles/particleSys1/particleSys1.scene.xml", 0)
Exemple #9
0
 def load_res(self) :
     
     class H3DRes: pass
         
     h3dres = H3DRes()
     self._h3dres = h3dres
     # Pipelines
     #h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/forward.pipeline.xml", 0)
     h3dres.hdrPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/hdr.pipeline.xml", 0)
     h3dres.deferredPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/deferred_refined.pipeline.xml", 0)
     # Overlays
     h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material, "overlays/font.material.xml", 0)
     h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material, "overlays/panel.material.xml", 0)
     h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material, "overlays/logo.material.xml", 0)
     # Shader for deferred shading
     h3dres.lightMat = h3d.addResource(h3d.ResTypes.Material, "materials/light.material.xml", 0)
     # Skybox
     h3dres.skyBox = h3d.addResource(h3d.ResTypes.SceneGraph, "models/skybox/skybox.scene.xml", 0)
     # Particle system
     h3dres.particleSys  = h3d.addResource(h3d.ResTypes.SceneGraph, "particles/particleSys1/particleSys1.scene.xml", 0)
     # Load physics scene
     h3dres.dominoRes = h3d.addResource(h3d.ResTypes.SceneGraph, "models/domino/domino.scene.xml", 0)
     if not h3d.utils.loadResourcesFromDisk(DataDir):
         print 'loading of some resources failed: See Horde3D_Log.html'
Exemple #10
0
 def load_res(self) :
     
     class H3DRes: pass
         
     h3dres = H3DRes()
     self._h3dres = h3dres
     # Pipelines
     h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/forward.pipeline.xml", 0)
     h3dres.deferredPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/deferred.pipeline.xml", 0)
     # Overlays
     h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material, "overlays/font.material.xml", 0)
     h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material, "overlays/panel.material.xml", 0)
     h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material, "overlays/logo.material.xml", 0)
     # Shader for deferred shading
     h3dres.lightMat = h3d.addResource(h3d.ResTypes.Material, "materials/light.material.xml", 0)
     # Environment
     h3dres.env = h3d.addResource(h3d.ResTypes.SceneGraph, "models/platform/platform.scene.xml", 0)
     # Skybox
     h3dres.skyBox = h3d.addResource(h3d.ResTypes.SceneGraph, "models/skybox/skybox_desert.scene.xml", 0)
     # Load character animations
     self._crowdSim = CrowdSim()
     if not h3d.utils.loadResourcesFromDisk(DataDir):
         print 'loading of some resources failed: See Horde3D_Log.html'
Exemple #11
0
    def load_res(self):
        self.reset()

        class H3DRes:
            pass

        h3dres = H3DRes()
        self._h3dres = h3dres
        # Pipelines
        h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline,
                                             "pipelines/forward.pipeline.xml",
                                             0)
        h3dres.deferredPipe = h3d.addResource(h3d.ResTypes.Pipeline,
                                              "pipelines/sph.pipeline.xml", 0)
        if self.create_cmap:
            h3dres.deferredPipe2 = h3d.addResource(
                h3d.ResTypes.Pipeline, "pipelines/caustic.pipeline.xml", 0)
        # Overlays
        h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material,
                                         "overlays/font.material.xml", 0)
        h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material,
                                          "overlays/panel.material.xml", 0)
        h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material,
                                         "overlays/logo.material.xml", 0)
        # Shader for deferred shading
        h3dres.lightMat = h3d.addResource(h3d.ResTypes.Material,
                                          "materials/sph_light.material.xml",
                                          0)
        # Environment
        #h3dres.env = h3d.addResource(h3d.ResTypes.SceneGraph, "models/platform/platform.scene.xml", 0)
        # Skybox
        h3dres.skyBox = h3d.addResource(
            h3d.ResTypes.SceneGraph, "models/skybox/skybox_stpeters.scene.xml",
            0)
        h3dres.skyBox2 = h3d.addResource(
            h3d.ResTypes.SceneGraph, "models/skybox/skybox_desert.scene.xml",
            0)
        # Volume box
        h3dres.volBox = h3d.addResource(h3d.ResTypes.SceneGraph,
                                        "sphscene/sph1.scene.xml", 0)
        # Room box
        h3dres.roomBox = h3d.addResource(h3d.ResTypes.SceneGraph,
                                         "models/roombox/box.scene.xml", 0)
        h3dres.plane = h3d.addResource(h3d.ResTypes.SceneGraph,
                                       "models/plane/plane.scene.xml", 0)
        # Load resources
        if not h3d.utils.loadResourcesFromDisk(DataDir + '|../../Data/SPH'):
            print 'loading of some resources failed: See Horde3D_Log.html'

        if self.create_cmap:
            # Create a caustic renderable texture
            h3dres.cmap = h3d.createTexture("caustic_map", self.cmap_size,
                                            self.cmap_size,
                                            h3d.Formats.TEX_RGBA16F,
                                            h3d.ResFlags.TexRenderable)
            # Get shader uniform locations
            self.get_cmap_res()
Exemple #12
0
    def load_res(self) :
        self.reset()
        class H3DRes: pass
        h3dres = H3DRes()
        self._h3dres = h3dres
        # Pipelines
        h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/forward.pipeline.xml", 0)
        h3dres.deferredPipe = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/sph.pipeline.xml", 0)
        if self.create_cmap :
            h3dres.deferredPipe2 = h3d.addResource(h3d.ResTypes.Pipeline, "pipelines/caustic.pipeline.xml", 0)
        # Overlays
        h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material, "overlays/font.material.xml", 0)
        h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material, "overlays/panel.material.xml", 0)
        h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material, "overlays/logo.material.xml", 0)
        # Shader for deferred shading
        h3dres.lightMat = h3d.addResource(h3d.ResTypes.Material, "materials/sph_light.material.xml", 0)
        # Environment
        h3dres.env = h3d.addResource(h3d.ResTypes.SceneGraph, "models/platform/platform.scene.xml", 0)
        # Skybox
        h3dres.skyBox = h3d.addResource(h3d.ResTypes.SceneGraph, "models/skybox/skybox_stpeters.scene.xml", 0)
        h3dres.skyBox2 = h3d.addResource(h3d.ResTypes.SceneGraph, "models/skybox/skybox_desert.scene.xml", 0)
        # Volume box
        h3dres.volBox = h3d.addResource(h3d.ResTypes.SceneGraph, "sphscene/sph1.scene.xml", 0)
        # Load resources
        if not h3d.utils.loadResourcesFromDisk(DataDir + '|../../Data/SPH'):
            print 'loading of some resources failed: See Horde3D_Log.html'

        if self.create_cmap :
            # Create a caustic renderable texture
            h3dres.cmap = h3d.createTexture("caustic_map", self.cmap_size, self.cmap_size, 
                                            h3d.Formats.TEX_RGBA16F, h3d.ResFlags.TexRenderable)
            # Get shader uniform locations
            self.get_cmap_res()
Exemple #13
0
 def __init__(self):
     # Load character with walk animation
     self.character = h3d.addResource(h3d.ResTypes.SceneGraph, "models/man/man.scene.xml", 0)
     self.characterWalk = h3d.addResource(h3d.ResTypes.Animation, "animations/man.anim", 0)
     self.particles = []
     self.setRange(32)
Exemple #14
0
 def start(self):
     # load over lay resources
     self._font_mat_res = h3d.addResource( h3d.ResTypes.Material, "overlays/font.material.xml", 0 );
     self._panel_mat_res = h3d.addResource( h3d.ResTypes.Material, "overlays/panel.material.xml", 0 );
     # TODO: get resource data from Engine interface
     self._enable = h3d.utils.loadResourcesFromDisk('../../Data/Common')
Exemple #15
0
    def load_res(self):
        class H3DRes:
            pass

        h3dres = H3DRes()
        self._h3dres = h3dres
        # Pipelines
        h3dres.forwardPipe = h3d.addResource(h3d.ResTypes.Pipeline,
                                             "pipelines/forward.pipeline.xml",
                                             0)
        h3dres.deferredPipe = h3d.addResource(
            h3d.ResTypes.Pipeline, "pipelines/deferred_refined.pipeline.xml",
            0)
        h3dres.hdrPipe = h3d.addResource(h3d.ResTypes.Pipeline,
                                         "pipelines/hdr.pipeline.xml", 0)
        h3dres.sphPipe = h3d.addResource(h3d.ResTypes.Pipeline,
                                         "pipelines/sph.pipeline.xml", 0)
        self.__rmode_dict = {
            0: ('forward', h3dres.forwardPipe),
            1: ('deferred', h3dres.deferredPipe),
            2: ('hdr', h3dres.hdrPipe),
            3: ('sph', h3dres.sphPipe),
        }
        # Overlays
        h3dres.fontMat = h3d.addResource(h3d.ResTypes.Material,
                                         "overlays/font.material.xml", 0)
        h3dres.panelMat = h3d.addResource(h3d.ResTypes.Material,
                                          "overlays/panel.material.xml", 0)
        h3dres.logoMat = h3d.addResource(h3d.ResTypes.Material,
                                         "overlays/logo.material.xml", 0)
        # Environment
        h3dres.env = h3d.addResource(h3d.ResTypes.SceneGraph,
                                     "models/sphere/sphere.scene.xml", 0)
        #h3dres.env = h3d.addResource(h3d.ResTypes.SceneGraph, "models/platform/platform.scene.xml", 0)
        # Skybox
        h3dres.skyBox = h3d.addResource(h3d.ResTypes.SceneGraph,
                                        "models/skybox/skybox.scene.xml", 0)
        # Shader for deferred shading
        h3dres.lightMat = h3d.addResource(h3d.ResTypes.Material,
                                          "materials/sphLight.material.xml", 0)
        # Knight
        h3dres.knight = h3d.addResource(h3d.ResTypes.SceneGraph,
                                        "models/knight/knight.scene.xml", 0)
        h3dres.knightAnim1 = h3d.addResource(h3d.ResTypes.Animation,
                                             "animations/knight_order.anim", 0)
        h3dres.knightAnim2 = h3d.addResource(h3d.ResTypes.Animation,
                                             "animations/knight_attack.anim",
                                             0)
        # Particle system
        h3dres.particleSys = h3d.addResource(
            h3d.ResTypes.SceneGraph,
            "particles/particleSys1/particleSys1.scene.xml", 0)
        h3dres.particleSys2 = h3d.addResource(
            h3d.ResTypes.SceneGraph,
            "particles/sphwater/particlesys.scene.xml", 0)
        if not h3d.utils.loadResourcesFromDisk(DataDir):
            print 'loading of some resources failed: See Horde3D_Log.html'