public static NormalMappingNode Create()
        {
            var model = new NormalMappingModel();
            var vs    = new VertexShader(vertexCode);
            var fs    = new FragmentShader(fragmentCode);
            var array = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            map.Add("inPosition", NormalMappingModel.strPosition);
            map.Add("inTexCoord", NormalMappingModel.strTexCoord);
            map.Add("inNormal", NormalMappingModel.strNormal);
            map.Add("inTangent", NormalMappingModel.strTangent);
            var builder = new RenderMethodBuilder(array, map);
            var node    = new NormalMappingNode(model, builder);

            node.ModelSize = new vec3(2, 2, 0.1f);
            node.Initialize();

            return(node);
        }
Exemple #2
0
        public static NormalMappingNode Create(IBufferSource model, vec3 size, string position, string texCoord, string normal, string tangent)
        {
            //var model = new NormalMappingModel();
            var vs    = new VertexShader(vertexCode);
            var fs    = new FragmentShader(fragmentCode);
            var array = new ShaderArray(vs, fs);
            var map   = new AttributeMap();

            //map.Add("inPosition", NormalMappingModel.strPosition);
            //map.Add("inTexCoord", NormalMappingModel.strTexCoord);
            //map.Add("inNormal", NormalMappingModel.strNormal);
            //map.Add("inTangent", NormalMappingModel.strTangent);
            map.Add("inPosition", position);
            map.Add("inTexCoord", texCoord);
            map.Add("inNormal", normal);
            map.Add("inTangent", tangent);
            var builder = new RenderMethodBuilder(array, map);
            var node    = new NormalMappingNode(model, builder);

            node.ModelSize = size;
            node.Initialize();

            return(node);
        }