Content

Post new topic Reply to topic

Fin/edge/quad extrusion to create outlines

Author Message
N-J ZEQ2 Legend View user's profile Send private message

Reply with quote Monday, April 30, 2007

I thought I'd shed some light about the technical part of the outline technique. The general idea on it self is not that hard to understand. It comes down to having your model and having a special edge model of that model...



Now as you can see the edge model overlays the original model, having it like this obviously won't do the job. Since we don't want all edges extruded, (only the silhouette edges) we do a test.

So what we need to look for is a silhouette edge. If the test is positive, we extrude that edge. If not we don't. Pretty simple, no? The actual test consists of checking an edge and the two triangles it shares. If triangle #1 is facing the camera and triangle #2 is facing the other side we're dealing with a silhouette edge thus we extrude it.



Which on our previous example will give something like this...



Now you can extend this technique to even handle ridges and valleys (creases) on the model, which means you can specify when an edge should be extruded by giving the angle between the two triangles as a parameter and have actual on model outlines like this...



Since this method consists of actual polygons when extruded, you can also pretty much put a texture on it and get very diverse and stylistic results.

Lastly something about performance and futuristic plans. The method is pretty fast -- if used right. The actual "is this an edge or not" test is done on the CPU and if it is indeed an edge it's sent to the GPU for extrusion.

Now as you would have probably guessed the total amount of edges on the model translates directly in the amount of iterations to find an edge; which means the more edges, the more the performance hit. With the new geometry shader in DX10 cards, it is possible to do that test on the GPU and offload the CPU completely from any work related to this method. That is far future talk, however.

Slipstream Catching On View user's profile Send private message

Reply with quote Wednesday, May 30, 2007

Fascinating. So the engine is basically performing edits upon the models based upon the camera angle ever second . . . that's pretty fricking awesome. I can also kinda see why you would need to get rid of texture maps with this technique. Thanks for sharing Very Happy

EDIT: Wow, I didn't even bother checking the date on this. I'm surprised no one else has responded =O

Super Snake Sugar & Cocaine View user's profile Send private message

Reply with quote Wednesday, May 30, 2007

Slipstream wrote : Fascinating. So the engine is basically performing edits upon the models based upon the camera angle ever second . . . that's pretty fricking awesome. I can also kinda see why you would need to get rid of texture maps with this technique. Thanks for sharing Very Happy

EDIT: Wow, I didn't even bother checking the date on this. I'm surprised no one else has responded =O



No one responded because we don't know what to say. Well, I know I don't. It all sounds intressting.. But I don't have any clue what he just said Razz
I get the basic idea. But I'm not really into this stuff. So I don't really get the technical part. >_<

Alex ZEQ2 Effects Programmer View user's profile Send private message

Reply with quote Wednesday, May 30, 2007

I was planning on reply, but ended up just talking about it in IRC, oops.

Anyway, if anyone wants to know more about this technique, go have a look at the gamedev.net article here: http://www.gamedev.net/reference/articles/article2334.asp

shadowcast View user's profile Send private message

Reply with quote Saturday, September 15, 2007

Hmm this technique though seems to have a problem Embarassed
since...in some angles it doesn't really outline the model,
I could be wrong...care to elaborate this to me?

but as I understood the engine is supposed to calculate what edge needs to be extruded....

Forza View user's profile Send private message

Reply with quote Saturday, September 15, 2007

shadowcast wrote : Hmm this technique though seems to have a problem Embarassed
since...in some angles it doesn't really outline the model,
I could be wrong...care to elaborate this to me?

but as I understood the engine is supposed to calculate what edge needs to be extruded....



It does outline the model from every angle. At every moment in time a check is done to see whether an edge is a silhouette edge or not. When you change your angle the computer automatically detects which edges should be extruded. This happens in real time, so the player will not notice anything.

It seems to be a really simple technique. My knowledge on other outlining techniques is zero, so I don't know what's the best technique.

N-J ZEQ2 Legend View user's profile Send private message

Reply with quote Saturday, September 15, 2007

shadowcast wrote : Hmm this technique though seems to have a problem Embarassed
since...in some angles it doesn't really outline the model,
I could be wrong...care to elaborate this to me?

but as I understood the engine is supposed to calculate what edge needs to be extruded....



Those examples aren't really the work of the technique, they were hand made examples I made to clarify the situation better. The actual technique extrudes the edges according to the angle you're looking at the model from.

Tom ZEQ2 Programmer View user's profile Send private message

Reply with quote Saturday, September 15, 2007

Forza wrote :
It seems to be a really simple technique. My knowledge on other outlining techniques is zero, so I don't know what's the best technique.


Hah.. It wasn't that easy to get right, that's for sure Razz Took us (NJ, Zeth and I) awhile, as we had a few bugs.

shadowcast View user's profile Send private message

Reply with quote Sunday, September 16, 2007

But...this technique requires superb flow now...since every line needs to be in order...better yet...it mustn't be broken, hmmmm (I'm talking about models)
Can I ask...what are the other outlining techniques...and im not complaining with this one...since it looks as though it doesn't require Pixel shaders, what brings me to another question...will the shading need pixel shaders??

My Opsesivness with shaders is that my card is GF4 MX *rolling on floor laughing*..

P.S. sorry for the possible spelling mistakes...I'm from Croatia...I try my best XD

Tom ZEQ2 Programmer View user's profile Send private message

Reply with quote Sunday, September 16, 2007

You're correct. This technique doesn't require pixel shaders Smile (either than to output the color of the edge) The fin mesh is actually pre-calculated in engine, as long as you know how to calculate it, it shouldn't be out of place or broken anywhere.
Other options for silhouettes/contours are calculating the normals of the model, extending them a bit and then flipping the normal, so it appears black. I believe that's how you do it anyway. The downside to this is, all the outlines are exactly the same length and you can't get things like "stylized lines".
Another way to produce edges is an image space approach, but it's pretty slow (as are most image space shaders).
As for the shading, do you mean cel-shading? Yes, it requires a pixel shader, however all the calculations can be done in the vertex shader if you want.

shadowcast View user's profile Send private message

Reply with quote Sunday, September 16, 2007

F*** my card doesn't have that either...though...Ultimate spiderman uses some shading technique which my card can handle not fully...but it can still handle it....I have shading but no outline XD..

Back to the outlines...hmmm sounds great
Looks as though you have a heck of a lot of trix..Nice to hear that...seems as though low end computers will run this game heheh.....I mean with all these workarounds...
LOD, the non texture models....these outlines...glad atleast someone thinks of us people who own buckets not computers XD

N-J ZEQ2 Legend View user's profile Send private message

Reply with quote Sunday, September 16, 2007

Your card doesn't indeed have shader support. I believe the engine will then pick a spherical cel shading technique for you which is used for the lowest of lowest cards. And for outlines you'll have to settle with the wireframe technique.

shadowcast View user's profile Send private message

Reply with quote Sunday, September 16, 2007

wait..why can't I use the silouete trick...
Ahhh....well will it look like anything good?

bleh with those models...even normal shaded they will look good..but I remember zeth saying something about Geforce 4 MX being able to run it somewhat XD

N-J ZEQ2 Legend View user's profile Send private message

Reply with quote Sunday, September 16, 2007

shadowcast wrote : wait..why can't I use the silouete trick...
Ahhh....well will it look like anything good?

bleh with those models...even normal shaded they will look good..but I remember zeth saying something about Geforce 4 MX being able to run it somewhat XD



Because this technique is using a vertex shader, and as far as I know your card doesn't support vertex shaders nor pixel shaders.

Zeth ZEQ2 Programmer View user's profile Send private message

Reply with quote Sunday, September 16, 2007

As N-J and Tom mentioned, with your card you'll have to settle with spherical environment mapping for "fake" cel-lighting. It will look purely natural, but it won't respond and reflect actual light positions.

Your options are a bit more broad on outlines, but you won't really be able to get ridge/valley outline support. You'll be limited to wireframe outlines, environment map outlines (stylistic but shape limited), or some form of vertex-extrusion double pass outlines thats done probably by pre-calculation of the extruded, normal-flipped mesh.

shadowcast View user's profile Send private message

Reply with quote Sunday, September 16, 2007

If it looks ok...im fine with it...hehe gfx don't matter that much...make the gameplay rock and im happy..

but one thing...how does wireframe outlines really work....im interested XD

Zeth ZEQ2 Programmer View user's profile Send private message

Reply with quote Sunday, September 16, 2007

http://zeq2.com/site/viewtopic.php?t=61

It works by rendering the model first in wireframe mode. Then you simply do another pass with regular rendering on top of that. Since the first wireframe pass will have drawn outside the boundaries of the original silhouette, you'll have outlines. Any engine that can support wireframe rendering (which is most) can do this technique. Be warned that only OpenGL-based APIs can actually control the line width.

shadowcast View user's profile Send private message

Reply with quote Wednesday, September 19, 2007

Hehe...my question is...how do you plan on dealing with attacks, smoke, hit sparks etc..with sprites or 3d models..???

Alex ZEQ2 Effects Programmer View user's profile Send private message

Reply with quote Thursday, September 20, 2007

If 3D models look right for the effect, then 3D models, if sprites look right for the effect then sprites.

MDave ZEQ2 Ninja View user's profile Send private message

Reply with quote Thursday, September 20, 2007

Alex wrote : If 3D models look right for the effect, then 3D models, if sprites look right for the effect then sprites.



And sometimes a combination of both Smile

Punio4 Somewhat Nifty View user's profile Send private message

Reply with quote Thursday, September 20, 2007

or maybe 100% shaders Razz?
Remember the teleport chambers in morrowind?
Now that was swell.

shadowcast View user's profile Send private message

Reply with quote Friday, September 21, 2007

I don't care how you do it anymore..pimp it good...now I have a new comp Very Happy
finally upgraded...for those who wanna know Razz
Core 2 Duo E4400
2 gigs of ram
And a Ati Radeon EAX 1650
Hehe...just played oblivion on max settings

AligBorat View user's profile Send private message

Reply with quote Friday, November 02, 2007

gratz man..I wish I had a good pc Razz..mines 4 years old *laughing out loud*

WarFang_76 True Warrior View user's profile Send private message

Reply with quote Saturday, November 03, 2007

Mine is 7 years old
PS I don`t think the Playstation 2 emulator will even start on your PC(it had 1 fps on mine Laughing )

Post new topic Reply to topic

Online
0 / 2470