PageRenderTime 203ms CodeModel.GetById 100ms app.highlight 4ms RepoModel.GetById 97ms app.codeStats 0ms

/ContentSystem/Rendering/Helpers/ShaderUniformNames.cs

#
C# | 219 lines | 51 code | 30 blank | 138 comment | 0 complexity | 6642a6d10aa2e003f78ceb5794296cca MD5 | raw file
  1namespace Delta.ContentSystem.Rendering.Helpers
  2{
  3	/// <summary>
  4	/// Defines the names of all uniforms that we support (with properties) in
  5	/// all shaders by the directly by the engine. Every else uniform needs to
  6	/// be handled by the project code itself. Please note that most shaders
  7	/// are very simple and only have very few pixel shader instructions
  8	/// because we need to optimize as much as possible on most mobile
  9	/// devices. There are some complex shaders however for special effects,
 10	/// skinning, water, fog or even using multiple lights or shadow mapping.
 11	/// On faster hardware these can be used to archive great effects.
 12	/// </summary>
 13	public enum ShaderUniformNames
 14	{
 15		#region Global matrices
 16		/// <summary>
 17		/// Global matrices, important for transforming vertices in the vertex
 18		/// shader. We only use optimized matrices, more are not supported!
 19		/// Set in Set2DRenderMatrix and Set3DRenderMatrix.
 20		/// </summary>
 21		World,
 22
 23		/// <summary>
 24		/// Global matrices, important for transforming vertices in the vertex
 25		/// shader. We only use optimized matrices, more are not supported!
 26		/// Set in Set2DRenderMatrix and Set3DRenderMatrix.
 27		/// </summary>
 28		ViewInverse,
 29
 30		/// <summary>
 31		/// Global matrices, important for transforming vertices in the vertex
 32		/// shader. We only use optimized matrices, more are not supported!
 33		/// Set in Set2DRenderMatrix and Set3DRenderMatrix.
 34		/// </summary>
 35		WorldViewProj,
 36		#endregion
 37
 38		#region Skinned matrices
 39		/// <summary>
 40		/// For skinned meshes, this are all the bone matrices, which are
 41		/// updated by the app for each animated meshes and will be applied to
 42		/// all skinned vertices in the vertex shader (if shaders are possible).
 43		/// Set in Set3DRenderMatrix.
 44		/// </summary>
 45		SkinnedMatrices,
 46		#endregion
 47
 48		#region Time
 49		/// <summary>
 50		/// Time for animated shaders, rarely used however. Also set in
 51		/// Set2DRenderMatrix and Set3DRenderMatrix.
 52		/// </summary>
 53		Time,
 54		#endregion
 55
 56		#region Material data
 57		/// <summary>
 58		/// All the material data. Please note that many of these are not used
 59		/// in most shaders, e.g. DirectionalTextured just has DiffuseMap and
 60		/// the LightDirection plus global matrices, that's it, the rest is
 61		/// constant! It is faster and easier to merge materials if the shader
 62		/// uses constants and thus all materials rendered with them are
 63		/// basically the same, they only differ in the DiffuseMap, which is
 64		/// quickly checked.
 65		/// </summary>
 66		DiffuseMap,
 67
 68		/// <summary>
 69		/// Detail map
 70		/// </summary>
 71		DetailMap,
 72
 73		/// <summary>
 74		/// Specular map
 75		/// </summary>
 76		SpecularMap,
 77
 78		/// <summary>
 79		/// Height map
 80		/// </summary>
 81		HeightMap,
 82
 83		/// <summary>
 84		/// Normal map
 85		/// </summary>
 86		NormalMap,
 87
 88		/// <summary>
 89		/// Light map
 90		/// </summary>
 91		LightMap,
 92
 93		/// <summary>
 94		/// Sky cube map
 95		/// </summary>
 96		SkyCubeMap,
 97
 98		/// <summary>
 99		/// Reflection cube map
100		/// </summary>
101		ReflectionCubeMap,
102
103		/// <summary>
104		/// Shader lut texture for optimizations
105		/// </summary>
106		ShaderLutTexture,
107
108		/// <summary>
109		/// Shadow map
110		/// </summary>
111		ShadowMap,
112
113		/// <summary>
114		/// Global ambient color.
115		/// </summary>
116		AmbientColor,
117
118		/// <summary>
119		/// Diffise color.
120		/// </summary>
121		DiffuseColor,
122		/*currently all unused and pre-baked in the shader lut texture!
123		SpecularColor,
124		SpecularPower,
125		FresnelPower,
126 */
127		#endregion
128
129		#region Lighting
130		/// <summary>
131		/// Extra data for light shaders, this usually slows down pixel shaders
132		/// a lot, so mobile shaders rarely use direct lighting. Instead we try
133		/// to use a directional light source and light maps as much as possible.
134		/// </summary>
135		DirectionalLightDirection,
136
137		/// <summary>
138		/// Point lights have a position and a radius, optionally also a color.
139		/// </summary>
140		PointLightPosition,
141
142		/// <summary>
143		/// Point lights have a position and a radius, optionally also a color.
144		/// </summary>
145		PointLightRadius,
146
147		/// <summary>
148		/// Point lights have a position and a radius, optionally also a color.
149		/// </summary>
150		PointLightColor,
151
152		/// <summary>
153		/// We support 0-2 lights, but this is very rare. For more lights,
154		/// choose the 2 most dominant ones, ignore the rest or if you are
155		/// really nice, fade them out as you get closer to other light sources.
156		/// </summary>
157		PointLightTwoPosition,
158
159		/// <summary>
160		/// We support 0-2 lights, but this is very rare. For more lights,
161		/// choose the 2 most dominant ones, ignore the rest or if you are
162		/// really nice, fade them out as you get closer to other light sources.
163		/// </summary>
164		PointLightTwoRadius,
165
166		/// <summary>
167		/// We support 0-2 lights, but this is very rare. For more lights,
168		/// choose the 2 most dominant ones, ignore the rest or if you are
169		/// really nice, fade them out as you get closer to other light sources.
170		/// </summary>
171		PointLightTwoColor,
172		#endregion
173
174		#region Post screen
175		/// <summary>
176		/// Extra uniforms for post screen shaders, render-to-texture window size
177		/// and the resulting texture are required for all post screen shaders.
178		/// </summary>
179		PostScreenWindowSize,
180
181		/// <summary>
182		/// Post screen map
183		/// </summary>
184		PostScreenMap,
185
186		/// <summary>
187		/// For the last pass we can add this fadeout map to darken the borders
188		/// </summary>
189		PostScreenBorderFadeoutMap,
190
191		/// <summary>
192		/// Noise map
193		/// </summary>
194		PostScreenNoiseMap,
195		#endregion
196
197		#region Shadow mapping
198		/// <summary>
199		/// For shadow mapping we got some extra uniforms. These are only used
200		/// for shadow mapping algorithms, which is a huge pixel cost for older
201		/// mobile devices. There stencil shadows or fake shadow blobs make
202		/// usually more sense, however shadow mapping often looks better.
203		/// Transformation matrix for converting world position to texture
204		/// coordinates of the shadow map.
205		/// </summary>
206		ShadowMapTransform,
207
208		/// <summary>
209		/// WorldViewProj of the light projection for shadow mapping.
210		/// </summary>
211		ShadowMapLightWorldViewProj,
212
213		/// <summary>
214		/// Light view projection bias for shadow mapping.
215		/// </summary>
216		ShadowMapLightViewProjectionBias,
217		#endregion
218	}
219}