/ContentSystem/Rendering/Helpers/ShaderUniformNames.cs
C# | 219 lines | 51 code | 30 blank | 138 comment | 0 complexity | 6642a6d10aa2e003f78ceb5794296cca MD5 | raw file
Possible License(s): Apache-2.0
- namespace Delta.ContentSystem.Rendering.Helpers
- {
- /// <summary>
- /// Defines the names of all uniforms that we support (with properties) in
- /// all shaders by the directly by the engine. Every else uniform needs to
- /// be handled by the project code itself. Please note that most shaders
- /// are very simple and only have very few pixel shader instructions
- /// because we need to optimize as much as possible on most mobile
- /// devices. There are some complex shaders however for special effects,
- /// skinning, water, fog or even using multiple lights or shadow mapping.
- /// On faster hardware these can be used to archive great effects.
- /// </summary>
- public enum ShaderUniformNames
- {
- #region Global matrices
- /// <summary>
- /// Global matrices, important for transforming vertices in the vertex
- /// shader. We only use optimized matrices, more are not supported!
- /// Set in Set2DRenderMatrix and Set3DRenderMatrix.
- /// </summary>
- World,
-
- /// <summary>
- /// Global matrices, important for transforming vertices in the vertex
- /// shader. We only use optimized matrices, more are not supported!
- /// Set in Set2DRenderMatrix and Set3DRenderMatrix.
- /// </summary>
- ViewInverse,
-
- /// <summary>
- /// Global matrices, important for transforming vertices in the vertex
- /// shader. We only use optimized matrices, more are not supported!
- /// Set in Set2DRenderMatrix and Set3DRenderMatrix.
- /// </summary>
- WorldViewProj,
- #endregion
-
- #region Skinned matrices
- /// <summary>
- /// For skinned meshes, this are all the bone matrices, which are
- /// updated by the app for each animated meshes and will be applied to
- /// all skinned vertices in the vertex shader (if shaders are possible).
- /// Set in Set3DRenderMatrix.
- /// </summary>
- SkinnedMatrices,
- #endregion
-
- #region Time
- /// <summary>
- /// Time for animated shaders, rarely used however. Also set in
- /// Set2DRenderMatrix and Set3DRenderMatrix.
- /// </summary>
- Time,
- #endregion
-
- #region Material data
- /// <summary>
- /// All the material data. Please note that many of these are not used
- /// in most shaders, e.g. DirectionalTextured just has DiffuseMap and
- /// the LightDirection plus global matrices, that's it, the rest is
- /// constant! It is faster and easier to merge materials if the shader
- /// uses constants and thus all materials rendered with them are
- /// basically the same, they only differ in the DiffuseMap, which is
- /// quickly checked.
- /// </summary>
- DiffuseMap,
-
- /// <summary>
- /// Detail map
- /// </summary>
- DetailMap,
-
- /// <summary>
- /// Specular map
- /// </summary>
- SpecularMap,
-
- /// <summary>
- /// Height map
- /// </summary>
- HeightMap,
-
- /// <summary>
- /// Normal map
- /// </summary>
- NormalMap,
-
- /// <summary>
- /// Light map
- /// </summary>
- LightMap,
-
- /// <summary>
- /// Sky cube map
- /// </summary>
- SkyCubeMap,
-
- /// <summary>
- /// Reflection cube map
- /// </summary>
- ReflectionCubeMap,
-
- /// <summary>
- /// Shader lut texture for optimizations
- /// </summary>
- ShaderLutTexture,
-
- /// <summary>
- /// Shadow map
- /// </summary>
- ShadowMap,
-
- /// <summary>
- /// Global ambient color.
- /// </summary>
- AmbientColor,
-
- /// <summary>
- /// Diffise color.
- /// </summary>
- DiffuseColor,
- /*currently all unused and pre-baked in the shader lut texture!
- SpecularColor,
- SpecularPower,
- FresnelPower,
- */
- #endregion
-
- #region Lighting
- /// <summary>
- /// Extra data for light shaders, this usually slows down pixel shaders
- /// a lot, so mobile shaders rarely use direct lighting. Instead we try
- /// to use a directional light source and light maps as much as possible.
- /// </summary>
- DirectionalLightDirection,
-
- /// <summary>
- /// Point lights have a position and a radius, optionally also a color.
- /// </summary>
- PointLightPosition,
-
- /// <summary>
- /// Point lights have a position and a radius, optionally also a color.
- /// </summary>
- PointLightRadius,
-
- /// <summary>
- /// Point lights have a position and a radius, optionally also a color.
- /// </summary>
- PointLightColor,
-
- /// <summary>
- /// We support 0-2 lights, but this is very rare. For more lights,
- /// choose the 2 most dominant ones, ignore the rest or if you are
- /// really nice, fade them out as you get closer to other light sources.
- /// </summary>
- PointLightTwoPosition,
-
- /// <summary>
- /// We support 0-2 lights, but this is very rare. For more lights,
- /// choose the 2 most dominant ones, ignore the rest or if you are
- /// really nice, fade them out as you get closer to other light sources.
- /// </summary>
- PointLightTwoRadius,
-
- /// <summary>
- /// We support 0-2 lights, but this is very rare. For more lights,
- /// choose the 2 most dominant ones, ignore the rest or if you are
- /// really nice, fade them out as you get closer to other light sources.
- /// </summary>
- PointLightTwoColor,
- #endregion
-
- #region Post screen
- /// <summary>
- /// Extra uniforms for post screen shaders, render-to-texture window size
- /// and the resulting texture are required for all post screen shaders.
- /// </summary>
- PostScreenWindowSize,
-
- /// <summary>
- /// Post screen map
- /// </summary>
- PostScreenMap,
-
- /// <summary>
- /// For the last pass we can add this fadeout map to darken the borders
- /// </summary>
- PostScreenBorderFadeoutMap,
-
- /// <summary>
- /// Noise map
- /// </summary>
- PostScreenNoiseMap,
- #endregion
-
- #region Shadow mapping
- /// <summary>
- /// For shadow mapping we got some extra uniforms. These are only used
- /// for shadow mapping algorithms, which is a huge pixel cost for older
- /// mobile devices. There stencil shadows or fake shadow blobs make
- /// usually more sense, however shadow mapping often looks better.
- /// Transformation matrix for converting world position to texture
- /// coordinates of the shadow map.
- /// </summary>
- ShadowMapTransform,
-
- /// <summary>
- /// WorldViewProj of the light projection for shadow mapping.
- /// </summary>
- ShadowMapLightWorldViewProj,
-
- /// <summary>
- /// Light view projection bias for shadow mapping.
- /// </summary>
- ShadowMapLightViewProjectionBias,
- #endregion
- }
- }