Esempio n. 1
0
 def testCompiledShader(self):
     """Test reading params from compiled shaders.
     """
     renderers = [("3Delight", "shaderdl", "sdl"),
                  #("Aqsis", "aqsl", "slx"),
                  #("Pixie", "sdrc", "sdr"),
                  #("PRMan", "shader -C", "slo")
                  ]
     for data in renderers:
         renderer,shaderCompiler,shaderExt = data
         slcName = "tmp/testshader.%s"%shaderExt
         if os.path.exists(slcName):
             os.remove(slcName)
         cmd = "%s ../data/testshader.sl"%(shaderCompiler)
         os.chdir("tmp")
         res = os.system(cmd)
         os.chdir("..")
         if res!=0:
             print "WARNING: Skipping slparams test for %s. Shading compiler (%s) is not available."%(renderer, shaderCompiler)
             continue
         res = slparams.slparams(slcName)
         self.assertTestShaderParams(res)
         
         # Check the meta data (renderer-specific)
         if renderer=="3Delight":
             meta = res[0].meta
             self.assertEqual(meta, {"MyData": "MyValue"})
Esempio n. 2
0
 def testCompiledShader(self):
     """Test reading params from compiled shaders.
     """
     renderers = [("3Delight", "shaderdl", "sdl"),
                  #("Aqsis", "aqsl", "slx"),
                  #("Pixie", "sdrc", "sdr"),
                  #("PRMan", "shader -C", "slo")
                  ]
     for data in renderers:
         renderer,shaderCompiler,shaderExt = data
         slcName = "tmp/testshader.%s"%shaderExt
         if os.path.exists(slcName):
             os.remove(slcName)
         cmd = "%s ../data/testshader.sl"%(shaderCompiler)
         os.chdir("tmp")
         res = os.system(cmd)
         os.chdir("..")
         if res!=0:
             print ("WARNING: Skipping slparams test for %s. Shading compiler (%s) is not available."%(renderer, shaderCompiler))
             continue
         res = slparams.slparams(slcName)
         self.assertTestShaderParams(res)
         
         # Check the meta data (renderer-specific)
         if renderer=="3Delight":
             meta = res[0].meta
             self.assertEqual(meta, {"MyData": "MyValue"})
Esempio n. 3
0
 def testSlparams(self):
     """Test the slparams.slparams() function.
     """
     res = slparams.slparams("data/testshader.sl")
     self.assertTestShaderParams(res)
Esempio n. 4
0
 def testSlparams(self):
     """Test the slparams.slparams() function.
     """
     res = slparams.slparams("data/testshader.sl")
     self.assertTestShaderParams(res)