Skip to main content
GameDev.net gamedev.net
🔒 Locked

Opacity?

Started by mlt Dec 20, 2008 at 1:55 PM 1 replies 750+ views
Original Post
mlt
mlt
I have made a 2D plane mesh that I shade with per-pixel shading in my fragment program. I wuld like the plane to be transparent but now matter how I set the alpha channel nothing happens (it looks completely solid):

color.rgb = float3(lighting.y * diffuseMaterial + lighting.z * specularMaterial);
color.a = 0.1;

swiftcoder
swiftcoder
You need to enable alpha blending and set the blending function before rendering, otherwise alpha values are ignored.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
gogogigo
gogogigo
Check your rendersettings:
for example
AlphaBlendEnable = true;
BlendOp = Add;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;

Did you first render your background and THEN the plane?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.