Jump to content

  • Log In with Google      Sign In   
  • Create Account

YashwinderSingh

Member Since 10 May 2012
Offline Last Active Sep 23 2014 01:57 AM

Posts I've Made

In Topic: How to set Alpha value from pixel shader in SlimDX Direct3d9

10 September 2014 - 07:41 AM

It looks like the posted code isn't setting any of the alpha blend states, and I think the default is to not blend.

I have tried using all these below stated rendering states before assigning the pixel shader to the device and in the render loop per frame also but even then there is no effect on the alpha value

 

  _device.SetRenderState(RenderState.AlphaBlendEnable, true);
            _device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
            _device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
            _device.SetTextureStageState(0, TextureStage.ColorOperation, TextureOperation.Modulate);
            _device.SetTextureStageState(0, TextureStage.ColorArg1, TextureArgument.Texture);
            _device.SetTextureStageState(0, TextureStage.ColorArg2, TextureArgument.TFactor);

Can any one please tell whats the proper method of setting alpha value for the texture to change its transperancy. 


In Topic: How to set Alpha value from pixel shader in SlimDX Direct3d9

08 September 2014 - 01:59 AM

I have tried using all these below stated rendering states before assigning the pixel shader to the device and in the render loop per frame also but even then there is no effect on the alpha value

 

            _device.SetRenderState(RenderState.AlphaBlendEnable, true);
            _device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
            _device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
            _device.SetTextureStageState(0, TextureStage.ColorOperation, TextureOperation.Modulate);
            _device.SetTextureStageState(0, TextureStage.ColorArg1, TextureArgument.Texture);
            _device.SetTextureStageState(0, TextureStage.ColorArg2, TextureArgument.TFactor);

Can any one please tell whats the proper method of setting alpha value for the texture to change its transperancy. 


In Topic: How to set Alpha value from pixel shader in SlimDX Direct3d9

01 September 2014 - 02:31 AM

Can you post the actual section of code where you get  the exception, including which line results in the exception?

I have created a sample code for the same problem I was facing to set alpha and have given the complete code above


PARTNERS