protected override void OnRender(RenderContext context, DeviceContextProxy deviceContext)
 {
     modelCB.Upload(deviceContext, ref modelStruct);
     DefaultShaderPass.BindShader(deviceContext);
     DefaultShaderPass.BindStates(deviceContext, DefaultStateBinding);
     DrawIndexed(deviceContext, GeometryBuffer.IndexBuffer, InstanceBuffer);
 }
Ejemplo n.º 2
0
 protected override void OnRender(IRenderContext context, DeviceContextProxy deviceContext)
 {
     DefaultShaderPass.BindShader(deviceContext);
     DefaultShaderPass.BindStates(deviceContext, StateType.BlendState | StateType.DepthStencilState);
     BindBillboardTexture(deviceContext, DefaultShaderPass.GetShader(ShaderStage.Pixel));
     OnDraw(deviceContext, InstanceBuffer);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Called when [render].
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="deviceContext">The device context.</param>
 protected override void OnRender(IRenderContext context, DeviceContextProxy deviceContext)
 {
     DefaultShaderPass.BindShader(deviceContext);
     DefaultShaderPass.BindStates(deviceContext, StateType.BlendState | StateType.DepthStencilState);
     DefaultShaderPass.GetShader(ShaderStage.Pixel).BindTexture(deviceContext, cubeTextureSlot, cubeTextureRes);
     DefaultShaderPass.GetShader(ShaderStage.Pixel).BindSampler(deviceContext, textureSamplerSlot, textureSampler);
     deviceContext.DeviceContext.Draw(GeometryBuffer.VertexBuffer[0].ElementCount, 0);
 }
 /// <summary>
 /// Called when [render].
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="deviceContext">The device context.</param>
 protected override void OnRender(RenderContext context, DeviceContextProxy deviceContext)
 {
     if (context.Camera.CreateLeftHandSystem && RasterDescription.IsFrontCounterClockwise)
     {
         var desc = RasterDescription;
         desc.IsFrontCounterClockwise = false;
         RasterDescription            = desc;
         InvalidateRenderer();
         return;
     }
     DefaultShaderPass.BindShader(deviceContext);
     DefaultShaderPass.BindStates(deviceContext, StateType.BlendState | StateType.DepthStencilState);
     DefaultShaderPass.PixelShader.BindTexture(deviceContext, cubeTextureSlot, cubeTextureRes);
     DefaultShaderPass.PixelShader.BindSampler(deviceContext, textureSamplerSlot, textureSampler);
     deviceContext.Draw(GeometryBuffer.VertexBuffer[0].ElementCount, 0);
 }
Ejemplo n.º 5
0
 protected override void OnRender(IRenderContext context, DeviceContextProxy deviceContext)
 {
     DefaultShaderPass.BindShader(deviceContext);
     DefaultShaderPass.BindStates(deviceContext, StateType.BlendState | StateType.DepthStencilState);
     if (!BindMaterialTextures(deviceContext, DefaultShaderPass))
     {
         return;
     }
     if (context.RenderHost.IsShadowMapEnabled)
     {
         DefaultShaderPass.GetShader(ShaderStage.Pixel).BindTexture(deviceContext, shadowMapSlot, context.SharedResource.ShadowView);
     }
     OnDraw(deviceContext, InstanceBuffer);
     if (RenderWireframe && WireframePass != NullShaderPass.NullPass)
     {
         WireframePass.BindShader(deviceContext, false);
         WireframePass.BindStates(deviceContext, StateType.BlendState | StateType.DepthStencilState);
         deviceContext.SetRasterState(RasterStateWireframe);
         OnDraw(deviceContext, InstanceBuffer);
     }
 }
Ejemplo n.º 6
0
 protected override void OnRender(RenderContext context, DeviceContextProxy deviceContext)
 {
     DefaultShaderPass.GetShader(ShaderStage.Pixel).BindSampler(deviceContext, ColorTextureSamplerSlot, colorTextureSampler);
     DefaultShaderPass.GetShader(ShaderStage.Pixel).BindTexture(deviceContext, ColorTextureSlot, colorGradientResource);
     base.OnRender(context, deviceContext);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Called when [render].
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="deviceContext">The device context.</param>
 protected override void OnRender(IRenderContext context, DeviceContextProxy deviceContext)
 {
     DefaultShaderPass.BindShader(deviceContext);
     DefaultShaderPass.BindStates(deviceContext, StateType.BlendState | StateType.DepthStencilState);
     OnDraw(deviceContext, InstanceBuffer);
 }
Ejemplo n.º 8
0
 protected override void OnRender(RenderContext context, DeviceContextProxy deviceContext)
 {
     DefaultShaderPass.BindShader(deviceContext);
     DefaultShaderPass.BindStates(deviceContext, DefaultStateBinding);
     OnDraw(deviceContext, InstanceBuffer);
 }