示例#1
0
        public void ModifyCompilationEnvironment(H1MaterialResource material, H1ShaderCompileHelper.H1ShaderCompilerEnvironment outEnvironment)
        {
            String vertexfactoryIncludeString = String.Format("#include \"{0}\"", m_ShaderFileName);

            outEnvironment.SetIncludeFileContent("VertexFactory.hlsl", vertexfactoryIncludeString);

            // call delegate ModifyCompilationEnvironmentRef
            m_ModifyCompilationEnvironmentRef(material, outEnvironment);
        }
        public bool BeginCompileShaderMap()
        {
            H1MaterialShaderMap newMaterialShaderMap = new H1MaterialShaderMap();

            // generate the material shader code
            // @TODO - H1HLSLMaterialTranslator

            // create a shader compiler environment for the material
            H1ShaderCompileHelper.H1ShaderCompilerEnvironment materialEnvironment = new H1ShaderCompileHelper.H1ShaderCompilerEnvironment();

            // H1HLSLMaterialTranslator get environment and shader code
            String materialShaderCode = ""; // @TODO - material shader code

            materialEnvironment.SetIncludeFileContent("Material.hlsl", materialShaderCode);

            // compile shader map
            newMaterialShaderMap.Compile(this, materialEnvironment);

            m_MaterialShaderMap = newMaterialShaderMap;

            return(m_MaterialShaderMap != null ? true : false);
        }