Unfortunately it would be difficult to share relevant code for this. I set up a simple test case for using a DataTexture
and that went very well and was straight forward. I’m trying to integrate it into my current project but it’s not cooperating.
@alteredq do you recognize any of these issues:
- Attempting to call
texture2D
on the texture uniform results inUncaught TypeError: Type error
on this line:
_gl.texImage2D( _gl.TEXTURE_2D, 0, _gl.RGBA, _gl.RGBA, _gl.UNSIGNED_BYTE, texture.image );
Texture isundefined
at that point of code, which is why it skips theif ( instanceof THREE.DataTexture )
check - WebGL inspector isn’t showing anything related to the texture either in
Textures
panel or in the shader program. - Inspecting
material.uniforms
to compare the data texture against a normal texture I see a discrepancy in thatuniformsList.0[0].texture
is aTexture
whileuniformsList.1[0].texture
is anObject
, not aDataTexture
. However, all of its values appear to be present & correct.
Hard to tell without seeing the full code.
Here is how
DataTexture
should be used (taken from working example, creates RGB texture of size 256 x 1 pixels):You can check your code against this.