Esempio n. 1
0
        public void Invoke(List <V> vertexData, Rasterizer <F> rasterizer, FragmentStage <F> fragmentStage)
        {
            List <F> outData = new List <F>();

            foreach (var data in vertexData)
            {
                outData.Add(VertexShader.Invoke(data));
            }

            rasterizer.Invoke(outData, fragmentStage);
        }
Esempio n. 2
0
        public ShaderProgram(Func <V, F> vertexShader, Func <F, Vector4> fragmentShader)
        {
            _vertexStage = new VertexStage <V, F> {
                VertexShader = vertexShader
            };

            _rasterizer = new Rasterizer <F>();

            _fragmentStage = new FragmentStage <F> {
                FragmentShader = fragmentShader
            };
        }