[vlc-devel] Direct3D Alpha Testing

Felix Abecassis felix.abecassis at gmail.com
Thu Feb 13 18:07:04 CET 2014


Hi everybody,

Does someone know why we have the following code in direct3d.c
(Direct3DCreateScene):
if (sys->d3dcaps.AlphaCmpCaps & D3DPCMPCAPS_GREATER) {
    IDirect3DDevice9_SetRenderState(d3ddev, D3DRS_ALPHATESTENABLE,TRUE);
    IDirect3DDevice9_SetRenderState(d3ddev, D3DRS_ALPHAREF, 0x00);
    IDirect3DDevice9_SetRenderState(d3ddev, D3DRS_ALPHAFUNC,D3DCMP_GREATER);
}

Related documentation entries:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb172254%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/bb172599%28v=vs.85%29.aspx(D3DRS_ALPHATESTENABLE)

With the statements above, all pixels with an alpha of 0 will be discarded.
I've found some shaders where the output alpha is set to 0 and thus using
this shader will cause the display to be all black

Any ideas?

Thanks

-- 
Félix Abecassis
http://felix.abecassis.me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140213/2929d3f4/attachment.html>


More information about the vlc-devel mailing list