How to make flat faces/sharp edges?

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!

How to make flat faces/sharp edges?

Postby Christian Walther » Tue Jun 17, 2008 9:40 am

OK, here's the next Blender/PyPRP newbie question! :) I suspect this one can be answered by the experts faster than I can figure out the answer on my own:

Meshes exported from Blender always seem to be smoothly shaded in Uru (single, averaged normal for all faces meeting at a vertex). What if I want to have flat faces and sharp edges (separate vertex normals for each face)? For Blender's own renderer, I have found that I can adjust that by marking faces as "smooth" or "solid", using "Auto Smooth", or marking edges as "sharp" and using an "EdgeSplit" modifier. See the left (smooth) and middle (solid) cubes in the top image:

cubes.jpeg
cubes.jpeg (15.23 KiB) Viewed 4598 times

In Uru however, both of these cubes appear smooth, as seen in the bottom image. What I'm aiming for is the look of the right cube, which isn't actually a cube, but just six disconnected quads. Is there a way to achieve this while keeping the mesh connected in Blender, to keep editing it a bit easier?

To cut the right cube, I used the EdgeSplit modifier and "applied" it. Interestingly, its documentation says "The output of the EdgeSplit modifier is available to export scripts, making it quite useful for creators of game content." That seems to suggest that things should also work with the modifier "unapplied", so that the cutting would only happen at export time, while leaving the Blender file unmodified. My experience however is that the modifier has no effect at all on the result in Uru. Am I misunderstanding this, or is PyPRP just not making use of that capability?
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: How to make flat faces/sharp edges?

Postby Jojon » Tue Jun 17, 2008 12:37 pm

I wouldn't be surprised if they are looking into it now, after reading your post. :)

*pats his poor butchered meshes "sooo-soo little ones, don't be sad - those nice mister developer gentlemen will make everything allright, I'm sure."*

:7
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: How to make flat faces/sharp edges?

Postby Christian Walther » Tue Jun 17, 2008 1:31 pm

It wasn't my intention to point out anything that needs to be looked into... (Though if I did, all the better. I might even start looking into it myself.) I was just asking a question about what seemed a pretty basic aspect of age building to me... :)

So am I understanding you correctly that you have the same question and haven't found an answer to it yet?
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: How to make flat faces/sharp edges?

Postby Trylon » Tue Jun 17, 2008 2:01 pm

Interestingly, the effect you desire was actually the default way of operation before the GoW 1.0.0 PyPRP version.
We included an optimization loop that checks if vertices that are added are already there or not...

EDIT: Ehm wait a few seconds - we did use vertex normals however, so lighting could be the same in both situations.
Ah well, the easy (and most beautiful) way to implement what you want is to disable the optimization routine, and to use the face normal value and write it to the vertex normals.
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: How to make flat faces/sharp edges?

Postby Christian Walther » Tue Jun 17, 2008 9:59 pm

Heh, this is interesting. Here I come, as a complete newbie, and I'm already suggesting new features, without even knowing it. :D

Just to be clear, I (usually) don't want this effect on a whole mesh, just on selected edges. Would your solution accomplish that, Trylon?

In fact, in terms of PRP output (or at least of visual output in Uru), what I want is exactly what I can already get by applying the EdgeSplit modifier. The only thing is that I would prefer not having to apply it, but keeping it present as a modifier.

I wonder how hard it is to learn the Blender Python API. I might look into this modifier-output-available-to-export-scripts thing myself. I've always wanted to learn more about PRP and Plasma anyway.

Just out of curiosity - I haven't tried this yet - does the same thing happen with other modifiers? E.g. when I have a subdivision modifier (and don't apply it), does PyPRP export the original coarse mesh, not the subdivided one?
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: How to make flat faces/sharp edges?

Postby D'Lanor » Tue Jun 17, 2008 11:57 pm

Christian Walther wrote:The only thing is that I would prefer not having to apply it, but keeping it present as a modifier.

When this came up before we were told that only applied modifiers are recognized by PyPRP. Which I can completely understand. I do not even want to think about the extra programming required to apply modifiers during export.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: How to make flat faces/sharp edges?

Postby Grogyan » Tue Jun 17, 2008 11:59 pm

As you know Christian i'm attempting to write my own script using the Blender API, but while the API is fairly straight forward, learning and knowing python is problematic
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: How to make flat faces/sharp edges?

Postby Christian Walther » Wed Jun 18, 2008 12:17 pm

D'Lanor wrote:When this came up before we were told that only applied modifiers are recognized by PyPRP.

Can you point me to where this came up before (if it was in a public place)? There might be something to learn for me there.

D'Lanor wrote:I do not even want to think about the extra programming required to apply modifiers during export.

Well, the bit I quoted from the EdgeSplit documentation made it sound like it would be easy, or even automatic. You're getting me more and more interested in checking this out myself.

Grogyan wrote:while the API is fairly straight forward, learning and knowing python is problematic

Really? I'm pretty fluent in Python, so that isn't a problem in my case - but even if I wasn't, I'd expect that to be the least obstacle. My experience is that learning new languages is fairly easy, it's the APIs that take more time. :geek:
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: How to make flat faces/sharp edges?

Postby D'Lanor » Wed Jun 18, 2008 12:27 pm

Christian Walther wrote:Can you point me to where this came up before (if it was in a public place)? There might be something to learn for me there.

Not that much was said but here is the topic.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: How to make flat faces/sharp edges?

Postby Christian Walther » Wed Jun 18, 2008 12:37 pm

Thanks! I happened on that topic when I searched for "modifier" after your comment, but I wasn't sure if that was what you were referring to.
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 0 guests