/// <summary> /// Resets each of the render properties to their default values. /// </summary> public void ResetToDefaults() { // Clone the states instead of just setting to them directly so that they are not read-only and we can change their properties. this.BlendState = DPSFHelper.CloneBlendState(BlendState.AlphaBlend); this.DepthStencilState = DPSFHelper.CloneDepthStencilState(DepthStencilState.DepthRead); this.RasterizerState = DPSFHelper.CloneRasterizerState(RasterizerState.CullCounterClockwise); this.SamplerState = DPSFHelper.CloneSamplerState(SamplerState.LinearClamp); }
/// <summary> /// Function to setup the Render Properties (i.e. BlendState, DepthStencilState, RasterizerState, and SamplerState) /// which will be applied to the Graphics Device before drawing the Particle System's Particles. /// <para>This function is called when initializing the particle system.</para> /// </summary> protected override void InitializeRenderProperties() { // Use the NonPremultiplied BlendState by default for Sprite particles so that transparency is drawn. RenderProperties.BlendState = DPSFHelper.CloneBlendState(BlendState.NonPremultiplied); }