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 > Can't antialias or blend 3D - AA works now

#92901 - Omegas - Sat Jul 15, 2006 11:27 am

I haven't been able to enable edge antialiasing for 3D. The "Scraps of Information" document collected by Andrew Cox states:

Quote:
Edge Antialiasing
Edge antialiasing couldn?t be easier:
glEnable(GL_ANTIALIAS);
would appear to be all you need!


Well, it is not. :( In addition to that, I have tried setting bit 4 of GFX_CONTROL which NDSTech Wiki tells should enable antialiasing. Someone told me to unset GFX_CONTROL bits 12 and 13 too (?) but this didn't have any effect either. I'd like to hear if anyone really has successfully used AA on the DS...

Another thing I've been trying to accomplish is blending between BG0 in 3D mode and an exrot BG (for example BG2). I suppose it should be possible but the usual way to set up blending like this...

Code:
BLEND_CR = BLEND_ALPHA | BLEND_DST_BG2 | BLEND_SRC_BG0;
BLEND_AB = 0x10 | (0x10 << 8);


... just doesn't seem to be enough. Does anyone have any ideas on how to implement this? I could capture the 3D and blend the BGs in software but it seems too much of a hassle if the hardware is able to do it anyway...


Last edited by Omegas on Thu Jul 27, 2006 12:54 pm; edited 1 time in total

#92920 - tepples - Sat Jul 15, 2006 4:36 pm

Have you tried putting different models in different polygon groups or whatever they're called?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#92924 - M3d10n - Sat Jul 15, 2006 5:36 pm

AFAIK, antialias and blending is only performed between polygons with different polygon IDs. You can have up to 64 different IDs, if I remember correctly.

#95028 - Omegas - Thu Jul 27, 2006 12:49 pm

M3d10n wrote:
AFAIK, antialias and blending is only performed between polygons with different polygon IDs. You can have up to 64 different IDs, if I remember correctly.


I found some information about this on the forum and experimented a bit. By setting the polygon id to 1 for all polys I draw I can distinguish them from the background (id 0). This seems to be enough to enable antialiasing between the polygons' edges. I also tried setting separate IDs for several 3D objects but the results were a bit weird.. I guess I have to fiddle with this once I understand it fully.

Here's an example with source code: http://www.vilminko.net/henri/nds/3d_aa.zip

#95074 - DynamicStability - Thu Jul 27, 2006 6:40 pm

Thanks.
_________________
Framebuffer is dead.
DynaStab.DrunkenCoders.com