multiple textures with gu in 3d

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

multiple textures with gu in 3d

Post by LuMo »

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
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

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.
sandberg
Posts: 90
Joined: Wed Oct 05, 2005 1:25 am
Location: Denmark

Post by sandberg »

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
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

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
Post Reply