Skip to content

Commit 17d2b12

Browse files
committed
Don't rely on GLSL 1.40 (GL3.1)
Certain(?) Intel chipsets don't support anything above GL3.0 in a compatibility profile, but support GL3.3 in core profiles. For now, it's enough to use GLSL 1.30 with GL_ARB_draw_instanced.
1 parent 6d45ee2 commit 17d2b12

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

data/shaders/terrain.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#version 140
1+
#version 130
22

33
uniform vec4 illumination_color;
44

data/shaders/terrain.vert

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#version 140
1+
#version 130
2+
#extension GL_ARB_draw_instanced : enable
23

34
uniform mat4 osg_ModelViewProjectionMatrix;
45
uniform mat4 osg_ModelViewMatrix;
@@ -17,8 +18,8 @@ flat out uint TexIndex;
1718

1819
void main()
1920
{
20-
int x = gl_InstanceID & 15;
21-
int y = gl_InstanceID / 16;
21+
int x = gl_InstanceIDARB & 15;
22+
int y = gl_InstanceIDARB / 16;
2223
vec4 pos = osg_Vertex + vec4(x*256, 0, y*-256, 0);
2324

2425
gl_Position = osg_ModelViewProjectionMatrix * pos;

0 commit comments

Comments
 (0)