#147471 - ix78 - Fri Dec 21, 2007 5:24 am
First post... woohoo~
Anyway, I'm wondering how do I display polygon outline in NDS?
Below is a snippet of my code...
Code: |
glClearColor(31, 31, 31, 31);
glClearPolyID(63);
glEnable(GL_ANTIALIAS | GL_OUTLINE);
glSetOutlineColor(0, RGB15(0,0,31));
glPolyFmt(POLY_ID(0));
DrawBox(...);
|
The result is still a normal 3D box with no outline... Did I miss something?
Thanks a lot!
p.s - I'm using iDeaS
#147474 - Lino - Fri Dec 21, 2007 7:40 am
iDeaS doest emuate the outline.
#147475 - ix78 - Fri Dec 21, 2007 8:02 am
i see... thx for the info
#147478 - a128 - Fri Dec 21, 2007 9:39 am
http://nocash.emubase.de/gbatek.htm#ds3dtoonedgefog
Code: |
glSetOutlineColor(0, RGB15(0,0,0));
glSetOutlineColor(1, RGB15(0,0,0));
|
for each frame
Code: |
glEnable(GL_OUTLINE);
|
from gbatek: Edge Color 0 is used for Polygon ID 00h..07h, Color 1 for ID 08h..0Fh, and so on.
When enabled, the polygon edges are drawn at the edge color, but only if the old ID value in the Attribute Buffer is different than the Polygon ID of the new polygon, so no edges are drawn between connected or overlapping polygons with same ID values.
So to have outline color 0 use POLY_ID(0)....POLY_ID(7)
Its important which POLY_ID have the first poly you draw.
#162290 - a128 - Fri Aug 29, 2008 9:47 pm
I just use the outline feature and of course discovered the problem that
if you draw a scene with i.e. POLY_ID(2) and some elements with POLY_ID(15) - so I will these elements to have the outline
then at least one element off the POLY_ID(2) scene will have a outline becauie the first POLY_ID you draw is
solves that problem.
The question is - as I see no visual difference ....why should i have
glClearPolyID(63); ?!
libnds says because of AA to work. But I can not see that AA is broken
#162291 - AntonioND - Sat Aug 30, 2008 12:20 am
In fact, I use outlining without enabling it every frame... And it DOES work ok.
PS: Outlining does only work with polygons with alpha 0 or 31.
#162299 - Lino - Sat Aug 30, 2008 6:12 pm
but does it require normal Vertices?
#162308 - AntonioND - Sat Aug 30, 2008 10:26 pm
Lino wrote: |
but does it require normal Vertices? |
What do you mean?
#163311 - a128 - Mon Sep 29, 2008 2:17 pm
Disabling the outline effect for certain objects (if the poly id scheme breaks)
use translucent polygons i.e. with alpha=30