Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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 ?

share|improve this question
1  
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? –  Notabene Mar 21 '11 at 23:15
    
no, not quite .. –  Badescu Alexandru Mar 21 '11 at 23:30
    
could you anyway direct me to some sources or can you tell me how to achieve only transparency ? –  Badescu Alexandru Mar 22 '11 at 8:23

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.