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 

multiple textures with gu in 3d

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



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Thu Feb 09, 2006 9:24 pm    Post subject: multiple textures with gu in 3d Reply with quote

hi folks!

i am loading images from ms and hold it in memory;
it works fine with one texture for one or more geometries.
but what if i want more than one texture for two meshes?

sceGuTexImage sets the current texture, but i wasnt able to find out how to use this fct for two images (the order how i have to call all those functions)

the samples included all use only one texture... so...
i hope one of you knows

greets
lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Fri Feb 10, 2006 12:43 am    Post subject: Reply with quote

Just use sceGuTexImage to upload one texture and then draw every polygon that uses this texture. Then use sceGuTexImage to upload the next texture and draw everything with that texture, etc.

Therefore it's best to sort your polys by texture used rather than anything else.
Back to top
View user's profile Send private message Visit poster's website
sandberg



Joined: 05 Oct 2005
Posts: 90
Location: Denmark

PostPosted: Fri Feb 10, 2006 12:48 am    Post subject: Reply with quote

Hi Lumo,

You just call sceGuTexImage with the texture you want to use, before drawing you objects. So call it with texture x and render object x, then call it with texture y and render object y, etc..
_________________
Br, Sandberg
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Fri Feb 10, 2006 1:02 am    Post subject: Reply with quote

humm...
i am currently doing those steps:

    setup GU
    load my mesh
    create texture in vram
    load another mesh
    create texture for mesh2
    put texture1 to vram
    put texture2 to vram

    enter the while-loop
    set up matrices and clear screen
    read keys, add light,

    *
    draw model1
    *
    draw model2

    finish gu
    end while
    exit


well at * i tried to 'activate' the texture (of the right model)
[sceGuTexImage]
which ends in tuning my psp off.
when i put up the * outside of my while, its working but only with one texture -> i know what you mean but not exactly how.

greets
lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
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 -> PSP 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