float4 PS() : COLOR
{
float Aintensity = 0.8f;
float4 Acolor = float4(1.0f, 0.075f, 0.075f, 0.5f);
return Aintensity * Acolor;
}
PS show the pixel' transparency is equal to half
PS show the pixel' transparency is equal to half(0.5f)
Why can I see the piexel has transparency(0.5f)?
Do I lose define some variable in effect file?
//Programminbg Vertex and Pixel Shaders\Chapter 4 - Ambient
Can you be a bit clearer? I don't really understand your question unfortunately.
For debugging you can do something like:
To see which pixels are equal to 0.5f...
hth
Jack
For debugging you can do something like:
if(a - 0.5f <= 1e-5f) return COLOUR_IF_EQUAL_HERE;else return COLOUR_IF_NOT_EQUAL_HERE;
To see which pixels are equal to 0.5f...
hth
Jack
Use the following to enable alpha blending.
device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
Quote:Original post by ET3D
Use the following to enable alpha blending.
device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
Thank you. But how to write the three lines in shader file?
I had seen the syntax, but now I forgot where they are.
Could somone tell me how to write the three line in shader file and the place describe the syntax in MDSN?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement