1
\$\begingroup\$

I've got a basic textured quad forming a plane. When I move the camera or rotate the plane to see the back of it, there is no texture there.

The effect I want is as if the plane were a clear piece of glass, so that I'd be seeing the texture from through the other side. I was hoping this was going to happen automagically. Is there an easy way to accomplish such a thing, or am I going to have to manually flip the texture and assign it to the back?

Thanks!

\$\endgroup\$
4
\$\begingroup\$

By default XNA culls back-facing tris. Use a RasterizerState with the cull mode set to none.

RasterizerState stat = newRasterizerState();
stat.CullMode = CullMode.None; 
\$\endgroup\$
  • \$\begingroup\$ Thanks, I had a feeling there was a simple way! I'm new at this so it took me a few minutes to realize I had to set GraphicsDevice.RasterizerState = stat but it worked a charm! Now, I don't suppose there is any easy way to have my lighting show through the plane so that it really does seem like glass? What I mean is that the backside of my plane is not being lit in the same way as the front. \$\endgroup\$ – idlewire Jan 28 '12 at 1:10
  • \$\begingroup\$ @idlewire As a one-liner: GraphicsDevice.RasterizerState = RasterizerState.CullNone; \$\endgroup\$ – David Gouveia Jan 28 '12 at 4:28
1
\$\begingroup\$

To expand on ClassicThunder's presumably correct answer (I don't use XNA), what you are seeing is called backface culling. 3D graphics pipelines usually do this in order to reduce the number of polygons that they have to render; polygons facing away from the camera are usually on the far side of the object and thus not visible.

You can turn off backface culling, or you could duplicate your polygons (with the duplicates located in exactly the same place but with normals facing the opposite direction).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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