Jump to content
Posted 02 April 2012 - 02:02 AM
Posted 02 April 2012 - 02:43 AM
Posted 02 April 2012 - 02:44 AM
Posted 02 April 2012 - 02:25 PM
try drawing transparent objects last. You should always draw the transparent objects last anyway so that they have something to blend with on the back buffer. if they are drawn first, they will only blend with whatever is drawn before them, which in this case, it sounds like nothing is drawn before the transparent object, so it probably doesn't appear transparent if it happens to be in front of the opaque object, since the opaque object is drawn last, hope that makes sense
Otherwise, try just adding the line "clip(diffuse.a - 0.25f);" in your pixel shader. this will "clip" or just not draw any pixels with an alpha value of less than .25.
Posted 02 April 2012 - 03:12 PM
Posted 02 April 2012 - 03:26 PM
OMSetBlendState isn't so much 'per draw call' as it is 'set until it is changed again'.
Based on what you are seeing it sounds like on the 2nd run of the rendering loop the blend state isn't being set correctly, which I personally would attribute to a bug in your code rather than any sort of DX/driver issues.
The best advice I can give is to look at the device state at each draw call in PIX to see what is going on; you'll probably want to capture a couple of frames and certainly will want to grab the first frame to see if your state is even being set correctly.
Posted 02 April 2012 - 03:36 PM
Posted 02 April 2012 - 06:15 PM
Assuming you aren't using deferred contexts then all draw calls are executed when the draw functions are called' nothing is deferred until 'later' and all state during execution would be as it is when that call is made.
Posted 02 April 2012 - 10:00 PM