Ejemplo n.º 1
0
            protected sealed override void OnRenderDepth(RenderContext context, DeviceContextProxy deviceContext,
                                                         Shaders.ShaderPass customPass)
            {
                var pass = customPass ?? materialVariables.GetDepthPass(RenderType, context);

                if (pass.IsNULL)
                {
                    return;
                }
                OnUpdatePerModelStruct();
                if (!materialVariables.UpdateMaterialStruct(deviceContext, ref modelStruct, PointLineModelStruct.SizeInBytes))
                {
                    return;
                }
                if (materialVariables.BindMaterialResources(context, deviceContext, pass))
                {
                    pass.BindShader(deviceContext);
                    pass.BindStates(deviceContext, DefaultStateBinding);
                    materialVariables.Draw(deviceContext, GeometryBuffer, InstanceBuffer.ElementCount);
                }
            }
Ejemplo n.º 2
0
            protected override void OnRenderDepth(RenderContext context, DeviceContextProxy deviceContext, ShaderPass customPass)
            {
                var pass = customPass ?? materialVariables.GetDepthPass(RenderType, context);

                if (pass.IsNULL)
                {
                    return;
                }
                var v = new SimpleMeshStruct()
                {
                    World        = ModelMatrix,
                    HasInstances = InstanceBuffer.HasElements ? 1 : 0
                };

                if (!materialVariables.UpdateNonMaterialStruct(deviceContext, ref v))
                {
                    return;
                }
                pass.BindShader(deviceContext);
                pass.BindStates(deviceContext, ShadowStateBinding);
                materialVariables.Draw(deviceContext, GeometryBuffer, InstanceBuffer.ElementCount);
            }