Describes blending state.
예제 #1
0
        /// <summary>
        /// Initializes a new instance of the StateFactory
        /// </summary>
        /// <param name="device"></param>
        /// <param name="ubershader"></param>
        private StateFactory(Ubershader ubershader, Type enumType, Primitive primitive, VertexInputElement[] vertexInputElements, BlendState blendState, RasterizerState rasterizerState, DepthStencilState depthStencilState)
            : base(ubershader.GraphicsDevice)
        {
            this.ubershader = ubershader;

            Enumerate(enumType, ubershader, (ps, i) => {
                ps.Primitive           = primitive;
                ps.VertexInputElements = vertexInputElements;
                ps.BlendState          = blendState;
                ps.RasterizerState     = rasterizerState;
                ps.DepthStencilState   = depthStencilState;
            });
        }
예제 #2
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="ps"></param>
		/// <param name="flag"></param>
		void EnumAction ( PipelineState ps, Flags flag )
		{
			ps.BlendState			=	BlendState.AlphaBlendPremul;
			ps.DepthStencilState	=	DepthStencilState.Readonly;
			ps.Primitive			=	Primitive.PointList;

			if (flag==Flags.DRAW_SHADOW) {

				var bs = new BlendState();
				bs.DstAlpha	=	Blend.One;
				bs.SrcAlpha	=	Blend.One;
				bs.SrcColor	=	Blend.DstColor;
				bs.DstColor	=	Blend.Zero;
				bs.AlphaOp	=	BlendOp.Add;

				ps.BlendState			=	bs;
				ps.DepthStencilState	=	DepthStencilState.Readonly;
			}
		}
예제 #3
0
 /// <summary>
 /// Creates pipeline state factory
 /// </summary>
 public StateFactory CreateFactory(Type type, Primitive primitive, VertexInputElement[] vertexInputElements, BlendState blendState, RasterizerState rasterizerState, DepthStencilState depthStencilState)
 {
     return(CreateFactory(type, (ps, i) => {
         ps.Primitive = primitive;
         ps.VertexInputElements = vertexInputElements;
         ps.BlendState = blendState;
         ps.RasterizerState = rasterizerState;
         ps.DepthStencilState = depthStencilState;
     }));
 }