1
\$\begingroup\$

How can i achieve transparency and shadowing for a model in XNA ? Do you have a good tutorial ?

For the shadow i can manage the effect but how can i implement the transparency also ? Do i have to use the pass in effects ? And if so, how can i make an object transparent ?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Shadows for transparent objects are pretty hard to archive, however possible with depth peeling (for example) and RGB shadow maps. Are you familiar with regular shadow mapping? \$\endgroup\$
    – Notabene
    Mar 21, 2011 at 23:15
  • \$\begingroup\$ no, not quite .. \$\endgroup\$
    – Alex
    Mar 21, 2011 at 23:30
  • \$\begingroup\$ could you anyway direct me to some sources or can you tell me how to achieve only transparency ? \$\endgroup\$
    – Alex
    Mar 22, 2011 at 8:23

1 Answer 1

2
\$\begingroup\$

For transparenty objects you have to define alpha to you color or texture and enable alpha blending in you render state: link to msdn

Transparent objects have to be always rendered after opaque scene. If you have only one object, than you dont have problem.

If you have more objects, than there is problem to solve. Alpha blending is not comutative, so objects have to be sorted in a distance from actual camera position. Order independent methods exists. Original Depth peeling or dual depth peeling is mostly use on HW without sm5 (shader model 5 - dx11).

Shadows for transparent object are really not trivial task. First study shadow mapping. And once you be solid rock in it, than start investigate transparent shadows (take it only as recomandation). Wikipedia has surprisingly good article about it. Riemer's XNA tutorial series contaons also very good shadow map tutorial.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .