Having trouble on custom map uniform and Textureloader

To figure out this problem: PointLight and custom map uniform don't work on my custom shader
I make this fiddle to try pass the map uniform into shader.
It gives me the warning:

A cookie associated with a cross-site resource at http://fiddle.jshell.net/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

This may caused by cross-origin problem? I cannot see my material however.

No, this warning is unrelated to your issue. Are you aware that the camera is inside your box? Instead of doing this:

var geometry = new THREE.BoxBufferGeometry( 100, 100, 100 );

do this:

var geometry = new THREE.BoxBufferGeometry( 10, 10, 10 );

At least you can see your box now: https://jsfiddle.net/nbhf09Lj/

Besides, when you change the defines of a material, a re-compilation is required. You can trigger this by setting material.needsUpdate = true.

1 Like

I am too stupid that I copied the cube from other fiddle and didn’t check the camera. :sweat_smile:Thank you!