#154410 - Noda - Tue Apr 15, 2008 8:51 pm
Hello,
since I already use the display capture to use 3D on both screens, I though this should be easy to add a motion blur effect just by blending the new display with the old one on each screen, using the display capture register.
I don't really know why, but it doesn't work (flickers like hell on DS, and no trace of blending).
Here's my config:
The problem I think lies with the source A I'm trying to blend with. On gbatek, if it's set to 0 it said that the source is VRAM, but which one? the current one used for the capture (obviously)?
And I don't really get from where the flicker comes: if source B blending is < 15, the flickering occurs (seems like 1 frame on 2, screen is black).
Any idea?
Last edited by Noda on Wed Apr 16, 2008 10:27 pm; edited 1 time in total
since I already use the display capture to use 3D on both screens, I though this should be easy to add a motion blur effect just by blending the new display with the old one on each screen, using the display capture register.
I don't really know why, but it doesn't work (flickers like hell on DS, and no trace of blending).
Here's my config:
Code: |
void setRegCapture(bool enable, uint8 srcBlend, uint8 destBlend, uint8 bank, uint8 offset, uint8 size, uint8 source, uint8 srcOffset) { uint32 value = 0; if (enable) value |= 1 << 31; // 31 is enable value |= 3 << 29; // 29-30 seems to have something to do with the blending value |= (srcOffset & 0x3) << 26; // capture source offset is 26-27 value |= (source & 0x3) << 24; // capture source is 24-25 value |= (size & 0x3) << 20; // capture data write size is 20-21 value |= (offset & 0x3) << 18; // write offset is 18-19 value |= (bank & 0x3) << 16; // vram bank select is 16-17 value |= (srcBlend & 0xFF) << 8; // graphics blend evb is 8..12 value |= (destBlend & 0xFF) << 0; // ram blend EVA is bits 0..4 REG_CAPTURE = value; } void endFrame() { if (ul_screenClippingChanged) ulResetScreenClipping(); if (ul_dualScreenMode) { if (ul_frameNumber & 1) { vramSetBankC(VRAM_C_SUB_BG); vramSetBankD(VRAM_D_LCD); setRegCapture(true, 7, 8, 3, 0, 3, 0, 0); } else { vramSetBankC(VRAM_C_LCD); vramSetBankD(VRAM_D_SUB_SPRITE); setRegCapture(true, 7, 8, 2, 0, 3, 0, 0); } lcdSwap(); dmaCopy(ulDualScreenSprites, OAM_SUB, 128 * sizeof(SpriteEntry)); } ul_frameNumber++; } |
The problem I think lies with the source A I'm trying to blend with. On gbatek, if it's set to 0 it said that the source is VRAM, but which one? the current one used for the capture (obviously)?
And I don't really get from where the flicker comes: if source B blending is < 15, the flickering occurs (seems like 1 frame on 2, screen is black).
Any idea?
Last edited by Noda on Wed Apr 16, 2008 10:27 pm; edited 1 time in total