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 

Using frame buffer as a texture

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



Joined: 16 Jul 2007
Posts: 13
Location: Poland

PostPosted: Mon Oct 22, 2007 7:08 am    Post subject: Using frame buffer as a texture Reply with quote

I want use frame buffer as a texture for sprite (lower left corner of screen), but I noticed funny GS behavior:



Screenshot is made in 3rd loop.

It also happens when I'm doing:
- local to local transmision of actual frame buffer in other place of GS memory
- local to host and after host to local in other place of GS mem.

I've tested 2nd method because I want to develop few 2D effects that modifies frame buffer (eg. blur, water effect, fire :) )

How to achieve exactly one copy of frame buffer and use it on the same frame?

EDIT:
Hmm... I forgot say what i'm really drawing on the one loop, so here it is:
- Full screen white sprite as background
- 2 triangles
- Sprite with copied actual frame buffer
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: Mon Oct 22, 2007 9:59 pm    Post subject: Reply with quote

I don't really see a problem, it looks fine to me - what should I be looking for?
Back to top
View user's profile Send private message Visit poster's website
MaikeruDev



Joined: 16 Jul 2007
Posts: 13
Location: Poland

PostPosted: Mon Oct 22, 2007 11:56 pm    Post subject: Reply with quote

It should look like this:
Back to top
View user's profile Send private message Visit poster's website
jbit
Site Admin


Joined: 28 May 2005
Posts: 293
Location: København, Danmark

PostPosted: Tue Oct 23, 2007 12:08 am    Post subject: Reply with quote

Well it looks like you're writing into the place you're reading from..... In which case this is the correct output....
The black box in the bottom left I guess is because of cache issues (it looks to be able a page big ;)
Back to top
View user's profile Send private message Visit poster's website
MaikeruDev



Joined: 16 Jul 2007
Posts: 13
Location: Poland

PostPosted: Tue Oct 23, 2007 12:21 am    Post subject: Reply with quote

Probarly You have right. It looks like I was reading from previous cached frame buffer - not actual. This black box is frame buffer of ps2link. In first iteration theres only two triangles with big black box.

Thanks
Back to top
View user's profile Send private message Visit poster's website
MaikeruDev



Joined: 16 Jul 2007
Posts: 13
Location: Poland

PostPosted: Wed Nov 07, 2007 8:55 am    Post subject: Reply with quote

After few days of testing other stuff, I found what was wrong. I just used previous buffer instead of actual, so it wasn't caching or something like that - it was my mistake :).

I wrote something like motion-blur, here is a screenshot:


What my code do in one frame:
- draws white background
- draws one big triangle
- downloads actual frame buffer
- modifies buffer in RAM
- upload buffer from RAM to GS mem in place of actual frame buffer
- draws another triangle (a small one with alpha)
- download actual frame buffer
- save bitmap
Back to top
View user's profile Send private message Visit poster's website
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