Does CubeTexture support DataTexture?

I load .pfm files to DataTextures and construct a CubeTexture which named envMapDiffuse by the data textures.
But I get all black in shader:

gl_FragColor = vec4(textureCube(envMapDiffuse, envDir).rgb, 1);

I have checked that the float data is read and envDir is right.
I want to make sure that if this works theoretically, thanks! :blush:

BTW: Except for setting the texture type, it seems like that apply samplerCube uniform value when define uniforms in construct function of my ShaderMaterial is useless. I need apply it by a separete sentence.

constructor() {
  // This doesn't really apply the map:
  this.uniforms = THREE.UniformsUtils.merge([
        envMapDiffuse: {
          value: envMapDiffuse // const CubeTexture
  // This works:
  this.uniforms.envMapDiffuse.value = envMapDiffuse;

Yes, you can create an instance of CubeTexture with DataTextures.

Live example:

Move the camera around to see all sides of the skybox.


Thank you very much! But my data are floats. Does it make any difference? I don’t know how to modify your fiddle to process floats. :sweat_smile:

Nope, Texture.type is not important in this case.

I try to fill float datas in your fiddle:
But it becomes black, please tell me what goes wrong, thanks!

You also need to set the type for the cube texture:


Thank you for the patient help. Am I right on what I add in the problem description? :thinking:

Um, what are you referring to?