Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-07 Thread deniz diktas
Hi, you are outputting the position as color, that's why you see black (because these have negative coordinate values) and the three values. Just set an arbitrary fixed color value in the frag-shader to see anything. But if you need to see colors, then you need to define your own vertex

Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-07 Thread John Moore
Actually I solved it... one of the problems was that the number I was using for the attribute was too big (or reserved). I am forced to use OpenGL ES 2.0 because I develop on iOS platform! Thank you anyway for your advice. Cheers, John This is the working code Code: #define

Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-07 Thread John Moore
I want to add that this is the fragment shader I used for drawing the wireframe model Code: precision highp float; varying vec3 vBC; #extension GL_OES_standard_derivatives : enable float edgeFactor(){ vec3 d = fwidth(vBC); vec3 a3 = smoothstep(vec3(0.0), d*1.0, vBC); return

Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-07 Thread deniz diktas
Hi, for learning basic shader programming you do not have to constrain yourself to opengl es 2.0. It is sufficient to do the same basic stuff with OGL 3.0 in order at least to understand the difference between assigning a coordinate value and a color value as the final fragment value. I

Re: [osg-users] Drawing lines using OpenGL ES 2.0

2013-11-04 Thread John Moore
I found a solution which involves computing the barycentric coordinates. However it seems that is not working properly. To compute the barycentric coordinates I need to associate to the vertices of the triangles a coordinate among (1,0,0) (0,1,0) (0,0,1) for doing that I use the following

[osg-users] Drawing lines using OpenGL ES 2.0

2013-11-03 Thread John Moore
Hi, I am using OpenSceneGraph on iOS, using OpenGL ES 2.0. I am having hard time to figure out how to draw polygon lines using shaders. I'd like to draw a simple box with lines. However I can't find a way because osg::PolygonMode::LINE does not work. In fact