示例#1
0
        public EffectPass(string rasterizer, string blend, string depthStencil,
            string shader, string vertexEntryPoint, string pixelEntryPoint, 
            TechniqueTags tags, Effect effect)
        {
            if (rasterizer != "")
            {
                _hasRasterizerState = true;
                _rasterizerState = MaterialManager.RenderStates.GetRasterizerState(rasterizer);
            }

            if (blend != "")
            {
                _hasBlendState = true;
                _blendState = MaterialManager.RenderStates.GetBlendState(blend);
            }

            if (depthStencil != "")
            {
                _hasDepthStencilState = true;
                _depthStencilState = MaterialManager.RenderStates.GetDepthStencilState(depthStencil);
            }

            _tags = tags;

            _shader = new Shader(shader, tags, true, pixelEntryPoint, vertexEntryPoint);
        }
        public void AddDepthStencilState(string name, DepthStencilState state)
        {
            depthStencilLastAdded++;
            depthStencilStates[depthStencilLastAdded] = state;

            depthStencilNames.Add(name, depthStencilLastAdded);
            state.SetNameAndIndex(name, depthStencilLastAdded);
        }
示例#3
0
 public static void SetDepthStencilState(DepthStencilState state)
 {
     DeviceContext.OutputMerger.SetDepthStencilState(state.NativeDepthStencilState);
 }
 public void SetDefaultStates(string rasterizer, string blend, string depthstencil)
 {
     DefaultRasterizerState = GetRasterizerState(rasterizer);
     DefaultBlendState = GetBlendState(blend);
     DefaultDepthStencilState = GetDepthStencilState(depthstencil);
 }
 public void SetDepthStencilState(DepthStencilState state)
 {
     if (state == null)
         GraphicManager.SetDepthStencilState(DefaultDepthStencilState);
     else
         GraphicManager.SetDepthStencilState(state);
 }