gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > How to control edge marking thickness?

#159978 - wagonburner - Tue Jul 08, 2008 11:34 pm

Does anybody know of a way to control the thickness of the edge marking that's built into the NITRO viewer tools? I know how to set up the poly IDs, change the color, etc, but there isn't a way to adjust the thickness. Anybody have any code for this?

#159984 - elhobbs - Wed Jul 09, 2008 1:33 am

I do not think that the GDC pdfs are still accesible but I think edge thickness was one of the things it covered. I believe it said that it can not be controled. it mentioned an alternate method using texture mapping with transparent polygons.

#159991 - tepples - Wed Jul 09, 2008 1:56 am

Do any DS games adjust the thickness, or does the hardware just fix it to 1 pixel?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#159992 - eKid - Wed Jul 09, 2008 2:38 am

I don't think you can change the thickness. :\

#159993 - DekuTree64 - Wed Jul 09, 2008 3:08 am

Yeah, the hardware effect is always one pixel. It's kind of ugly anyway since you only get edges around the outer silhouette of a character.

If you need nice looking outlines, you could try the scaled up backface shell method instead. Render the model normal, then render it again but scaled up a bit, color set to black, and only backfacing polygons. Of course that cuts your poly could in half, but hey, maybe you could use HW edge marking as an LOD for it on far away models :)

Another problem is that to really make it look right on a non-convex object (say, a human), you have to stop at each joint down the heirarchy and multiply in the outline scale, render the polygons for that joint, then divide it back out, and then go down the next joint in the heirarchy. Basically do the outline scale relative to each joint, rather than relative to the whole model's origin.

Actually I bet you could do a nice optimized version to render the regular and shell in one go, so you don't have to do all the joint transformations twice.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#159998 - wagonburner - Wed Jul 09, 2008 3:41 am

Currently working with doubled up geometry, but trying to reduce the polycounts. Having double the geometry is very expensive, especially on some of the rounder objects. This is probably a great technique for the XBOX360.

#160020 - silent_code - Wed Jul 09, 2008 10:53 am

That's how 13 (and other games) rendered the effect. :^)

If you had the cycles and memory needed available, you could build an edge list for each model (excluding edges for nearly coplanar surfaces - do it via a dot product threshold) offline. Then, just check which edges are part of the silhuette and render "quad lines" for them, much like "traditional" realtime inking. You could even use the hardware's outlline rendering in addition to this for some cases, where a mesh deforms and creates a silhuette edge, where there was none before. :^)

But this method will also decrease your polygon budget and might be slower than the above "shifted shell" approach - I haven't tested it, so I don't know and it really depends of what you want to do.

Try different solutions, that's the best you can do. ;^)

Good luck. :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.