Set TextureData to a Texture2D or Texture3D in Qt3D
Unsolved
General and Desktop
-
Hi everyone,
In all Qt examples, the Texture2D gets a TextureImage with a source to display an image in scene3D. But I was wondering if it is possible to create an RGBAformat array and set it to a Texture2D?
Additionally, I generated an array using the following code in javascript and set it to the data of a Texture2D, but it does not show anything.var array = new Uint8Array(400 * 400 * 4); for(var i=0; i< 400 * 400; i++){ // RGB from 0 to 255 array[4*i] = array[4*i + 1] = array[4*i + 2] = 255; // OPACITY array[4*i + 3] = 255; } return array
How I can fix this issue?
Thank you. -
It's been a long time since I used OpenGL.
OpenGL version 1.1 to 2.1 handle power of 2 textures.
I think it is with GL 3.0 that non pow-2 textures work. I think you have to explicitly create a GL 3.0 or above context. But I could be wrong.Also, try making a 256 x 256 or 256 x 512 or 512 x 512 texture.