Re: [osg-users] Generating a cube using geometry shaders

2014-09-18 Thread Ahmed Hesham
Hi Sebastian, SMesserschmidt wrote: 1. Is the shader really set to the correct state set? Try some simple non-geometry shader to see if it is working in general. I commented line 29 in the .cpp file that adds the geometry shader to the program, and a red point was displayed in the centre of

Re: [osg-users] Generating a cube using geometry shaders

2014-09-18 Thread Sebastian Messerschmidt
Most likely your geometry shader is broken. I can try to check it using your code later this afternoon (CET). Cheers Sebastian Hi Sebastian, SMesserschmidt wrote: 1. Is the shader really set to the correct state set? Try some simple non-geometry shader to see if it is working in general. I

Re: [osg-users] Generating a cube using geometry shaders

2014-09-18 Thread Sebastian Messerschmidt
Hi Ahmed, One thing which is definitely an error: You are never setting the type of the shaders. e.g. in your createProgram you should do: vertexShader-setType(osg::Shader::VERTEX); geometryShader-setType(osg::Shader::GEOMETRY); fragmentShader-setType(osg::Shader::FRAGMENT); Hi

Re: [osg-users] Generating a cube using geometry shaders

2014-09-18 Thread Ahmed Hesham
Hi Sebastian, SMesserschmidt wrote: One thing which is definitely an error: You are never setting the type of the shaders. Thank your for pointing that out but I'm sure that's not the problem. I'm using osgDB::readShaderFile to load the shaders sources from disk. The function uses

Re: [osg-users] Generating a cube using geometry shaders

2014-09-18 Thread Sebastian Messerschmidt
Hi Sebastian, SMesserschmidt wrote: One thing which is definitely an error: You are never setting the type of the shaders. Thank your for pointing that out but I'm sure that's not the problem. I'm using osgDB::readShaderFile to load the shaders sources from disk. The function uses

Re: [osg-users] Generating a cube using geometry shaders

2014-09-15 Thread Sebastian Messerschmidt
Hi Ahmed, Since your fragment is not executed (your point should be at least red) there might be 2 ways to inspect. 1. Is the shader really set to the correct state set? Try some simple non-geometry shader to see if it is working in general. 2. Are there errors when using the shader? Some

[osg-users] Generating a cube using geometry shaders

2014-09-14 Thread Ahmed Hesham
Hi, I'm trying to generate a cube using GLSL shaders. The basic idea is to pass a single vertex that represents the center of the cube, and let the geometry shader do the calculations. No luck so far, the only output I get is a single white pixel (point) in the center of the screen. C++/GLSL

Re: [osg-users] Generating a cube using geometry shaders

2014-09-14 Thread Ahmed Hesham
CPP file: Code: #include osgDB/ReadFile #include osgViewer/Viewer struct ModelViewProjectionMatrixCallback : public osg::Uniform::Callback { ModelViewProjectionMatrixCallback(osg::Camera *fCamera) : _camera(fCamera) { } virtual void operator()(osg::Uniform *uniform,