[osg-users] geometry shader with opengles

Julien Valentin julienvalentin51 at gmail.com
Mon Apr 2 19:10:03 PDT 2018


Hi
osgtransformfeedback example is surely what you're searching for.
And give us feedback, i haven't tested tfb on es plateform..

Cheers

lyn wrote:
> Hi,
> 
> I want to know if osg support geometry shader with opengles3.2?I have changed the profile to GLES3.I'm now testing on IOS.
> I have info like this:
> GEOMETRY glCompileShader "" FAILED
> GEOMETRY Shader "" infolog:
> ERROR: 0:15: 'layout' : syntax error: syntax error
> 
> and this is my code:
> 
> #version 300 es
> 
> precision highp float;
> precision highp int;
> 
> uniform mat4 osg_ModelViewMatrix;
> uniform mat4 osg_ViewMatrix;
> uniform mat4 osg_ProjectionMatrix; 
> uniform mat4 osg_ViewMatrixInverse;
> uniform float TubeRadius;
> uniform int EdgeCount;
> uniform vec3 DirLightDir_V3;
> 
> 
> layout(points) in;
> 
> layout(triangle_strip, max_vertices = 4) out;
> 
> out vec2 gf_uv;
> 
> void main()
> {
>     vec4 offset0 = vec4(0,0,0,0);
>     vec4 offset1 = vec4(1,0,0,0);
>     vec4 offset2 = vec4(1,1,0,0);
>     vec4 offset3 = vec4(0,1,0,0);
>     gl_Position = osg_ProjectionMatrix * (gl_in[0].gl_Position + offset0);
>     gf_uv = offset0.xy;
>     EmitVertex();
>     
>     gl_Position = osg_ProjectionMatrix * (gl_in[0].gl_Position + offset1);
>     gf_uv = offset1.xy;
> 
>     EmitVertex();    
>     
>     gl_Position = osg_ProjectionMatrix * (gl_in[0].gl_Position + offset3);
>     gf_uv = offset3.xy;
>     
>     EmitVertex();
>     
>     gl_Position = osg_ProjectionMatrix * (gl_in[0].gl_Position + offset2);
>     gf_uv = offset2.xy;
>     
>     EmitVertex();
>     EndPrimitive();
> }
> 
> Any help is welcome!
> 
> Thank you!
> 
> Cheers,
> lin


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=73233#73233







More information about the osg-users mailing list