forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PS2 offscreen accelerated graphics

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
mountainstorm



Joined: 07 Apr 2004
Posts: 21

PostPosted: Fri Sep 10, 2004 4:56 am    Post subject: PS2 offscreen accelerated graphics Reply with quote

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
Back to top
View user's profile Send private message
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Fri Sep 10, 2004 5:12 am    Post subject: Reply with quote

there is no kernel catering context switches if thats your concern.

you can render wherever you want in vram. and point display to wherever you want in vram.
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Sep 10, 2004 5:12 am    Post subject: Reply with quote

Its kinda hard to do double-buffering if you can't.
Back to top
View user's profile Send private message Visit poster's website
mountainstorm



Joined: 07 Apr 2004
Posts: 21

PostPosted: Fri Sep 10, 2004 3:42 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Sep 10, 2004 4:06 pm    Post subject: Reply with quote

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
Back to top
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Fri Sep 10, 2004 4:58 pm    Post subject: Reply with quote

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.

Do you mean like multiplayer split screen? How do you think it's done?

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
Back to top
View user's profile Send private message Visit poster's website
mountainstorm



Joined: 07 Apr 2004
Posts: 21

PostPosted: Sat Sep 11, 2004 2:01 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Sat Sep 11, 2004 3:44 am    Post subject: Reply with quote

You can set the memory location in vram to render to, the size of the offscreen buffer (x,y,z), and using the clip registers you can set where on that framebuffer to render to. You may have to specify an offset to re-center on this clipped part but the whole process isn't that difficult.
Back to top
View user's profile Send private message Visit poster's website
mountainstorm



Joined: 07 Apr 2004
Posts: 21

PostPosted: Sat Sep 11, 2004 4:25 am    Post subject: Reply with quote

That sounds very cool, which tutorial should I look at for examples of this?

So what format does the PS2 support for textures, I take it it does RGB and RGBA but does it do YUV? If not can we use the IUP to do accelerated YUV to RGB conversion, any ideas how?

I wonder what Im trying to do? :)

Rich
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Sat Sep 11, 2004 5:34 am    Post subject: Reply with quote

Tutorials? Not really.

YUV? Well, I'd say either you're either playing video of some sort, or a gamecube emulator. I think the IPU can do the conversion for you, but its not a complex thing to do if not.
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Sep 12, 2004 7:27 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group