GLSL: out array size too large?

I’m trying to use this:

out vec3 TangentLightPos[48];

the shader compiler is saying it’s too large.

How do I get around this?

Should I be using Buffer Objects?

It’s for parallax self shadowing with multiple lights, I have fixed my parallax, normal mapping & shadows in my portals based engine but need parallax self shadowing too:

[QUOTE=paul_g_griffiths;1286074]I’m trying to use this:

out vec3 TangentLightPos[48];

the shader compiler is saying it’s too large.

How do I get around this?

Should I be using Buffer Objects?[/QUOTE]

in what shaderstage is that ?
if you want to pass these values from the vertex / tesselation / geometry shader to the fragmentshader, you could you “transform feedback” to capture the data into a buffer object

using a computeshader would be another option

From fragment to vertex shader.

I have had a quick look at both “transform feedback” & “computeshader” and both seem an overkill for such a simple task.

If I create a bufferobject can I simply update it and the vertex shader can then use these values?

the other way around ? or are you using deferred shading ?

[QUOTE=paul_g_griffiths;1286078]I have had a quick look at both “transform feedback” & “computeshader” and both seem an overkill for such a simple task.

If I create a bufferobject can I simply update it and the vertex shader can then use these values?[/QUOTE]

i think thats not possible as long as you read form that buffer, you cannot read from and write to 1 buffer at the same time. maybe a double-buffered system (so-called “buffer pingpong-ing”) could help

Yes, the other way around, oops.

Thanks , I been search google and came up with storage buffer objects:

layout(std430, binding = 0) buffer ssbo
{
    vec3 TangentLightPos[];
};

set easely like:

for (int i = 0; i < totalLights; i++)
		TangentLightPos[i]  = TBN * lights[i].Position;

Think this is the way to go as I’m using opengl 4.3 anyways.

Ill also start using uniform buffers so I can increase my lights and speed things up a little as have a lot of lights and portals.