Rendered objects are all black.

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

Moderators: cheriff, TyRaNiD

Post Reply
peterstroeiman
Posts: 11
Joined: Fri Sep 16, 2005 3:18 am
Contact:

Rendered objects are all black.

Post by peterstroeiman »

Hi.

I have managed to render some objects on the screen. My vertices contain no color information, only coordinates

Code: Select all

struct Vertex
{
	float x,y,z;
};
To set the colod I call

Code: Select all

sceGuColor( 0xffffff00 );
Then render the objects using

Code: Select all

sceGuDrawArray(
GU_TRIANGLES,GU_VERTEX_32BITF|GU_TRANSFORM_3D,
	vertexCount,0, vertexData );
But the rendered objects are all black.

What am I doing wrong?
Ryu
Posts: 19
Joined: Mon Oct 17, 2005 8:36 pm

Post by Ryu »

you have to use that structure:

struct Vertex
{
float u,v;
UINT color;
float x,y,z;
};
peterstroeiman
Posts: 11
Joined: Fri Sep 16, 2005 3:18 am
Contact:

Post by peterstroeiman »

but..

I shouldn't put texture coordinates and color info in the struct if I don't specify a texture format and color format in the call to sceGuDrawArray.

And besides, my geometry seems correct, which means that the function sees the vertex format I specified.
Ryu
Posts: 19
Joined: Mon Oct 17, 2005 8:36 pm

Post by Ryu »

peterstroeiman wrote:but..

I shouldn't put texture coordinates and color info in the struct if I don't specify a texture format and color format in the call to sceGuDrawArray.

And besides, my geometry seems correct, which means that the function sees the vertex format I specified.
ok i read the h file again, i guess you can use any structure as long as it's aligned to 32bit which is the case for you
mofig
Posts: 3
Joined: Tue Aug 23, 2005 4:55 am
Location: Oregon

Post by mofig »

if you have lighting enabled you need to specify normals for your objects.
peterstroeiman
Posts: 11
Joined: Fri Sep 16, 2005 3:18 am
Contact:

Post by peterstroeiman »

I found out the problem.

I had texture mapping enabled, which I shouldn't when not using it.
Post Reply