Ubu
Member
So I've been struggling with this for a few weeks now without getting any closer and I'm hoping that someone with experience in 3d can help me out.
I have created a cube primitive 64x64x64 in size with texture applied. I know how to get the texture to repeat when creating the primitive using gpu_set_texrepeat(true) and then specify a value larger than 1 in the UV coordinates. (Changing the texture coordinates during runtime also works by "recreating" the primitive with new UV coordinates.)
But here is the problem, how to make the texture repeat seperately for each object made from the same primitive?
To clarify, I have a 64x64x64 sized cube-primitive with texture and no texture repeat. I then fill the scene with several of these cubes made from the same primitive, all of which are scaled to a random size (with increments of 64). So far it works fine. Now I would like to change the texture repeat independently for each of these cubes. So if a cube is scaled to 128x128x128 the texture should repeat twice on that cube and if a different cube is scaled to 256x256x256 it should repeat 4 times.
Is this even possible or do I have to make a separate primitive for each cube?
Any help would be greatly appreciated.
I have created a cube primitive 64x64x64 in size with texture applied. I know how to get the texture to repeat when creating the primitive using gpu_set_texrepeat(true) and then specify a value larger than 1 in the UV coordinates. (Changing the texture coordinates during runtime also works by "recreating" the primitive with new UV coordinates.)
But here is the problem, how to make the texture repeat seperately for each object made from the same primitive?
To clarify, I have a 64x64x64 sized cube-primitive with texture and no texture repeat. I then fill the scene with several of these cubes made from the same primitive, all of which are scaled to a random size (with increments of 64). So far it works fine. Now I would like to change the texture repeat independently for each of these cubes. So if a cube is scaled to 128x128x128 the texture should repeat twice on that cube and if a different cube is scaled to 256x256x256 it should repeat 4 times.
Is this even possible or do I have to make a separate primitive for each cube?
Any help would be greatly appreciated.