/Utilities/Graphics/ShaderFeatures/ShaderConstants.cs
C# | 133 lines | 33 code | 18 blank | 82 comment | 0 complexity | 6a7057bceb81668eb038227a59318e29 MD5 | raw file
Possible License(s): Apache-2.0
- using Delta.Utilities.Datatypes;
-
- namespace Delta.Utilities.Graphics.ShaderFeatures
- {
- /// <summary>
- /// Shader constants, not only needed for the Content and as default values
- /// for the shader classes in Graphics, but also for the default fallback
- /// values for many of the shader feature classes in this namespace.
- /// </summary>
- public class ShaderConstants
- {
- #region Constants
- /// <summary>
- /// Default colors are 0.15 for ambient and 1.0 for diffuse and specular.
- /// </summary>
- public static readonly Color DefaultAmbientColor =
- new Color(0.15f, 0.15f, 0.15f);
-
- /// <summary>
- /// Default diffuse color is almost white (90%)
- /// </summary>
- public static readonly Color DefaultDiffuseColor =
- new Color(0.9f, 0.9f, 0.9f);
-
- /// <summary>
- /// Default specular color is always white
- /// </summary>
- public static readonly Color DefaultSpecularColor = Color.White;
-
- /// <summary>
- /// Default specular power (4 now for better fresnel, was 24 before)
- /// </summary>
- public const float DefaultSpecularPower = 10.0f; //13.0f;//16.0f;//24.0f;
-
- /// <summary>
- /// Default fresnel power if the shader for this material does fresnel,
- /// fresnel bias is 0 (or bias in the shader) and the factor is 1.0 too.
- /// Note: Now in a pre-calculated lut texture, not longer a parameter!
- /// </summary>
- public const float DefaultFresnelPower = 4.0f; //7.0f;//4.0f;
-
- /// <summary>
- /// Default fresnel factor. Fresnel * FresnelFactor.
- /// Note: Now in a pre-calculated lut texture, not longer a parameter!
- /// </summary>
- public const float DefaultFresnelFactor = 2.0f; //8.0f;
-
- /// <summary>
- /// Default parallax offset amount in pixels for a 1024x1024 texture.
- /// 16 means that we will offset -16 to +16 pixels in the texture (which
- /// is a lot, you really need smooth transitions to make this look ok).
- /// Note: For a 2048x2048 texture it would be -32 to +32 pixels, for
- /// a 512x512 texture it would be -8 to +8 because the formula is always
- /// the same: 1024.0 / ParallaxAmount. Note: Increased a bit to 27.0f
- /// because now it is only used on floors, old value: 16.0f.
- /// </summary>
- public const float DefaultParallaxAmount = 27.0f; //20.0f;//16.0f;
-
- /// <summary>
- /// Minimum ambient value.
- /// </summary>
- public const float DefaultMinAmbientValue = 0.25f; //0.15f;
-
- /// <summary>
- /// Value for alpha test.
- /// The default value is normally 0.66.
- /// </summary>
- public const float DefaultAlphaTestValue = 0.33f;
-
- /// <summary>
- /// Default fog color. 133, 37, 12 + 0.075 brightness
- /// </summary>
- public static readonly Color DefaultFogColor = new Color(
- // Mix the old fog color with white to make fog not so strong,
- // mipmap fog is not very great ..
- (0.52f + 0.15f + 1.0f) / 2.0f,
- (0.145f + 0.15f + 1.0f) / 2.0f,
- (0.047f + 0.15f + 1.0f) / 2.0f, 1.0f);
-
- /// <summary>
- /// Default fog start.
- /// </summary>
- public const float DefaultFogStart = 20.0f;
-
- /// <summary>
- /// Fog end.
- /// </summary>
- public const float DefaultFogEnd = 90.0f;
-
- /// <summary>
- /// Maximum fog value.
- /// </summary>
- public const float DefaultMaxFogValue = 0.9f;
-
- /// <summary>
- /// Minimum fog value.
- /// </summary>
- public const float DefaultMinFogValue = 0.15f;
-
- /// <summary>
- /// Maximal bones count that we can support currently = 36.
- /// But you can change that value dynamically via the Content Settings :)
- /// </summary>
- public const int MaxBonesCount = 36;
-
- /*currently unused, should be in the shadow classes anyway!
- /// <summary>
- /// Default shadow that will generates in shader generator.
- /// Currently set to the fastest version: Projection shadows, but
- /// can be changed before generating content to different values.
- /// </summary>
- public static ShadowType DefaultShadowType = ShadowType.Projection;
- */
-
- /// <summary>
- /// Default shadow size. Normally 512x512. The size is useful to get
- /// the pixel size in shader (1.0 / 512.0).
- /// </summary>
- public static readonly Size DefaultShadowSize =
- //could be too much for the Tegra:
- new Size(512, 512);
-
- //new Size(256, 256);
- /// <summary>
- /// Default shadow color. Using for the shadow map generation.
- /// 0.33 is pretty dark (0.5 is too weak however), 0.0 is black and
- /// will usually not look very well for bright scenes (only in Doom3 ^^)
- /// </summary>
- public static readonly Color DefaultShadowColor =
- new Color(0.33f, 0.33f, 0.33f, 1.0f);
- #endregion
- }
- }