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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
     }
 }
Example #6
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);
 }
Example #7
0
 protected override void OnRender(RenderContext context, DeviceContextProxy deviceContext)
 {
     DefaultShaderPass.BindShader(deviceContext);
     DefaultShaderPass.BindStates(deviceContext, DefaultStateBinding);
     OnDraw(deviceContext, InstanceBuffer);
 }