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 8359395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:07:56+00:00 2026-06-09T11:07:56+00:00

Are glGetUniformLocation and glGetAttribLocation time consuming? Which way is better? Call glGetAttribLocation or glGetUniformLocation

  • 0

Are glGetUniformLocation and glGetAttribLocation time consuming?

Which way is better?

  1. Call glGetAttribLocation or glGetUniformLocation every time I need it ?
  2. Store locations in varables and use them when needed ?
  • 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-09T11:07:57+00:00Added an answer on June 9, 2026 at 11:07 am

    Whether on Android or iPhone, for an opengl surface you will have methods like:
    onSurfaceCreated and onSurfaceChanged,
    get into the habit of fetching uniforms and attributes here in these 2 methods.

    The only way you can make rendering faster (which will soon become your priority when your code crosses 1000 lines of code) is by only having gluseprogram, glbindbuffer, texture binds and other binds inside onDrawFrame method, always cache variables inside onSurfaceCreated and onSurfaceChanged

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

Sidebar

Related Questions

I'm trying to pass and use a texture to shader... but every time I
I am trying to make a simple 3D application in WebGl, in which every
I'm writing an OpenGL program where I compute my own matrices and pass them
I am trying to use element indexes with my vertex and texture coordinates stored
I'm having some issues getting the following code to compile: GLint iModelMatrix = glGetUniformLocation(m_shaderProgramID,
I need to translate vertices by an X and a Y value. I have
I have an Android app which uses a bit of OpenGL running on a
setShaders muOffsetHandle = getUniformLocation(offset); muWeightHandle = getUniformLocation(weight); useProgram GLES20.glUniform1fv(muOffsetHandle, 1, mOffset, 0); GLES20.glUniform1fv(muWeightHandle, 1,
I try to access 2 textures in 1 fragment shader. For this I have
I have two textures, cloud and hill, each with 512 x 512 size, and

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.