I need some help rendering this model right. It`s a palm tree, made of a single mesh.

I am using BlendState.AlphaBlend before drawing it, but it looks wrong. I know that transparent models should be ordered and all, but since all the leaves are on a single mesh, how can i render it correctly? Here is a short video, so you can see for yourself.

You could use a modeling tool to split up the leaves into separate pieces that you can then sort (this may not fix the problem 100%). You could use alpha-test as Brac suggested (indeed this is how many, many games draw vegetation). If you're comfortable with shaders, rendertargets and so forth, you could also explore more advanced techniques such as depth peeling or the newer stochastic transparency.

ayrton2388
—
2011-05-19T18:37:14Z —
#4

Thank you for the replies.

Isn`t order independent transparency a bit expensive? Anyway, might be a bit out of my league. I did write some basic shaders, but still pretty new to them.

That will help somewhat. The sorting will definitely be correct in the opaque areas, but it will still be wrong in the translucent areas. But if the translucent areas are only a thin fringe around the edges of the leaves, it might not be very noticable.

It will also help performance (probably). The two-pass method is likely to be faster than rendering everything transparently because on the second pass, you'll be getting early-Z-culling from the depth laid down in the first pass. YMMV though.

As for the order-independent techniques, yes they will be more expensive on the GPU. They can still be useful for cases where correctness is a must and per-object or per-poly sorting isn't going to cut it, or is prohibitively expensive. But it's just one more tool in the toolbox.

ayrton2388
—
2011-05-19T19:12:25Z —
#6

Thank you. I really appreciate your help, guys. Thanks a lot!

It`s not hard to write that shader, i can do it, but i cant texture these tree models right in my custom shader yet, since they have 2-3 textures, and there`s just 1 mesh. But at least i know im going in a right direction.