Ejemplo n.º 1
0
		private void RenderNormalMapTexture(EffectWrapper pEffect, EffectPass pEffectPass)
		{
			float fMinVertexX = 0.0f;
			float fMaxVertexX = Settings.NORMAL_MAP_TEXTURE_SIZE - 1;
			float fMinVertexY = fMaxVertexX;
			float fMaxVertexY = 0.0f;

			TextureVertex[] pVertices = new TextureVertex[4];

			// (-1, -1)
			pVertices[0] = new TextureVertex(new Vector2(fMinVertexX, fMinVertexY));

			// (-1, 1)
			pVertices[1] = new TextureVertex(new Vector2(fMinVertexX, fMaxVertexY));

			// (1, -1)
			pVertices[2] = new TextureVertex(new Vector2(fMaxVertexX, fMinVertexY));

			// (1, 1)
			pVertices[3] = new TextureVertex(new Vector2(fMaxVertexX, fMaxVertexY));

			pEffect.GraphicsDevice.DrawUserPrimitives<TextureVertex>(
				PrimitiveType.TriangleStrip,
				pVertices, 0, 2);
		}
Ejemplo n.º 2
0
		private static void RenderElevationTexture(EffectWrapper pEffect, EffectPass pEffectPass)
		{
			float fMinVertexX = 0.0f;
			float fMaxVertexX = Settings.ELEVATION_TEXTURE_SIZE;
			float fMinVertexY = Settings.ELEVATION_TEXTURE_SIZE;
			float fMaxVertexY = 0.0f;

			TextureVertex[] pVertices = new TextureVertex[4];

			// (-1, -1)
			pVertices[0] = new TextureVertex(new Vector2(fMinVertexX, fMinVertexY));

			// (-1, 1)
			pVertices[1] = new TextureVertex(new Vector2(fMinVertexX, fMaxVertexY));

			// (1, -1)
			pVertices[2] = new TextureVertex(new Vector2(fMaxVertexX, fMinVertexY));

			// (1, 1)
			pVertices[3] = new TextureVertex(new Vector2(fMaxVertexX, fMaxVertexY));

			pEffect.GraphicsDevice.DrawUserPrimitives<TextureVertex>(
				PrimitiveType.TriangleStrip,
				pVertices, 0, 2);
		}