本文整理汇总了C#中ParameterSet.GetVector4方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterSet.GetVector4方法的具体用法?C# ParameterSet.GetVector4怎么用?C# ParameterSet.GetVector4使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterSet
的用法示例。
在下文中一共展示了ParameterSet.GetVector4方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sun
public Sun(ParameterSet parm)
{
if (parm.HasParm("SunColor"))
lightColor = parm.GetVector4("SunColor");
if (parm.HasParm("AmbientLightColor"))
ambientLightColor = parm.GetVector4("AmbientLightColor");
Vector2 sunAngles = Vector2.Zero;
if (parm.HasParm("SunAngles"))
sunAngles = parm.GetVector2("SunAngles");
if ( shadowMap == null )
shadowMap = new RenderTarget2D(Renderer.Instance.GraphicsDevice, SHADOW_MAP_WIDTH_HEIGHT * NUM_CASCADES, SHADOW_MAP_WIDTH_HEIGHT, false, SurfaceFormat.Single, DepthFormat.Depth24);
SetSunDirectionFromSphericalCoords(sunAngles.X, sunAngles.Y);
}
示例2: PostLoadInit
public override void PostLoadInit(ParameterSet Parm)
{
int index = 0;
while (Parm.HasParm("Light" + index))
{
string keyString = "Light" + index;
string lightType = Parm.GetString(keyString);
switch (lightType)
{
case "Directional":
{
// read directional light parameters and create light
Vector3 direction = Parm.GetVector3(keyString + "Direction");
Vector4 color = Parm.GetVector4(keyString + "Color");
float intensity = Parm.GetFloat(keyString + "Intensity");
directionalLights.Add(new DirectionalLight(direction, color, intensity));
}
break;
case "Spot":
{
Vector3 position = Parm.GetVector3(keyString + "Position");
Vector3 direction = Parm.GetVector3(keyString + "Direction");
Vector4 color = Parm.GetVector4(keyString + "Color");
float intensity = Parm.GetFloat(keyString + "Intensity");
spotLights.Add(new SpotLight(DeferredRenderer.Instance.GraphicsDevice, position, direction, color, intensity, true, 1024, spotCookie));
}
break;
case "Point":
{
Vector3 position = Parm.GetVector3(keyString + "Position");
float radius = Parm.GetFloat(keyString + "Radius");
Vector4 color = Parm.GetVector4(keyString + "Color");
float intensity = Parm.GetFloat(keyString + "Intensity");
pointLights.Add(new PointLight(DeferredRenderer.Instance.GraphicsDevice, position, radius, color, intensity, true, 256));
}
break;
}
index++;
}
}