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.

I am creating a model with Blender which looks like this:

enter image description here

and I am importing it into an XNA project. There seems to be some kind of transparency issue. The model looks like that:

enter image description here

When the camera looks on one side, the side is not shown. Why do I have this problem and what can I do to fix it?

PS: I am using a custom Effect but I don't think that the issue has something to do with that.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Looks like it might be a face culling issue. Try turning off face culling:

 GraphicsDevice.RasterizerState = RasterizerState.CullNone;
share|improve this answer
    
You are perfectly right. I thought it would be a DepthStencil issue but it wasn't. The model still has a small problem (I don't know why this triangle is rendered completely different) but I suppose I have to check my Blender model. Thanks –  alecnash Oct 15 '12 at 12:08
add comment

Settings the cullmode to none is only a workaround. There is a problem within Blender that causes problems during export. Maybe you can send this model to blender community? So they are able to identify this bug in their software. By the way, you should never disable backfaceculling during your whole drawings, because you loose performance. So your code should look like the following:

//store last state
var oldResterizerState = GraphicsDevice.RasterizerState;
//set rasterizer to "solve" your bug
GraphicsDevice.RasterizerState = RasterizerState.CullNone;
//draw your buggy model now
....
//reset graphicsdevice to old state
GraphicsDevice.RasterizerState = oldRasterizerState;
share|improve this answer
    
I suggested disabling culling in order to help diagnose the problem, rather than as a solution –  Ken Oct 15 '12 at 14:43
    
I know that culling is going to slow down the performance but right now I just want to play around with Blender. I'll check if its a bug or if I do something wrong –  alecnash Oct 15 '12 at 15:27
    
@Ken: I don't meant you where wrong. But I recently I saw code of a colleague that disables culling in the whole simulation without care about the consequences in order so "solve" such problems. So I wanted to give a hint –  user27811 Oct 15 '12 at 15:38
add comment

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.