#125061 - rhaegar - Wed Apr 11, 2007 2:29 am
A bit of a noob here so bear with me.
I seems like you can 'blend' more than 2 backgrounds together using BLEND_CR.
This will render BG0, BG1 and sprites normally and then blend BG2 over this rendered image. The reverse however (swapping DST and SRC and inverting the background priorities) does not seem to work.
Situation:
I'm using 2 background layers, BG0 and BG3 under mode 5. BG3 is a full screen tilled image. I'm using the 3D on BG0 to simulate 2D vector graphics using antialiasing and layers of flat shaded polygons along with one large polygon at the back for the background.
This will work properly, drawing the 3D and the priority 1 sprites, then blending this with BG3, and finally drawing the priority 0 sprites over that.
Problem:
I want the transparent sprites to blend with the 3D background and not BG3. As i can't seem to simply replace BLEND_DST_SPRITE with BLEND_SRC_SPRITE, i revese the role of BG0 and BG3.
However, only the 3D and priority 0 sprites appear (no blending).
Changing POLY_ALPHA under glPolyFmt will seem to fix the problem though i seem need a new POLY_ID for each polygon layer or they disappear completely (havent tried changing for every layer as it will require a significant recode). From what i can tell with different IDs though, i seem to loose antialiasing.
So my question is, how can i blend the 3D layer into the rest of my screen without loosing antialiasing?
I seems like you can 'blend' more than 2 backgrounds together using BLEND_CR.
Code: |
BLEND_CR = BLEND_ALPHA | BLEND_DST_BG0 | BLEND_DST_BG1 | BLEND_DST_SPRITE | BLEND_SRC_BG2;
BLEND_AB = 8 | 8<<8; |
Situation:
I'm using 2 background layers, BG0 and BG3 under mode 5. BG3 is a full screen tilled image. I'm using the 3D on BG0 to simulate 2D vector graphics using antialiasing and layers of flat shaded polygons along with one large polygon at the back for the background.
Code: |
BG0_CR = BG_PRIORITY(BG_PRIORITY_1);
BG3_CR = BG_COLOR_16 | BG_RS_32x32 | BG_MAP_BASE(0) | BG_TILE_BASE(1) | BG_PRIORITY(BG_PRIORITY_0); BLEND_CR = BLEND_ALPHA | BLEND_DST_BG0 | BLEND_DST_SPRITE | BLEND_SRC_BG3; BLEND_AB = 8 | 8<<8; |
Problem:
I want the transparent sprites to blend with the 3D background and not BG3. As i can't seem to simply replace BLEND_DST_SPRITE with BLEND_SRC_SPRITE, i revese the role of BG0 and BG3.
Code: |
BG0_CR = BG_PRIORITY(BG_PRIORITY_0);
BG3_CR = BG_COLOR_16 | BG_RS_32x32 | BG_MAP_BASE(0) | BG_TILE_BASE(1) | BG_PRIORITY(BG_PRIORITY_1); BLEND_CR = BLEND_ALPHA | BLEND_SRC_BG0 | BLEND_DST_SPRITE | BLEND_DST_BG3; BLEND_AB = 8 | 8<<8; |
Changing POLY_ALPHA under glPolyFmt will seem to fix the problem though i seem need a new POLY_ID for each polygon layer or they disappear completely (havent tried changing for every layer as it will require a significant recode). From what i can tell with different IDs though, i seem to loose antialiasing.
So my question is, how can i blend the 3D layer into the rest of my screen without loosing antialiasing?