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

  • Home
  • SEARCH
  • 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 6855633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:46:59+00:00 2026-05-27T01:46:59+00:00

vertex shader: #version 150 in vec3 MCVertex; in float pointvar; uniform mat4 MVMatrix; uniform

  • 0

vertex shader:

#version 150

in vec3 MCVertex;
in float pointvar;

uniform mat4 MVMatrix;
uniform mat4 MPMatrix;

void main()
{
    gl_Position = MPMatrix * MVMatrix * vec4(MCVertex, 1.0);
}

i need ‘pointvar’ attribute

but when i call :

glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &numAttributes);

numAttribute = 1;

there are 2 attribute in my code, numAttribute must be 2.

and if i do it like this, i can active this attribute:

gl_Position = MPMatrix * MVMatrix * vec4(MCVertex + vec3(pointvar), 1.0);

then numAttributes = 2, is there any other ways to active this attribute?
i have try to #pragma optimize(off), but not work.

  • 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-05-27T01:46:59+00:00Added an answer on May 27, 2026 at 1:46 am

    I’m pretty sure that GLSL will “erase/forget” any uniform / attribute not used in it’s code.

    All the info here.

    EDIT:

    Like uniforms, attributes can be active or inactive. Attributes that
    are unused are inactive; they do not have a binding.

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

Sidebar

Related Questions

I have the following vertex shader: uniform mat4 uMVP; attribute vec4 aPosition; attribute vec4
I have pass-through vertex and fragment shaders. vertex shader void main(void) { gl_TexCoord[0] =
I have the following vertex shader : uniform mediump mat4 projMx; attribute vec2 a_position;
void main(void) { vec4 clipCoord = glModelViewProjectionmatrix * gl_Vertex; gl_Position = clipCoord; gl_FrontColor =
I need a vec4 and a float to be passed from the vertex shader
I have a line in a vertex shader gl_Position = gl_ModelViewProjectionMatrix * vertex; I
Trying to figure out why my vertex shader works on my cell phone (Casio
I have a vertex shader (2.0) doing some instancing - each vertex specifies an
I'm trying to create a wireframe vertex/fragment shader in Unity. It seems possible according
If I have a few Program3D objects (each with it's own Vertex-Shader and Fragment-Shader

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.