Esempio n. 1
0
        public ShaderMaterial Clone()
        {
            var result = new ShaderMaterial();

            result.Material = new Material(this.Material);
            foreach (var p in this.properties)
            {
                result.properties.Add(p.Clone());
            }
            return(result);
        }
Esempio n. 2
0
        private void LoadShaders()
        {
            //MaterialFXAA = new ShaderMaterial("FXAA", "Hidden/SlinDev/Desktop/PostProcessing/FXAA");
            //MaterialColorAdjust = new ShaderMaterial("ColorAdjust", "Kronal/Color Adjust");

#if false
            MaterialEdgeDetect  = new ShaderMaterial("EdgeDetectNormalsColor", "Hidden/EdgeDetectColors");
            MaterialEdgeDetect1 = new ShaderMaterial("ShaderEdgeDetectNormals1", "Hidden/Edge Detect Normals1");
            MaterialEdgeDetect2 = new ShaderMaterial("ShaderEdgeDetectNormals2", "Hidden/Edge Detect Normals2");
            MaterialEdgeDetect3 = new ShaderMaterial("ShaderEdgeDetectNormals3", "Hidden/Edge Detect Normals3");

            MaterialEdgeDetect4 = new ShaderMaterial("edn", "Hidden/EdgeDetect");
            MaterialEdgeDetect5 = new ShaderMaterial("edn2", "KVV/Hidden/Edge Detect Normals2");
#endif

            foreach (var s in BundleIndex.LoadedShaders)
            {
                var mat = new Material(s.Value);
                Materials.Add(mat.shader.name, mat);
                log.debug(string.Format("Found shader: {0}", mat.shader.name));
            }

#if false
            foreach (var shaderFilename in Shaders)
            {
                try
                {
                    var mat = new Material(KVrUtilsCore.AssetIndex.gettShaderById(shaderFilename));
                    log.debug(string.Format("Material: {0} loaded", shaderFilename));
                    Materials[mat.shader.name] = mat;
                }
                catch
                {
                    log.error(string.Format("LoadShaders {0} : Failed to load {1}", this.GetType().Name, shaderFilename));
                }
            }
#endif
        }
 public ShaderMaterial Clone()
 {
     var result = new ShaderMaterial();
     result.Material = new Material(this.Material);
     foreach (var p in this.properties)
     {
         result.properties.Add(p.Clone());
     }
     return result;
 }