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 

Rendered objects are all black.

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



Joined: 16 Sep 2005
Posts: 11

PostPosted: Fri Oct 21, 2005 1:52 am    Post subject: Rendered objects are all black. Reply with quote

Hi.

I have managed to render some objects on the screen. My vertices contain no color information, only coordinates
Code:
struct Vertex
{
   float x,y,z;
};

To set the colod I call
Code:
sceGuColor( 0xffffff00 );

Then render the objects using
Code:

sceGuDrawArray(
GU_TRIANGLES,GU_VERTEX_32BITF|GU_TRANSFORM_3D,
   vertexCount,0, vertexData );


But the rendered objects are all black.

What am I doing wrong?
Back to top
View user's profile Send private message Visit poster's website
Ryu



Joined: 17 Oct 2005
Posts: 19

PostPosted: Fri Oct 21, 2005 3:41 am    Post subject: Reply with quote

you have to use that structure:

struct Vertex
{
float u,v;
UINT color;
float x,y,z;
};
Back to top
View user's profile Send private message MSN Messenger
peterstroeiman



Joined: 16 Sep 2005
Posts: 11

PostPosted: Fri Oct 21, 2005 3:54 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Ryu



Joined: 17 Oct 2005
Posts: 19

PostPosted: Fri Oct 21, 2005 4:03 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
mofig



Joined: 23 Aug 2005
Posts: 3
Location: Oregon

PostPosted: Fri Oct 21, 2005 5:21 am    Post subject: Reply with quote

if you have lighting enabled you need to specify normals for your objects.
Back to top
View user's profile Send private message AIM Address
peterstroeiman



Joined: 16 Sep 2005
Posts: 11

PostPosted: Fri Oct 21, 2005 5:33 am    Post subject: Reply with quote

I found out the problem.

I had texture mapping enabled, which I shouldn't when not using it.
Back to top
View user's profile Send private message Visit poster's website
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