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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:37:54+00:00 2026-06-06T12:37:54+00:00

What happens if you bind (different textures) to both GL_TEXTURE_2D and GL_TEXTURE_CUBE_MAP in the

  • 0

What happens if you bind (different textures) to both GL_TEXTURE_2D and GL_TEXTURE_CUBE_MAP in the same texture image unit?

For example, suppose I bind one texture to GL_TEXTURE0‘s GL_TEXTURE_2D target and another texture to the same texture unit’s GL_TEXTURE_CUBE_MAP target. Can I then have two uniform variables, one a sampler2D and the other a samplerCube and set both to 0 (to refer to GL_TEXTURE0)?

I suspect the answer is “no” (or that the result is undefined) but I haven’t found anything in the spec that specifically prohibits using multiple texture targets in the same texture image unit.

  • 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-06T12:37:56+00:00Added an answer on June 6, 2026 at 12:37 pm

    I haven’t found anything that describes if you can bind a 2D texture and a cube map texture in the same texture unit, but (or so) I guess this is perfectly possible. It makes sense to allow it, since all texture modification functions require you to specify the texture target to operate on, anyway.

    But the OpenGL ES 2 spec explicitly disallows to use both at the same time in a shader, as chapter 2.10 says:

    It is not allowed to have variables of different sampler types
    pointing to the same texture image unit within a program object. This
    situation can only be detected at the next rendering command issued,
    and an INVALID_OPERATION error will then be generated.

    So you cannot use both a sampler2D and a samplerCube referring to the same texture unit to bend your implementation’s texture unit limits.

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

Sidebar

Related Questions

What happens if I bind two event handlers to the same event for the
How is the bind operator implemented in JavaFX? What happens behind the scenes? Does
How do I make an HTML button’s onclick event trigger one of two different
Jquery bind is amazing, but I don't know in what order the binding happens.
It happens lot of the time that when you report a bug to a
What happens when you call notifyAll method on an object that is not waiting?
What happens is whenever i upload media onto my site; everyone will get a
It happens to me all the time. I accidentally version a file, I do
This happens after I hit Build and Go to run my app on my
What happens if the user closes their browser while a called business service method

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.