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


C# Effect.GetString方法代码示例

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


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

示例1: LoadShaderTextures

        private static shader LoadShaderTextures(Effect effect)
        {
            try { effect.SetTexture("thisframe", thisFrame); } catch { } //throws an exception if this parameter doesn't exist :(
            try { effect.SetTexture("lastpass", lastPass); } catch { }
            try { effect.SetTexture("lastshader", lastShader); } catch { }
            try { effect.SetTexture("depthframe", depthFrame); } catch { }
            try { effect.SetValue("rcpres", new Vector4(1.0f/1024.0f, 1.0f/1024.0f, 0, 1)); } catch { }
            try { effect.SetValue("HDR", new Vector4(0.5f, 0.5f, 0.5f, 0.5f)); } catch { }

            int count=1;
            while(true) {
                string texpath;
                try { texpath=effect.GetString("texname"+count.ToString()); } catch { break; }
                if(texpath!=null) {
                    try {
                        Texture tex=Texture.FromFile(DXMain.device, Statics.runDir + "\\data files\\textures\\"+texpath);
                        effect.SetTexture("tex"+count.ToString(), tex);
                    } catch { }
                } else break;
                count++;
            }

            shader s = new shader();
            try {
                s.ehTime = effect.GetParameter(null, "time");
            } catch {
                s.ehTime = null;
            }
            try {
                s.ehHDR = effect.GetParameter(null, "HDR");
            } catch {
                s.ehHDR = null;
            }
            s.effect=effect;

            return s;
        }
开发者ID:europop,项目名称:MGE-XE,代码行数:37,代码来源:Shaders.cs

示例2: LoadShaderTextures

        private static shader LoadShaderTextures(Effect effect) {
            try { effect.SetTexture("lastpass", lastPass); } catch { } //throws an exception if this parameter doesn't exist :(
            try { effect.SetTexture("lastshader", lastShader); } catch { }
            try { effect.SetTexture("depthframe", depthFrame); } catch { }
            try { effect.SetValue("rcpres", new Vector4(1f/frameWidth, 1f/frameHeight, 0, 1)); } catch { }
            try { effect.SetValue("fov", 85f); } catch { }
            try { effect.SetValue("fogstart", 819.2f); } catch { }
            try { effect.SetValue("fogrange", 65536.0f); } catch { }
            try { effect.SetValue("waterlevel", 0f); } catch { }
			try { effect.SetValue("HDR", new Vector4(0.25f, 0.25f, 0.25f, 02.5f)); } catch { }
			try { effect.SetValue("eyepos", new Vector3(0f, 0f, 128f)); } catch { }
			try { effect.SetValue("eyevec", new Vector3(1f, 0f, 0f)); } catch { }

            int count=1;
            while(true) {
                string texpath;
                try { texpath=effect.GetString("texname"+count.ToString()); } catch { break; }
                if(texpath!=null) {
                    try {
                        Texture tex=Texture.FromFile(DXMain.device, Statics.runDir + "\\data files\\textures\\"+texpath);
                        effect.SetTexture("tex"+count.ToString(), tex);
                    } catch { }
                } else break;
                count++;
            }

            shader s = new shader();
            try {
                s.ehTime = effect.GetParameter(null, "time");
            } catch {
                s.ehTime = null;
            }
            try {
                s.ehHDR = effect.GetParameter(null, "HDR");
            } catch {
                s.ehHDR = null;
            }
            s.effect=effect;

            return s;
        }
开发者ID:mdmallardi,项目名称:MGE-XE,代码行数:41,代码来源:Shaders.cs


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