Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Vertex colors with texturing?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 DeathWish   Members   -  Reputation: 122

Like
Likes
Like

Posted 31 August 2001 - 02:23 AM

hey all, I''m sorta a noob at OpenGL, but here goes anyhow Is it possible to assign a color to a vertex and ALSO texture that face? (So you get the color blended with the texture.) If so, how do you go about it? Thanks, DeathWish

Sponsor:

#2 mittens   Moderators   -  Reputation: 1315

Like
Likes
Like

Posted 31 August 2001 - 06:04 AM

Yes.

------------------------------
Trent (ShiningKnight)
E-mail me
ShiningKnight Games

#3 DeathWish   Members   -  Reputation: 122

Like
Likes
Like

Posted 31 August 2001 - 06:52 AM

Umm... I can''t seem to get it working. I''m doing:

glEnable(GL_LIGHTING);
glBindTexture(GL_TEXTURE_2D, textures[0]);

glBegin(GL_TRIANGLES);
glNormal3f(xn, yn, zn);

// then for each vertex:
glColor3f(colr, colg, colb);
glTexCoord2f(u, v);
glVertex3f(x, y, z);

glEnd();

However, it simply maps the texture without blending in the colors set with glColor3f. Am I not enabling something I should?

Thanks,
DeathWish

#4 Pauly   Members   -  Reputation: 122

Like
Likes
Like

Posted 31 August 2001 - 07:06 AM

You need to set the texture environment parameter to GL_MODULATE, its probably set as GL_DECAL by default - that overrides the base colour. Take a look at some of the texturing examples on my site...

Paul Groves
pauls opengl page

#5 DeathWish   Members   -  Reputation: 122

Like
Likes
Like

Posted 31 August 2001 - 08:07 AM

Ah, it works great now Thanks

By the way, that''s a nice informative site you''ve got there, I''ll be making some future visits.

Cheers,
Francis "DeathWish" Woodhouse

#6 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 31 August 2001 - 12:46 PM

disable the lighting. if u want to use the lighting + colors use materials (check the red book or the spec for further info)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS