Is Geometry shader not work with GL3?
Hi everyone.
I started using jitter with gl3.
But, jit.gl.shader is not work .
When I creat jit.gl.shader and save that shader, The text below is output on MaxConsole.
jit.gl.mesh: jit_gl_geometry_draw_buffers: GL Error: Invalid operation
I can use jit.gl.shader, if i delete geometry shader in my shader.
But, gl3 sample is working with geometry. ex Billbord example.
What's happened?
Anybody knows how I do it?
Thanks.
zip up the shader and the patch and post it here and i'll take a look
Ok, not sure what's going on here but I can reproduce and will investigate.
Thank you very much.
I look forward to your reply.
I'm experiencing the same issue. Any progress on this bug?
looking at this more closely I am not seeing a bug, but the patch is not properly setup (the mesh is set to draw_mode points, but the shader is expecting lines_adjacency). if there's some indication of what you are trying to achieve I might be able to advise.
Hi Rob, i'm experiencing the issue when using only gl.gridshape, not gl.mesh.
As soon as the default shader is saved the geometry disappears and I receive this message in the console:
jit.gl.gridshape: jit_gl_geometry_draw_buffers: GL Error: Invalid operation
that's only the default shader if @gridmode is 0 (quadgrid). if you set @gridmode 0 on your gridshape that shader should work. for the default jit.gl.gridshape (@gridmode 1 - trigrid) this is the default shader:
<jittershader name="fill-flat-triangles">
<description>
An auto-generated shader for simulating deprecated OpenGL features in OpenGL 3.2+
</description>
<param name="position" type="vec3" state="POSITION" />
<param name="modelViewProjectionMatrix" type="mat4" state="MODELVIEW_PROJECTION_MATRIX" />
<param name="color" type="vec4" state="COLOR" />
<language name="glsl" version="1.5">
<bind param="position" program="vp" />
<bind param="modelViewProjectionMatrix" program="vp" />
<bind param="color" program="vp" />
<program name="vp" type="vertex">
<![CDATA[
// Preprocessor
#version 330 core
// Definitions
// Uniforms
uniform mat4 modelViewProjectionMatrix;
// Attributes
in vec3 position;
in vec4 color;
// Output
out jit_PerVertex {
flat vec4 color;
} jit_out;
// Library functions
void main() {
gl_Position = modelViewProjectionMatrix * vec4(position, 1.);
jit_out.color = color;
}
]]>
</program>
<program name="fp" type="fragment">
<![CDATA[
#version 330 core
in jit_PerVertex {
flat vec4 color;
} jit_in;
out vec4 color;
void main() {
color = jit_in.color;
}
]]>
</program>
</language>
</jittershader>
Ah I had no idea about the @gridmode attribute. Thanks!