<div dir="ltr"><div>Ok - going to finish up with this last update.  <br><br>Up to 16 attributes can be used now.  All types are supported (float, vec2-4, mat2-4).<br></div>All bugs/weird errors removed.  Help file changes included.<br>
<div><br>Still no uniforms.. so as default, all variables for the frag shader need to be converted to "varying" in vert shader.<br><br></div><div>If anyone has any ideas to expand on this feel free to email.  Thank you.<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 30, 2014 at 11:27 PM, j-p <span dir="ltr"><<a href="mailto:jptrkz@gmail.com" target="_blank">jptrkz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Here is a working example.  If it succeeds, you should see four quads with unique shader qualities.<br><br></div>I'm happy with the design but it needs further changes - for example - I was unable to build a class object array without errors at the constructor stage.  Right now there are 5 fixed vbos added for attributes - enough for the demo.<br>

<br></div><div>Also I think "uniform" types should be added.  <br><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 28, 2014 at 1:57 PM, j-p <span dir="ltr"><<a href="mailto:jptrkz@gmail.com" target="_blank">jptrkz@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ok figured it out - have a working link between shader and gemvertexbuffer.  Will send a full 1st draft cpp/h sometime in next two weeks hopefully.<br>

</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Aug 27, 2014 at 2:19 PM, j-p <span dir="ltr"><<a href="mailto:jptrkz@gmail.com" target="_blank">jptrkz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr"><div>(follow up)<br><br>Below is the test setup for a user-defined attribute in gemvertexbuffer.cpp:<br>(m_shader is the 5th vbo for test, attribute index is set to 0)<br></div>(just for this test I have set the program parameter in "glBindAttribLocation" to "1" because of this output when a glsl_program is linked with vert/frag shaders for the first time: <br>



"[glsl_program]: linked shaders 4 2: 1")<br><div><br>code:<br><br>if(m_shader.render()) {<br>glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0);     // index, size, etc etc<br>glEnableVertexAttribArray(0);    // index<br>



glBindAttribLocation(1, 0, "gemAttrib1");       // program, index, attribute<br>}<br><br></div><div>I use "gemAttrib1" to set the fragColor but it's not working.  <br><br></div><div>vert file:<br>


<br>
attribute vec4 gemAttrib1;<br>varying vec4 color1;<br><br>void main()<br>{<br>   color1 = gemAttrib1;<br>   gl_Position = ftransform();<br>}<br><br></div><div>frag file:<br><br>varying vec4 color1;<br>void main()<br>{<br>



gl_FragColor = color1;<br>}<br><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 26, 2014 at 11:48 PM, j-p <span dir="ltr"><<a href="mailto:jptrkz@gmail.com" target="_blank">jptrkz@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Had a dummy vec4 using glVertexAttribPointer ready to test before realizing there's no way to send the values over to the shader without the "program" parameter.  Could the right outlet of glsl_program (the one that sends out the ID number) work for this?<br>




</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 25, 2014 at 11:23 AM, Jack <span dir="ltr"><<a href="mailto:jack@rybn.org" target="_blank">jack@rybn.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Would be very nice !<br>
      ++<br>
      <br>
      Jack<br>
      <br>
      <br>
      <br>
      Le 25/08/2014 17:10, IOhannes m zmölnig a écrit :<br>
    </div>
    <blockquote type="cite"><div><div>
      <pre>On 08/25/2014 03:49 PM, j-p wrote:
</pre>
      <blockquote type="cite">
        <pre> I think at some point I'll
attempt a mod for gemvertexbuffer to add user-defined attributes that can
be passed to the vertex-shader.
</pre>
      </blockquote>
      <pre>yes, that would be great.

gfmadsr
IOhannes

</pre>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><div><pre>_______________________________________________
GEM-dev mailing list
<a href="mailto:GEM-dev@lists.iem.at" target="_blank">GEM-dev@lists.iem.at</a>
<a href="http://lists.puredata.info/listinfo/gem-dev" target="_blank">http://lists.puredata.info/listinfo/gem-dev</a>
</pre>
    </div></blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
GEM-dev mailing list<br>
<a href="mailto:GEM-dev@lists.iem.at" target="_blank">GEM-dev@lists.iem.at</a><br>
<a href="http://lists.puredata.info/listinfo/gem-dev" target="_blank">http://lists.puredata.info/listinfo/gem-dev</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>