layout(location=1) in vec3 direction;
void main()
{
- vec4 p = position.xyz;
+ vec3 p = position.xyz;
int step = -1;
for(int i=0; i<10; ++i)
{
float scale = 2.0;
p += direction*scale;
- if(p.z<0)
+ if(p.z<0.0)
break;
step = i;
}
layout(location=1) in vec3 direction;
void main()
{
- vec4 p = position.xyz;
+ vec3 p = position.xyz;
int step = -1;
for(int i=0; i<10; ++i)
{
p += direction*2.0;
- if(p.z<0)
+ if(p.z<0.0)
break;
step = i;
}
- gl_Position = position+vec4(step, 0.0, 0.0, 0.0);
+ gl_Position = position+vec4(float(step), 0.0, 0.0, 0.0);
}
*/