本文整理汇总了C#中Effect.GetValueString方法的典型用法代码示例。如果您正苦于以下问题:C# Effect.GetValueString方法的具体用法?C# Effect.GetValueString怎么用?C# Effect.GetValueString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Effect
的用法示例。
在下文中一共展示了Effect.GetValueString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindAnnotationString
protected static bool FindAnnotationString(Effect effect, EffectHandle parameterHandle, string name, ref string ret)
{
ParameterDescription paramDesc = effect.GetParameterDescription(parameterHandle);
for (int i = 0; i < paramDesc.Annotations; i++)
{
EffectHandle annotationHandle = effect.GetAnnotation(parameterHandle, i);
if (annotationHandle != null) /* <-- Here, is this possible? */
{
ParameterDescription annotationDesc = effect.GetParameterDescription(annotationHandle);
if (annotationDesc.Type == ParameterType.String &&
string.Compare(annotationDesc.Name, name, true) == 0)
{
ret = effect.GetValueString(annotationHandle);
return true;
}
}
}
return false;
}
示例2: LoadShaderTextures
private static shader LoadShaderTextures(Effect effect)
{
try { effect.SetValue("thisframe", thisFrame); } catch { } //throws an exception if this parameter doesn't exist :(
try { effect.SetValue("lastpass", lastPass); } catch { }
try { effect.SetValue("lastshader", lastShader); } catch { }
try { effect.SetValue("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 { }
//**/try { effect.SetValue("lastframe", lastFrame); } catch { }
int count=1;
while(true) {
string texpath;
try { texpath=effect.GetValueString("texname"+count.ToString()); } catch { break; }
if(texpath!=null) {
try {
Texture tex=TextureLoader.FromFile(DXMain.device, Statics.runDir + "\\data files\\textures\\"+texpath);
effect.SetValue("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;
}
//**/try {
//**/ s.ehSinVar=effect.GetParameter(null, "sinvar");
//**/} catch {
//**/ s.ehSinVar = null;
//**/}
//**/try {
//**/ s.ehLinVar=effect.GetParameter(null, "linvar");
//**/} catch {
//**/ s.ehLinVar = null;
//**/}
//**/try {
//**/ s.ehTicks=effect.GetParameter(null, "tickcount");
//**/} catch {
//**/ s.ehTicks = null;
//**/}
s.effect=effect;
return s;
}