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 > Using hblank interrupt with OpenGL in DS?

#26379 - LOst? - Tue Sep 14, 2004 5:36 am

I have always wondered what will happen to the hblank raster effects now when real 3-D is taking over the consoles.

I love the hblank! I love to make horizontal raster effects, and I have never seen them on any system that runs 3-D hardware graphics.

If DS now is backward compatible with GBA, will the interrupts for hblank work when being in the 3-D mode, or will it be obsolete?


Sorry for asking such a "obsolete" question anyway. Just interested.

#26433 - Touchstone - Wed Sep 15, 2004 3:28 pm

I would also like to know where the h-blank interrupt went when 3D came into play. I have a theory that where tile based systems, such as the GBA, is actually drawing the picture in sync with the LCD, 3D based graphics card are drawing each triangle to a screen buffer which is DAC'ed to the display upon vertical blanking.

Regarding loosing the h-blank on the DS. Afaik there are two screens that work independantly. One of them is the 3D view with all that stuff, and the other screen is the "GBA" screen complete with h-blank and whatnot.

Well, that's what I think.
_________________
You can't beat our meat

#26434 - zazery - Wed Sep 15, 2004 3:35 pm

Both screens can use 3D graphics so I don't think one of them is the gba screen and the other is the 3D screen. You can see this when Metroid Prime: Hunters starts up.

It would be interesting to know the answer but I am thinking without proper care you could get some ripping going assuming there is an h-blank interrupt you can call for a 3D screen.

#26436 - tepples - Wed Sep 15, 2004 3:53 pm

zazery wrote:
Both screens can use 3D graphics

True, but can both screens use 3D simultaneously or, as I suspect, is there just a register saying whether to send the DS picture to the top screen or the bottom screen?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#26437 - jma - Wed Sep 15, 2004 4:45 pm

tepples wrote:
is there just a register saying whether to send the DS picture to the top screen or the bottom screen?

That would actually be very cool. I bet, if one was willing to cut framerate in half, you could try and create a "panoramic" (although vertical) 3D game. Just re-orient the camera, flip the output LCD bit and redraw. *pondering the possibilities*

Jeff
_________________
massung@gmail.com
http://www.retrobyte.org

#26445 - zazery - Wed Sep 15, 2004 11:39 pm

tepples wrote:

True, but can both screens use 3D simultaneously or, as I suspect, is there just a register saying whether to send the DS picture to the top screen or the bottom screen?


The screens can use 3D on both screens at the same time. In Metroid Prime: Hunters, when the game starts up it shows a full 3D model of Samus filling both screens. (View this video to see it or here for a smaller one)

Another example of 3D on both screens is the Pokemon Pikachu demo where Pikachu was on the top screen and a flopping fish on the bottom; both 3D models. I believe it was also in the video I linked above.

I think you are right about having a register controlling the screen orientation. You could switch the screens as some sort of Gameplay mechanic in a mini game or something.

#26447 - LOst? - Wed Sep 15, 2004 11:55 pm

Then another question? Having a 2D font/menu or a 2D logo appearing in 3-D? That's very hard.
Will DS be able to have a 2-D background in front of the 3-D scene?

#26465 - abilyk - Thu Sep 16, 2004 4:55 am

As was my understanding, only one screen can use the hardware 3D at any given time. Either screen can use the hardware 3D (it's not like only the top screen can), but it has to be one or the other. There should be info on the net that supports this, because I think I heard this at E3.

My guess is that any demos that had simultaneous 3D on both screens did so in one of two ways:

1) The 2D screen used software-implemented 3D like current GBA games can.

2) If the screen displays are synched, perhaps you could swap the indices of each screen's currently used display buffer during an HBlank, letting each screen display part of the 2D and 3D buffers during the same frame. Though I haven't tried it, I'm sure you could change DISPCNT's frame buffer bit between scanlines for a similar effect on GBA modes 4 and 5.

#26714 - Mr. Ploppy - Fri Sep 24, 2004 10:27 am

zazery wrote:
The screens can use 3D on both screens at the same time. In Metroid Prime: Hunters, when the game starts up it shows a full 3D model of Samus filling both screens.

The startup of Metroid is indeed very nice, but have you really loked closely at it? The DS has nice 3D graphics for a handheld console, but it's closer to the N64 in abillity, rather than the Gamecube. The model of Samus you see is too complex to be rendered by the DS in real-time, and certainly not on both screens at once. That intro is a FMV, a little pre-rendered cinema before the match, not an example of the DS rendering 3D to both screens. The DS has one 3D core and a pair of 2D cores. That means 2d on both screens, or 3d on one and 2d on the other, but never 3D on both.
_________________
I'm just off to Hartleypool to buy some exploding trousers. Cluck, cluck, gibber, gibber, "my old man's a mushroom", et cetera.

#26732 - zazery - Fri Sep 24, 2004 5:09 pm

Yes, it is possible the Metroid demo used a FMV to display Samus. However, I was reading on the Nintendo.com forums and a few topics just like this one came up. Apparently people noted that the Pikachu demo did have simple 3D on both screens. When Pikachu was fishing, the fish was sent to the bottom screen and you had to measure it. Pikachu was still moving about on the top screen as well. I also believe he crossed the screens a few times for a closer look at you or something like that.

#26753 - abilyk - Sat Sep 25, 2004 1:46 am

Mr. Ploppy wrote:
The DS has one 3D core and a pair of 2D cores. That means 2d on both screens, or 3d on one and 2d on the other, but never 3D on both.


Where did you get this information? Elsewhere on the forum someone linked to info on the DS' memory map. There is only one set of registers per each BG (BG0-3, like the GBA). If there were indeed two 2D "cores," I would imagine there would be two sets of registers for each BG layer.

Not that the DS can't display 2D on both screens simultaneously; from what I gather it can. However, it seems like both screens must use the same settings (offsets, etc.) for 2D backgrounds, essentially as if they were one big screen.

As an aside, it looks like BG0 can be used as a normal 2d background or as a 3D "canvas."

#26841 - Mr. Ploppy - Mon Sep 27, 2004 8:25 am

abilyk wrote:
Mr. Ploppy wrote:
The DS has one 3D core and a pair of 2D cores. That means 2d on both screens, or 3d on one and 2d on the other, but never 3D on both.
Where did you get this information? Elsewhere on the forum someone linked to info on the DS' memory map.

I have seen that link. I have no idea how accurate it is, but the info provided there seems sensible. As for my info, most of it is taken from, or contributed to The DS Wiki, arguably the most informative DS site around.
Here's a quote:
The DS Wiki wrote:
For the DS's two screens, there are three video chips. Two 2d GBA-like chips and a new 3d chip.
Though you do get to pick which screen the 3d is on.
I think it makes sense that the DS would have a set of BG registers for each screen, but I can't say why they would not be noted on the german link. My guess is that one 32-bit register holds the data for both 2d screens, 16-bits each like the GBA, but certain I am not.

abilyk wrote:
As an aside, it looks like BG0 can be used as a normal 2d background or as a 3D "canvas."
That was my perception as well. Perhaps both screens are always 2d, and the 3d is impemented on one screen simply by "switching on" the 3d chip and having it draw to that screen's BG0...
_________________
I'm just off to Hartleypool to buy some exploding trousers. Cluck, cluck, gibber, gibber, "my old man's a mushroom", et cetera.

#26844 - FluBBa - Mon Sep 27, 2004 10:13 am

I just looked over the DS info again and it seems it uses bit 0 to 8 for the vertical counter (0-512) does that mean it scans both screens and so only uses one 2D core?
I'm confused now.
_________________
I probably suck, my not is a programmer.