PS2 offscreen accelerated graphics
-
- Posts: 21
- Joined: Wed Apr 07, 2004 2:59 am
PS2 offscreen accelerated graphics
First when writing code to run on the PS2 using PS2SDK, whats it running on? Are we running straight on the hardware or is there a basic kernel running?
Now for my real question.... is it possible to get hardware accelerated rendering to an offscreen buffer?
Rich
Now for my real question.... is it possible to get hardware accelerated rendering to an offscreen buffer?
Rich
-
- Posts: 564
- Joined: Sat Jan 17, 2004 10:22 am
- Location: Sweden
- Contact:
-
- Posts: 21
- Joined: Wed Apr 07, 2004 2:59 am
I want to produce renderings in 'windows' (clipped viewports) on the screen with acceleration. So I was wondering what the performance hit would be to get each rendering done to vram and then have a lib which renders them onscreen (composes them) as required by the window ordering.
My other idea was to make this lib pre-pend commands to the display list generated for a 'windows' rendering... this would add the relavent clipping commands and transform to move the output to the desired location.
thoughts?
Rich
My other idea was to make this lib pre-pend commands to the display list generated for a 'windows' rendering... this would add the relavent clipping commands and transform to move the output to the desired location.
thoughts?
Rich
Something might be missing here.
If you render to a part of VRAM that is not displayed, it is done
with the same amount of accerlation that is done when rendering
to a part of VRAM that is displayed.
Furthermore, once rendered to anywhere in VRAM that is not displayed,
you can then display by telling the video controller to immediately "switch"
to using the non-displayed portion of memory to be the new "displayed"
framebuffer. There is no need to copy anything anywhere, its already
there. Instead of copying to the framebuffer, you are bringing the framebuffer
to the previously off-screen rendered scene.
This is normally referred to as double-buffering, as mentioned very
briefly by Oopo earlier. I am merely saving him from having to explain
what he meant in more detail, as Canadians can get mighty surly when
having to take the beer bottle out of their mouths a second time to repeat
themselves.
I am no expert in graphics, as others here can attest, so if I get something
wrong or more detail is needed, you will need to rely on someone else. :)
Gorim
If you render to a part of VRAM that is not displayed, it is done
with the same amount of accerlation that is done when rendering
to a part of VRAM that is displayed.
Furthermore, once rendered to anywhere in VRAM that is not displayed,
you can then display by telling the video controller to immediately "switch"
to using the non-displayed portion of memory to be the new "displayed"
framebuffer. There is no need to copy anything anywhere, its already
there. Instead of copying to the framebuffer, you are bringing the framebuffer
to the previously off-screen rendered scene.
This is normally referred to as double-buffering, as mentioned very
briefly by Oopo earlier. I am merely saving him from having to explain
what he meant in more detail, as Canadians can get mighty surly when
having to take the beer bottle out of their mouths a second time to repeat
themselves.
I am no expert in graphics, as others here can attest, so if I get something
wrong or more detail is needed, you will need to rely on someone else. :)
Gorim
Do you mean like multiplayer split screen? How do you think it's done?mountainstorm wrote:I want to produce renderings in 'windows' (clipped viewports) on the screen with acceleration. So I was wondering what the performance hit would be to get each rendering done to vram and then have a lib which renders them onscreen (composes them) as required by the window ordering.
Basically, rendering to an offscreen buffer is the same speed as rendering to any other buffer. You do that for everying viewport, and then you have an extra textured quad for every viewport you are displaying to put it on the final buffer before you flip.
Does that make sense, and is it even close what you were asking?
Shoot Pixels Not People!
Makeshift Development
Makeshift Development
-
- Posts: 21
- Joined: Wed Apr 07, 2004 2:59 am
Thats exactly what I mean, the reason I asked about accelerated rendering to memory is that I wondered it the PS2 had specific video memory for double buffering, and you had to write to that and only that location.
As for swapping to that 'offscreen' buffer thats fine, but If the image there is only a small part of the overall screen output I assume I must do as suggested and use it as a texture rendered on a quad into the actual screen buffer. This is what I meant by a copy.
If Im not wrong, if I tried just telling the PS2 that 'this offscreen memory' is your screen buffer then it would have to be the whole screen and not just a small portion of the overall output.
So I take it the render to texture is a better way of doing this than prepending display list commands?
Cheers
Rich
As for swapping to that 'offscreen' buffer thats fine, but If the image there is only a small part of the overall screen output I assume I must do as suggested and use it as a texture rendered on a quad into the actual screen buffer. This is what I meant by a copy.
If Im not wrong, if I tried just telling the PS2 that 'this offscreen memory' is your screen buffer then it would have to be the whole screen and not just a small portion of the overall output.
So I take it the render to texture is a better way of doing this than prepending display list commands?
Cheers
Rich
-
- Posts: 21
- Joined: Wed Apr 07, 2004 2:59 am
The IPU has a special color space conversion command. You DMA YUV420 data for a 16x16 pixel block into the IPU, then DMA a 16x16 block of RGB data out of the IPU. The command will convert the YUV into 32 or 16 bit RGB (with optional dithering for 16bit), or will vector quantize the data into a 4bit paletted mode. This 16x16 pixel block can then be used as a texture - when you DMA it from the IPU, send it to the video memory where it's now a 16x16 texture.