Ejemplo n.º 1
0
        public void SamePositionUvAttribute()
        {
            var    pos    = new VertexFloatAttribute("position", ValueCount.Three, VertexAttribPointerType.Float);
            Shader shader = CreateShader(new List <TextureRenderInfo>(), pos, pos, pos);

            Assert.IsTrue(shader.LinkStatusIsOk);
        }
Ejemplo n.º 2
0
        private static Shader CreateShader(List <TextureRenderInfo> textures, VertexFloatAttribute pos, VertexFloatAttribute nrm, VertexFloatAttribute uv0)
        {
            TextureShaderGenerator.CreateShader(textures, pos, nrm, uv0, out string vertexSource, out string fragmentSource);
            Shader shader = new Shader();

            shader.LoadShaders(vertexSource, fragmentSource);
            return(shader);
        }
Ejemplo n.º 3
0
        public void Vec4TexCoord()
        {
            // The extra components for texture coordinates and position should be ignored.
            var pos = new VertexFloatAttribute("pos", ValueCount.Four, VertexAttribPointerType.Float);
            var uv0 = new VertexFloatAttribute("uv", ValueCount.Four, VertexAttribPointerType.Float);

            Shader shader = CreateShader(new List <TextureRenderInfo>(), pos, pos, uv0);

            Assert.IsTrue(shader.LinkStatusIsOk);
        }
Ejemplo n.º 4
0
        public void SingleTextureCube()
        {
            var textures = new List <TextureRenderInfo>()
            {
                new TextureRenderInfo("tex1", UvCoord.CubeMap, TextureSwizzle.Rgb)
            };
            var pos = new VertexFloatAttribute("pos", ValueCount.Three, VertexAttribPointerType.Float);
            var uv0 = new VertexFloatAttribute("uv", ValueCount.Two, VertexAttribPointerType.Float);

            Shader shader = CreateShader(textures, pos, pos, uv0);

            Assert.IsTrue(shader.LinkStatusIsOk);
        }
        private static void CheckAttribPointerSizeTwoComponents(int expected, VertexAttribPointerType type)
        {
            VertexFloatAttribute attribInfo = new VertexFloatAttribute("", ValueCount.Two, type, false);

            Assert.AreEqual(expected, attribInfo.SizeInBytes);
        }