本文整理汇总了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;
}
示例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;
}