RendererServices, send an array [GLSL]

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
}{ermanssoN
Posts: 37
Joined: Mon May 26, 2008 7:39 pm

RendererServices, send an array [GLSL]

Post by }{ermanssoN »

Hello.

I just started to play around with with glsl. I would like to know if it's possible to send an array to my vertex shader, eg:

Code: Select all

//.h c++

struct MyLight
{
    SColorf      color;
    vector3df   pos;
};
let's say I have an array with 2 MyLight's, can I send them to the shader.
I know how to do it with Direct X 10, but that's not going to help ;P

Code: Select all

//.vert shader
struct SLight
{
    vec4 color;
    vec3 pos;
};
varying SLight lights[2]

BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

You can do it but AMD cards seem to fail when sending arrays in GLSL. That's my experience anyway. Works fine in HLSL though.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply