Hello,
I’m experiencing a similar issue to what’s been reported. I’m using the latest devel build (Panda3D-2013.08.06-78.exe).
I’m using the first (top) hardware instancing example from PandaSE here (etc.cmu.edu/projects/pandase/downloads.html).
I just replaced the PTAVecBase4’s with PTA_LVecBase4f and filled it with UnalignedLVecBase4f instead of Vec4 to try to make it work.
Error:
:gobj(error): shader.c: uniform in unknown instances_position: unsupported array
subclass.
:gobj(error): shader.c: uniform in unknown Ly: unsupported array subclass.
:gobj(error): Shader encountered an error.
Main (snip):
k = 1000
input = PTA_LVecBase4f.emptyArray(k);
count = 0
for i in range(10):
for j in range(k/10):
input[count] = UnalignedLVecBase4f(i*3,j*-8,0,0)
count += 1
lvec = PTA_LVecBase4f([UnalignedLVecBase4f(-4,0,0,0),UnalignedLVecBase4f(4,0,0,0)]);
self.ralph.setShaderInput("Ly", input)
self.ralph.setShaderInput("instances_position", lvec)
self.ralph.setShader(Shader.load("shader.c"))
self.ralph.setInstanceCount(k)
Thank you for testing it out for me.
I just redownloaded the demo and tried it again with the devel build from a few days ago.
The only changes I made are in this code:
k = 1000
input = PTA_LVecBase4f.emptyArray(k);
count = 0
for i in range(10):
for j in range(k/10):
input[count] = UnalignedLVecBase4f(i*3,j*-8,0,0)
count += 1
lvec = PTA_LVecBase4f([UnalignedLVecBase4f(-4,0,0,0),UnalignedLVecBase4f(4,0,0,0)]);
It all compiles fine, no problems. But when it runs, it crashes with the shader errors listed in this thread. Is there something else I should have done to the program?
Also, I’m getting a similar type of error when I run the “instance based flocking demo” from the same page as the other demo. I made no changes to the source and got this:
:gobj(error): /c/Panda3D-1.9.0/Advanced-Shader-Inputs/shaders/advancedInputs.cg:
uniform in unknown p3d_modelviews: unsupported array subclass.
:gobj(error): Shader encountered an error.
I’m running Windows 7 Home, NVIDIA GeForce 570 (fully updated).
Edit: Just for kicks, I tried out the code the OP posted that seemingly works for most. I’m getting the same error he originally got:
:gobj(error): created-shader: uniform in unknown array: unsupported array subcla
ss.
:gobj(error): Shader encountered an error.
Edit2: The programs are all producing the same errors on Panda 1.7.2, Panda 1.8.1, and dev builds of Panda 1.9.0. Sigh.
Just posting some good news:
The problems I was having were on my end. They weren’t code-related, but there was some sort of conflict causing my cg programs not to run on the dev builds correctly after I ran them on Panda 1.8.1 (and received the initial errors). I simply uninstalled everything and re-installed the newest dev build to fix the issue.
Panda’s fine. Thanks for the help.