Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:08:18+00:00 2026-06-12T09:08:18+00:00

I want to write a GLSL Fragment Shader that can do texture mapping and

  • 0

I want to write a GLSL Fragment Shader that can do texture mapping and vertex coloring. Is it possible to do both in the one shader?

At the moment, I can do this:

gl_FragColor = texture2D(tex, gl_TexCoord[0].st);

Which causes textured verts to be drawn, but not colored verts.
(which looks like this: http://www.tiikoni.com/tis/view/?id=124eb69)

I can also do this:

gl_FragColor = gl_Color;

Which causes colored verts to be drawn but not textured verts.
(Which looks like this: http://www.tiikoni.com/tis/view/?id=5bcd838)

If I do this:

gl_FragColor = texture2D(tex, gl_TexCoord[0].st) * gl_Color; (which looks like the first code snippet)

Only textured verts get drawn… which is my problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:08:18+00:00Added an answer on June 12, 2026 at 9:08 am

    What I expect to see is the textured and non-textured verts to all show up, in the last code snippet.

    You shouldn’t expect that.

    There’s no such thing as a “textured vert” or a “non-textured vert”. There is only a color, whatever that color may be. That’s the whole point of shaders: to use arbitrary code to compute a color however you want.

    You are computing the color by multiplying the result of a texture fetch with a per-vertex interpolated color. The result will be a combination of the two colors. Namely, the product of them. Therefore, the resultant color will look somewhat like the original texture.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to accomplish a GLSL Shader, that can texture and color my vertex
I want to write a program in Prolog that confirms if a b-tree of
I want write a ruby wrapper for a existing C library (.so files). Can
I want write a program that when installed, runs in background and adds a
I want write jquery code that will show form inputs after a checkbox is
I have whole page HTML in my database and i want write that html
I need a script that can write text to an exsisting file starting on
i want write a mapping File for following Class, but i dont know how.
How ia can write query with IN. I want write query Products.Where(x=>x.CategoryId = {4,5,6....})
I have 2 tables(1.Employee 2.Family). I want write a sql statement that produce the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.