Archived

This topic is now archived and is closed to further replies.

A little alpha blending problem

This topic is 5745 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

History as follows: I have a pyramid. And then a big rectangle (with a texture) as a background. Background is zero alpha. Took a while to figure out it (the bg) should be painted first anyway, when the pyramid rotates in front of this background it looks good. but. when the top is towards me, i can see the pyramids bottom, but when the bottom is towards me, i _can''t_ see it''s top. irritating isn''t it. anyhow, it must be something about the bottom being drawn first, so the bottom shines through, but when the bottom is painted, there is nothing but the background to determine the final color (top not drawn). anyone knows the solution? Or what the problem really is? one more question: when doing alpa blening with textures; the color part of the D3DFVF_DIFFUSE isn''t really used huh? thanks plenty. zilch_

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think it´s a Back Face culling problem. Try doing this before render:

pDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);

Petrus

Share this post


Link to post
Share on other sites
No
actually
the culling is already set to none,

And the Z-Buffer is OFF,
otherise the texture (background) wouldnt have been painted through the pyramide...

a thing to note is that if i change the normals on the bottom of the pyramid, it shows through when looking at the top. but then the bottom is all screwed up, probably becuae it is not getting any light.

zilch_

Share this post


Link to post
Share on other sites
Is it correct to set the Z-Buffer to NONE?
I have read that it is. And I think it is logical. As you wouldn''t see anmything through the objects as they were not painted.

zilch_

Share this post


Link to post
Share on other sites
its not logical,
no zbuffer means order of the polygons drawn is VERY important. such that you MUST draw front to back, have NO intersecting polys (since if they intersect it is sometimes difficult to decide the draw order), and naturally overall trust that you can do this faster then without using the zbuffer. vertices should be ordered clockwise (or counter-clockewise depeding on how you set culling). translucent polys are drawn last. alpha blending IS affected by the diffuse color as long as it contains an alpha value and your card supports it. i have used 32bit textures and blending things using only the diffuse color for alpha blending, as well as when the texture already has alpha values.

[edited by - a person on March 22, 2002 4:46:44 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by a person
alpha blending IS affected by the diffuse color as long as it contains an alpha value and your card supports it.

This is really picky, but that sentence should probably have ''and you''ve set your texture stages to use it''.

If you set things up to only read the texture for alpha, it will ignore the alpha component of your diffuse colour no matter what values you have. You can also set it to only use the diffuse''s alpha, or both in a variety of ways.

Since newbies are reading this I though I''d point that out.



Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites