texture matrix stack

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

Moderators: cheriff, TyRaNiD

Post Reply
cadaver
Posts: 21
Joined: Sun Aug 07, 2005 2:31 am

texture matrix stack

Post by cadaver »

Hi, I'm trying to manipulate the texture matrix stack with the same steps I use in OpenGL:

ScePspFVector3 v; v.x = -0.5; v.y = 0; v.z = 0;
sceGumMatrixMode(GU_TEXTURE);
sceGumLoadIdentity();
sceGumTranslate(&v);

sceGumDrawArray ...

but this has no effect (texture is drawn at the same position as without the matrix change), what is missing ?
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Post by starman2049 »

Not sure why this does not work for you. Might consider doing a sceKernelDcacheWritebackAll() in there, but thats just a blind guess. If all you are trying to do is offset texture coordiantes then try this (this is what I do to get textures scrolling across geometry:

Code: Select all

sceGuTexOffset(sOffset, -tOffset);
ufoz
Posts: 86
Joined: Thu Nov 10, 2005 2:36 am
Location: Tokyo
Contact:

Post by ufoz »

Don't you need to enable some state or mode to use the texture matrix? A quick look at gu.h suggests:

sceGuTexMapMode(GU_TEXTURE_MATRIX, ?, ?)
cadaver
Posts: 21
Joined: Sun Aug 07, 2005 2:31 am

texture matrix stack

Post by cadaver »

ufoz,

I think you are right, I must set the TexMapMode to GU_TEXTURE_MATRIX, but:
- when I leave the 2 other parameters 0, the texture matrix isn't correct
- seems I have to set something else (didn't find info, how to use the 2. and 3. parameter of sceGuTexMapMode)
cadaver
Posts: 21
Joined: Sun Aug 07, 2005 2:31 am

Post by cadaver »

Is anyone working with the gum texture matrix stack?

Manipulating texture coordinates with sceGuTexOffset is ok, but I couldn't get the texture matrix stack to work (see first post)
Post Reply