Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

meZmo

Simple Vertex Program... not so simple :-(

This topic is 6104 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve setup a super-simple vertex program that just transforms position and passes through light color. Everything gets really dark grey though (like ambient 0.2 light), why could that be?
  
!!VP1.0
# c[8] - c[11]	: Modelview*Projection matrix

DP4 o[HPOS].x, c[8], v[OPOS];
DP4 o[HPOS].y, c[9], v[OPOS];
DP4 o[HPOS].z, c[10], v[OPOS];
DP4 o[HPOS].w, c[11], v[OPOS];

MOV	o[COL0].xyz, v[COL0];

END
  
Input color is specified as glColor3f(1,1,1) and gl lighting is disabled. Any suggestions appreciated. -meZ

Share this post


Link to post
Share on other sites
Advertisement
i dont know the solution to your problem.
but i think you should remove .xyz in the line
MOV o[COL0].xyz, v[COL0];
because its not neccessary.
also you should deactivate all textures beforce using the vertex program, and disable blending.

but i have a question:
how do you get your matrix into the parameter registers?
are you using glTrackMatrix?

i also have a problem with vertex programs, could you take a look at
http://www.gamedev.net/community/forums/topic.asp?topic_id=76950
please.

Share this post


Link to post
Share on other sites
Yeah, I just put in the .xyz to see if it would make any difference.

I using trackmatrix like this:
  
#define VP_C08 8

// Map modelview*projection matrix to const c8->c11

glTrackMatrixNV( GL_VERTEX_PROGRAM_NV, VP_C08, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV );


And that part works like a charm.

-meZ

Share this post


Link to post
Share on other sites

Just found the problem... :-|

Explicitly disabling both texture units did the trick. I could swear they''re supposed to be off by default!?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!