Jump to content

View more

Image of the Day

Working on Johnny Bonasera Chapter 2 Intro. #screenshotsaturday #adventuregame https://t.co/QWEx05T09z
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

GLSL: out array size too large?

2: Adsense
  • You cannot reply to this topic
1 reply to this topic

#1 paulgriffiths   Members   

-96
Like
0Likes
Like

Posted 22 February 2017 - 08:38 AM

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 engine but need parallax self shadowing too:

parallax3.jpg

parallax2.jpg

parallax.jpg

 

 

Thanks.


Edited by paulgriffiths, 22 February 2017 - 11:01 AM.


#2 paulgriffiths   Members   

-96
Like
0Likes
Like

Posted 22 February 2017 - 04:52 PM

 Found the answer with storage buffer objects:

layout(std430, binding = 0) buffer ssbo
{
    vec3 TangentLightPos[];
};
set easely like:
 
for (int i = 0; i < totalLights; i++)
  TangentLightPos[i]  = ...
Think this is the way to go as I'm using opengl 4.3 anyways.

Edited by paulgriffiths, 22 February 2017 - 04:53 PM.