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 

Texturing an object

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



Joined: 05 May 2005
Posts: 66

PostPosted: Thu Aug 11, 2005 1:06 pm    Post subject: Texturing an object Reply with quote

I am trying to texture an object and my texture is coming up blueish, I am loading the tga correctly as I confirmed that and I'm passing it to sceGuTexImage correctly as ARGB, but its blueish, I disabled blending... any other ideas? I also tried passing it in as different variations, ABGR, RGBA, etc, but looking at the forums someone said it was ARGB that was the right one...

Either way, its coming up all wrong, blue is showing up where white should be or sorda white.

And Red seems to be black or really really really dark.

Any ideas?
Thanks
Jeff.

PS background is white, dont know if that makes a difference
Back to top
View user's profile Send private message
Chrighton



Joined: 15 Jun 2005
Posts: 58

PostPosted: Thu Aug 11, 2005 1:53 pm    Post subject: Re: Texturing an object Reply with quote

webjeff wrote:
I am trying to texture an object and my texture is coming up blueish, I am loading the tga correctly as I confirmed that and I'm passing it to sceGuTexImage correctly as ARGB, but its blueish, I disabled blending... any other ideas? I also tried passing it in as different variations, ABGR, RGBA, etc, but looking at the forums someone said it was ARGB that was the right one...

Either way, its coming up all wrong, blue is showing up where white should be or sorda white.

And Red seems to be black or really really really dark.

This is clearly indicative that you aren't loading your targa correctly, how are you sure you 'confirmed' it? If you tried different variations, you would have stumbled on the right one in no time, a simple test by converting a red only or blue only or green only image would have put you on the right track, again in no time :)

webjeff wrote:
PS background is white, dont know if that makes a difference

Not at all :)

In vram, the least significant bits get the red component, that should get you started...
Back to top
View user's profile Send private message
webjeff



Joined: 05 May 2005
Posts: 66

PostPosted: Thu Aug 11, 2005 2:07 pm    Post subject: Reply with quote

Well, I have a C++ client app that I was loading the TGA with and I can read the bytes, and with a all red image I saw 0 0 255 255 which means the TGA is stored as BGRA, fine. I used a simple algorithm to change the order to whatever I want. simple enough, however, I have a red image on a box for simplistic measures and its black. Only red, so there is something else wrong here.

Are their any special modes I dont need, here is my texturing code:

Code:

sceGuTexMode(GU_PSM_8888,0,0,0);
sceGuTexImage(0,512,512,512,imageData);
sceGuTexFunc(GU_TFX_REPLACE,GU_TCC_RGBA);
sceGuTexFilter(GU_LINEAR,GU_LINEAR);
sceGuTexScale(1.0f,1.0f);
sceGuTexOffset(0.0f,0.0f);
//sceGuAmbientColor(0xffffffff);
sceGuDisable(GU_BLEND);



I've been messing around with different ambient colors and thinkin I'm not setting TexOFfset correctly or something, not really sure what else could be wrong.

Thanks
Jeff
Back to top
View user's profile Send private message
Chrighton



Joined: 15 Jun 2005
Posts: 58

PostPosted: Thu Aug 11, 2005 2:55 pm    Post subject: Reply with quote

That looks fine actually. You could try ruling out your tga loader routine(s) by manually filling in imageData or another chunk of ram with a red *value*, and try displaying that for a texture, -or- alternatively, just manually loop through imageData and poke it into the framebuffer, to rule out flaws in the GU setup. Otherwise that bit of code is pretty much identical to mine and most everyone else using the sdk samples as a template.

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