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 

Change Color during rendering with fixed mesh

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



Joined: 01 Oct 2009
Posts: 96

PostPosted: Sun Dec 13, 2009 6:29 am    Post subject: Change Color during rendering with fixed mesh Reply with quote

Hi there,

I've a sphere in my scene which usually is white. The scene consists of an white light source. The Spheres Material is set as following:
Code:
sceGuColorMaterial(GU_DIFFUSE);

Depending on condition I would like to render the sphere in red, but I do not want to manipulate the color in each vertex of the mesh.

I tried the following methods of GU, but no one seem to do the job:
Code:
sceGuMaterial(GU_DIFFUSE | GU_AMBIENT, 0xff0000ff);
sceGuModelColor(0xff0000ff, 0xff0000ff, 0xff0000ff, 0xff0000ff);
sceGuColor(0xf0000ff);


any help would be much appriciated

Regards...
Back to top
View user's profile Send private message
jsharrad



Joined: 20 Oct 2005
Posts: 102

PostPosted: Sun Dec 13, 2009 7:21 am    Post subject: Reply with quote

If the entire sphere mesh is white and you want to change the whole thing at once you could just drop the colour information out of the mesh and use sceGuColor before each render of it.
Back to top
View user's profile Send private message
anmabagima



Joined: 01 Oct 2009
Posts: 96

PostPosted: Sun Dec 13, 2009 7:42 am    Post subject: Reply with quote

Hi,

thanks for the tip. I guess sceGuModelColor(0xff0000ff, 0xff0000ff, 0xff0000ff, 0xff0000ff); does also the trick. I've had a mistake in my code. Thanks. I will try out your solution as well as I feel difficult to set the ModelColor back to the previus color as I do not want to get the effect on subsequentially rendered objects as well....
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