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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:30:12+00:00 2026-06-16T13:30:12+00:00

I’ve been working a bit with WebGL but it seems I can’t manage to

  • 0

I’ve been working a bit with WebGL but it seems I can’t manage to display textures any more. The output of the fragment shader is always black (the silhouette is visible).

I know this problem may occur with textures that aren’t a power of two. Unfortunately mine are (256×256). Besides, I did get them working before at some point (but I changed too much to backtrack the problem).

EDIT:
I’ve greatly simplified my program and as suggested by gman used WebGL Inspector (great tip btw).
Textures look fine from WebGL Inspector.
I was just about to post the whole code when I noticed that while

var textureUniformLocation = gl.getUniformLocation(shaderProgram, "uSampler");
console.log(textureUniformLocation);
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, neheTexture);
gl.uniform1i(textureUniformLocation, 0);

does not work, adding alert(textureUniformLocation); after console.log(...) makes the texture appear…
What I now want to know is: Is my graphics card doing drugs?

EDIT2: It will work if I put a simple string in the alert as well.

The only reason I can think of this would occur is either bad memory management or multiple execution threads. Neither of them are the case here afaik. What kind of thing could even cause such a problem in javascript?

Any help would be greatly appreciated.

  • 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-16T13:30:13+00:00Added an answer on June 16, 2026 at 1:30 pm

    If the inspector sees the textures, then… they are probably loading. Is the behavior consistent in both Chrome and Firefox? The reported behavior about alert() makes me think that perhaps the render happened before the texture load and the alert() causes a refresh (after the texture load).

    Also make sure that this isn’t a problem with vertex attributes like vertex color or degenerate UV coordinates.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
In my XML file chapters tag has more chapter tag.i need to display chapters
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have been unable to fix a problem with Java Unicode and encoding. The
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.