Esempio n. 1
0
        public CombineRenderTask(RenderTarget destination, RenderTarget albedo, RenderTarget light)
        {
            this.Destination = destination;
            this.albedo      = albedo;
            this.light       = light;
            vsCombine        = Renderer.ShaderLoader.LoadVertexShader("assets/shader/deferredCombine.hlsl", "VSMain");
            psCombine        = Renderer.ShaderLoader.LoadPixelShader("assets/shader/deferredCombine.hlsl", "PSMain");

            var sampler = Renderer.Instance.CreateSamplerState(TextureAddressMode.Wrap, Filter.MinMagMipPoint);

            parameterCollection.SetParameter("Sampler", sampler);
        }
Esempio n. 2
0
        public SimpleRenderTask(RenderTargetGroup rt)
        {
            renderTarget = rt;

            vShader = Renderer.Instance.Shaders.LoadVertexShader("assets/shader/simple.hlsl", "VSMain");
            pShader = Renderer.Instance.Shaders.LoadPixelShader("assets/shader/simple.hlsl", "PSMain");

            var rasterizerStateDescription = RasterizerStateDescription.Default();

            rasterizerStateDescription.CullMode = CullMode.Back;
            rasterizerState = new RasterizerState(Renderer.Dev, rasterizerStateDescription);
        }
Esempio n. 3
0
        public LightRenderTask(RenderTarget lightTarget, RenderTarget normalTarget, RenderTarget positionTarget)
        {
            this.lightTarget    = lightTarget;
            this.normalTarget   = normalTarget;
            this.positionTarget = positionTarget;
            vsDirectional       = Renderer.Instance.Shaders.LoadVertexShader("assets/shader/directionalLight.hlsl", "VSMain");
            psDirectional       = Renderer.Instance.Shaders.LoadPixelShader("assets/shader/directionalLight.hlsl", "PSMain");

            parameterCollection.SetParameter("lightDir", new Vector3(0.0f, -1.0f, -1.0f));
            parameterCollection.SetParameter("lightColor", new Color3(1.0f, 1.0f, 1.0f));
            parameterCollection.SetParameter("ambientColor", new Color3(0.2f, 0.2f, 0.2f));
            parameterCollection.SetParameter("NormalTextureInput", normalTarget);
            parameterCollection.SetParameter("PositionTextureInput", positionTarget);
        }
Esempio n. 4
0
 public ClearRenderTask(RenderTargetGroup renderTargets)
 {
     this.renderTargets = renderTargets;
     vsClear            = Renderer.ShaderLoader.LoadVertexShader("assets/shader/deferredCleanup.hlsl", "VSMain");
     psClear            = Renderer.ShaderLoader.LoadPixelShader("assets/shader/deferredCleanup.hlsl", "PSMain");
 }