示例#1
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);
 }
示例#2
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);
 }
示例#3
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);
     }
 }
示例#4
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);
 }