Back-face culling culls front faces

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Back-face culling culls front faces

Postby Christian Walther » Sun Jun 15, 2008 4:48 am

I'm dabbling around with Blender and PyPRP, trying to apply my usual trial-and-error learning style to it (with varying success). Now I've hit a problem that trial and error hasn't gotten me over: What's wrong with a mesh when back-face culling in Uru culls its front faces, and how do I fix it?

I've been partially following the Getting Started With Writing tutorial and arrived at what the top of this image shows:

frontfaceculling.jpeg
frontfaceculling.jpeg (42.49 KiB) Viewed 2476 times


Obviously the wrong faces are visible on the terrain here, but the lighting is right. This is with normals pointing outward. When I change the normals to point inward in Blender (Mesh > Normals > Recalculate Inside), I get the bottom half of the image: now the correct parts of the mesh are visible, but the lighting is backward: the ceiling of the tunnel is light, when it should be dark, and the rest of the surface appears very flat because it's facing away from the light source.

This seems to be an object-specific property, as the white rounded cube on which I'm standing seems to be lit and back-face-culled properly with outward-pointing normals. The terrain object was made from a single quad ("plane" I think Blender calls it) that was treated with a lot of subdivision, extrusion, and deletion and addition of edges and faces.

Does anyone of the Blender experts have a clue what's going on here?
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Back-face culling culls front faces

Postby Trylon » Sun Jun 15, 2008 2:30 pm

Hmm, I'm at a loss here at the moment.... you discovered a very interesting problem....

Better make sure that it's not a local issue on your computer//graphics card only - can you check whether the age gives the same effect on other computers?
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru

Re: Back-face culling culls front faces

Postby Robert The Rebuilder » Sun Jun 15, 2008 7:11 pm

Check the transform of your terrain mesh (hit the 'N' key) to see if you have negative scale values. If they are negative, make them positive or apply the transform to the vertices (using ctrl-A).
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Re: Back-face culling culls front faces

Postby Aloys » Mon Jun 16, 2008 6:50 am

I think Robert is right, I've seen that problem before. I hadn't seen in a while so I had assumed it had been fixed, but it might be just that I got more carefull with my meshes..
It's an important rule for Age to never scale an object as a whole, rather scale all its faces in edit mode. Changes in scale lead to many problems like this one.
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: Back-face culling culls front faces

Postby Christian Walther » Mon Jun 16, 2008 9:33 am

Thanks Robert, and Aloys, that was exactly the problem - as I discovered late last night after it occurred to me to google for "blender winding". I indeed had a negative scaling factor on all three axes, and Object > Clear/Apply > Apply Scale/Rotation to ObData fixed it. That must have come from the very beginning when I scaled the initial quad to its required size.

Trylon, that was the first thing I suspected when it looked that way in Parallels, whose D3D support is just enough to run Uru more or less playably, even though not quite graphically faithful, but then it looked exactly the same on my PC (from which the posted screenshots come).

Now let's see if I can figure out the answers to my next questions on my own... :)
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland


Return to Building

Who is online

Users browsing this forum: No registered users and 3 guests

cron