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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:22:52+00:00 2026-06-13T16:22:52+00:00

I’ve searched all the forums, but haven’t found anyone else with this issue…I’m using

  • 0

I’ve searched all the forums, but haven’t found anyone else with this issue…I’m using a shader on a sphere to 1) create an inner glow and 2) apply a texture of earth. When I do this – the inner glow appears, but the texture doesn’t. In my console when I type: uniforms.texture1.texture.image.src – I receive the correct source location for my texture: *http://localhost:8091/media/world.jpg”

It seems that my shader is aware of the texture, but isn’t displaying it. When I add a new object into the scene (lets say a cube) that has a texture – my sphere all of a sudden assumes the texture of my new cube object. If I add two new objects into the scene (lets say a box with a woodbox texture and a skybox with a star texture) – my sphere tries to assume both the woodbox texture and the stars texture at the same time – thus resulting in a flickering effect (neither of which are the texture I wanted).

My code is as follows:

  var Shaders = {
         'earth' : {
  uniforms: {
    'texture': { type: 't', value: THREE.ImageUtils.loadTexture( "media/world.jpg" ) }
  },
  vertexShader: [
    'varying vec3 vNormal;',
    'varying vec2 vUv;',
    'void main(void) {',
    'gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',
      'vNormal = normalize( normalMatrix * normal );',
      'vUv = uv;',
    '}'
  ].join('\n'),
  fragmentShader: [
    'uniform sampler2D texture;',
    'varying vec3 vNormal;',
    'varying vec2 vUv;',
    'void main(void) {',
        'vec3 diffuse = texture2D( texture, vUv ).xyz;',
        'float intensity = 1.05 - dot( vNormal, vec3( 0.0, 0.0, 1.0 ) );',
        'vec3 atmosphere = vec3( 1.0, 1.0, 1.0 ) * pow( intensity, 3.0 );',
        'gl_FragColor = vec4(diffuse + atmosphere, 1.0);',
    '}'
  ].join('\n')
}

};

In my initialization of everything (After i setup the lights, camera, scene, etc) – I create my sphere with the following:

var geometry = new THREE.SphereGeometry(250, 40, 40)

var shader = Shaders['earth'];
uniforms = THREE.UniformsUtils.clone(shader.uniforms);

material = new THREE.ShaderMaterial({

      uniforms: uniforms,
      vertexShader: shader.vertexShader,
      fragmentShader: shader.fragmentShader

    });

mesh = new THREE.Mesh(
new THREE.SphereGeometry(250, 40, 40), material);
mesh.matrixAutoUpdate = false;
scene.add(mesh);

I’ve tried placing this code in my html head as well (without the quotation marks of course), but this didn’t change anything…. Any help would be greatly appreciated. I’m using r51 of three.js and also tried r52.

Thanks in advance!

  • 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-13T16:22:53+00:00Added an answer on June 13, 2026 at 4:22 pm

    Textures are now assigned differently:

    { type: "t", value: 0, texture: map } => { type: "t", value: map }
    

    See the Migration doc on the three.js Wiki: https://github.com/mrdoob/three.js/wiki/Migration.

    The current version is now r.52. It’s a good idea to keep up-to-date.

    EDIT: Also, rather than cloning your uniforms in this case, just assign them like so:

    uniforms = shader.uniforms;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Does anyone know how can I replace this 2 symbol below from the string
Let's say I'm outputting a post title and in our database, it's Hello Y’all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of 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.