Hi there,
I’ve altered the example linked above for Panda3D 1.8.0, as show below (i didn’t include it as code, as that doesn’t work with the color tags apparently):
[i]k = 1000
input = [color=red]PTA_LVecBase4f.emptyArray(k);
count = 0
for i in range(10):
for j in range(k/10):
input[count] = [color=red]UnalignedLVecBase4f(i3,j-8,0,0)
count += 1
lvec = [color=red]PTA_LVecBase4f([[color=red]UnalignedLVecBase4f(-4,0,0,0),[color=red]UnalignedLVecBase4f(4,0,0,0)]);
self.ralph.setShaderInput("light", plnp)
self.ralph.setShaderInput("fIN.Kd", PTAFloat([1.4]))
self.ralph.setShaderInput("fIN.Ka", PTAFloat([0.2]))
self.ralph.setShaderInput("Ly", input)
self.ralph.setShaderInput("instances_position", lvec)
#self.ralph.setShader(Shader.load("shader.c"))
[color=red]self.ralph.setShader(Shader.load(Shader.SLGLSL,"hgi_glsl_v.sha","hgi_glsl_f.sha"))
self.ralph.setInstanceCount(k)[/i]
This however throws an InstanceID semantics error when compiling (?) the shader. So only 1 ralph is showing.
[gp4vp shader profile not available - Win7, Radeon HD4890)
In this post, i found GLSL shaders which i adapted as below (only hgi_glsl_v.sha, didn’t touch the fragment shader):
[i]//GLSL
uniform vec4 [color=red]Ly[1000];
varying vec3 vertex_light_position;
varying vec3 vertex_light_half_vector;
varying vec3 vertex_normal;
void main(void)
{
vec4 vpos= gl_Vertex + [color=red]Ly[gl_InstanceID];
gl_Position = gl_ModelViewProjectionMatrix * vpos;
vertex_normal = normalize(gl_NormalMatrix * gl_Normal);
vertex_light_position = normalize(gl_LightSource[0].position.xyz);
vertex_light_half_vector = normalize(gl_LightSource[0].halfVector.xyz);
gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
}
[/i]
I’ve looked up glShaderContext_src.cxx of the Panda 1.8.0 source code & compared it to the patch included in this post [url]gp4vp shader profile not available - Win7, Radeon HD4890] & i think it is already included.
When i run the project, the shader compiles correctly, yet no raplhs are shown.
Any clues what i’m doing wrong? Or some good pointers to GLSL programming info?
Thanks in advance