public ParallaxMappingForm()
        {
            this.font = new Font( @"Data\Fonts\Verdana.jpg" ).ApplyFont( itemsManager );
            this.texture = new Texture2D( @"Data\ParallaxMapping\Maps\rockwall.jpg" ).ApplyTexture( this.itemsManager );
            this.textureHeight = new Texture2D( @"Data\ParallaxMapping\Maps\rockwall_height.png" )
                                 {
                                 	WrapS = TextureWrapMode.ClampToEdgeSgis,
                                 	WrapT = TextureWrapMode.ClampToEdgeSgis
                                 }.ApplyTexture( this.itemsManager );
            this.textureNormal = new Texture2D( @"Data\ParallaxMapping\Maps\rockwall_normal.png" )
                                 {
                                 	WrapS = TextureWrapMode.ClampToEdgeSgis,
                                 	WrapT = TextureWrapMode.ClampToEdgeSgis
                                 }.ApplyTexture( this.itemsManager );

            this.programs = new[]
                            {
                                ShaderProgram.Create<ParallaxShaderProgram>( @"Data\ParallaxMapping\parallax.vert",
                                                                             @"Data\ParallaxMapping\parallax.frag" ).
                                    ApplyProgram( itemsManager ),
                                ShaderProgram.Create<ParallaxShaderProgram>( @"Data\ParallaxMapping\parallax.vert",
                                                                             @"Data\ParallaxMapping\parallax1.frag" ).
                                    ApplyProgram( itemsManager ),
                                ShaderProgram.Create<ParallaxShaderProgram>( @"Data\ParallaxMapping\parallax.vert",
                                                                             @"Data\ParallaxMapping\relief1.frag" ).
                                    ApplyProgram( itemsManager ),
                            };

            camera.Position.Z = 50;
        }
Example #2
0
        public Skybox( float x, float y, float z, float width, float height, float length, 
            Texture2D back, Texture2D front, Texture2D left, Texture2D right, Texture2D bottom, Texture2D top)
        {
            this.x = x;
            this.y = y;
            this.z = z;
            this.width = width;
            this.height = height;
            this.length = length;

            var w2 = width / 2;
            var h2 = height / 2;
            var l2 = length / 2;

            this.boxVertexes[0] = new BoxVertex( x - w2, y - h2, z + l2 );
            this.boxVertexes[1] = new BoxVertex( x + w2, y - h2, z + l2 );
            this.boxVertexes[2] = new BoxVertex( x - w2, y + h2, z + l2 );
            this.boxVertexes[3] = new BoxVertex( x + w2, y + h2, z + l2 );
            this.boxVertexes[4] = new BoxVertex( x - w2, y - h2, z - l2 );
            this.boxVertexes[5] = new BoxVertex( x + w2, y - h2, z - l2 );
            this.boxVertexes[6] = new BoxVertex( x - w2, y + h2, z - l2 );
            this.boxVertexes[7] = new BoxVertex( x + w2, y + h2, z - l2 );

            this.back   = back;
            this.front  = front;
            this.left   = left;
            this.right  = right;
            this.bottom = bottom;
            this.top    = top;

            foreach (var texture in new [] {back, front, left, right, bottom, top})
            {
                texture.WrapS = TextureWrapMode.ClampToEdgeSgis;
                texture.WrapT = TextureWrapMode.ClampToEdgeSgis;
            }

            Fill( 0, this.boxVertexes, this.skyboxVertices, 1, 0, 2, 3 ); // back
            Fill( 1, this.boxVertexes, this.skyboxVertices, 4, 5, 7, 6 ); // front
            Fill( 2, this.boxVertexes, this.skyboxVertices, 0, 4, 6, 2 ); // left
            Fill( 3, this.boxVertexes, this.skyboxVertices, 5, 1, 3, 7 ); // right
            Fill( 4, this.boxVertexes, this.skyboxVertices, 0, 1, 5, 4 ); // bottom
            Fill( 5, this.boxVertexes, this.skyboxVertices, 6, 7, 3, 2 ); // top
        }
Example #3
0
 public Skybox( float width, float height, float length,
     Texture2D back, Texture2D front, Texture2D left, Texture2D right, Texture2D bottom, Texture2D top)
     : this(0, 0, 0, width, height, length, back, front, left, right, bottom, top)
 {
 }
Example #4
0
 public Font( string fileName )
 {
     texture = new Texture2D( fileName );
     FontSize = 10;
 }