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 > Fog Alpha Color

#165856 - ritz - Fri Jan 09, 2009 9:25 pm

Has anyone figured out the alpha component of FOG_COLOR? I can't get it work for the life of me. I've tried a variety of configurations of the hardware thinking it was dependent on some obscure setting. I've played with bits in CLEAR_COLOR, DISP3DCNT, POLYGON_ATTR, etc. Perhaps my understanding of it is just an incorrect assumption based on its name? I dunno...

#165857 - kusma - Fri Jan 09, 2009 9:51 pm

How do you expect fog alpha to work?

#165859 - ritz - Fri Jan 09, 2009 10:37 pm

I currently have fog w/ color hiding my clip plane with a skybox all around my scene. I would like (and assume) that setting my FOG_COLOR alpha component to non-31 and optionally setting the GL_FOG_ONLY_ALPHA bit would give my polys a more "out-of-the-skybox-image" feel than a "out-of-some-color-that-attempts-to-match-my-skybox-image-to-give-me-the-illusion that-it's-actually-out-of-the-skybox-image".

:)

#165865 - kusma - Sat Jan 10, 2009 3:44 am

If I understand what you're trying to do correctly, it can only possibly work if the skybox is not drawn with the 3d-hardware, because of the way fogging works on the DS. Fogging is applied as a post-process, where the z-buffer is looked up into the fog-table. At that point you only have one color in the color-buffer (of course), and that color should be blended in.

I haven't looked into how alpha-fog on the DS works, but at least in OpenGL the alpha component of the fog color is never used. The information in no$gba isn't really sufficient to understand what the fog alpha and the different fogging modes does.

#165888 - ritz - Sun Jan 11, 2009 3:55 pm

Thanks for the info. Sounds like I won't be able to do what I wanted... oh well :(

#165901 - silent_code - Mon Jan 12, 2009 10:17 am

I think this is perfectly doable, but I have not attempted to do it myself, yet. Just dedicate some small VRAM bank (you could probably get away with as low as 16kb, with propper tile [16kb] and map [2kb] placement) as BG memory and but a tiled image in there and display it below BG0.
_________________
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.