but k must be a power of 2?
I set k to 100 and gives me this error:
:display:gsg:glgsg(error): offsets: incorrect number of elements, expected 1024 got 400
I changed the code like this (this is a code snippet):
self.cube=self.loader.loadModel(pandafile)
self.cube.flattenLight()
self.cube.reparentTo(render)
k = ABSPOS**2
offsets = PTA_LVecBase4f.emptyArray(k);
count = 0
for x in range(ABSPOS):
xp=x*10
for y in range(ABSPOS):
offsets[count] = UnalignedLVecBase4f(xp,y*10, 0, 0)
count += 1
self.cube.setShaderInput('offsets', offsets)
self.cube.setShader(Shader.load('instance.cg'))
self.cube.setInstanceCount(k)
thanks for all