render transparent and opaqueobject

Started by
5 comments, last by sunrisefe 14 years, 6 months ago
I want to render tree with leaf and branch, leaves are transparent triangles and branches are opaque. In the tree's mesh, leaves belong to attributeSet 1 while branches belong to attributeSet 2. How to render the tree correctly? I render it in the order: first render all branches then render all leaves with no sorting,but there generated picture is not right.
Advertisement
This is the wrong forum for technical questions - but you would generally draw opaque parts first (drawing near triangles first, but this is not hugely important).

You would then draw the translucent polygons from far to near (to ensure correct rendering)
Moving to Game Programming.
...and moving back to Graphics after seeing someone else moved it first! :)
I see ,thank you
Quote:but there generated picture is not right.

That's the thing you should expect when you work with realtime computer graphics. Always something won't look right. But you will usually have 2 choices - leave it or fix it, the second choice takes a lot of time (both to implement and to execute the fixed drawing code) to do so you will mostly use the first one.
Quote:Original post by WavyVirus
you would generally draw opaque parts first (drawing near triangles first, but this is not hugely important).

You would then draw the translucent polygons from far to near (to ensure correct rendering)

draw the translucent polygons from far to near, DX supply sort function or do it myself?

This topic is closed to new replies.

Advertisement