Change Color during rendering with fixed mesh

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

Moderators: cheriff, TyRaNiD

Post Reply
anmabagima
Posts: 87
Joined: Thu Oct 01, 2009 8:43 pm

Change Color during rendering with fixed mesh

Post by anmabagima »

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: Select all

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: Select all

sceGuMaterial(GU_DIFFUSE | GU_AMBIENT, 0xff0000ff);
sceGuModelColor(0xff0000ff, 0xff0000ff, 0xff0000ff, 0xff0000ff);
sceGuColor(0xf0000ff);
any help would be much appriciated

Regards...
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

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.
anmabagima
Posts: 87
Joined: Thu Oct 01, 2009 8:43 pm

Post by anmabagima »

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