OpenGL output issues with varying rendering methods


    Mar 31 2006 | 2:56 am
    hi,
    im wondering about why the following patch has different output depending on my rendering method
    Im sending the same geometry matrix to jit.gl.render, sketch and mesh, and each one looks different.
    Id love to be enlightened as to why. Im assuming it has something to do with normals.
    Thanks in advance,
    v a d e //
    www.vade.info abstrakt.vade.info
    I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE!
    You will not be saved by the Holy Ghost. You will not be saved by the God Plutonium.
    In fact, YOU WILL NOT BE SAVED!

    • Apr 01 2006 | 8:46 pm
      Hi,
      No one has any clue about this? Id love to get a thought from the hard core Jitter folk...
      v a d e //
      www.vade.info abstrakt.vade.info
    • Apr 01 2006 | 10:32 pm
      Hey there, I took a look at your patch. The obj works nicely because it takes it's normals from the text file. So, whatever program generated the obj file also generated the normals to make it look proper.
      The mesh object doesn't do a good job of "smooth shading" when in @draw_mode triangles. If you don't give it a normals matrix, and set @auto_normals 1 it jit.gl.mesh will make it look bizarre because it uses the triangle vertices (a guess here) to calculate the normal. Depending on vertex winding and thus which way the normal is facing, you will get a jagged, checkered look. If however, you explicity set the vertex matrix by sending a 3 plane matrix in the 3rd inlet, it will look just like jit.gl.model's results. For some reason, sending an 8 plane matrix in jit.gl.mesh's first inlet doesn't set the normal matrix like I thought it was supposed to. So, you have to break the matrix up and set the matrices on a per inlet basis. Personally, I think the jit.gl.mesh object could use this feature as it would be very simple to add as it is a pain in the ass to unpack and repack matrices for opengl geometry.
      As far as the sketch results are concerned, I haven't a clue.
      The patch below shows how to get good results from jit.gl.mesh.
      best, wes
    • Apr 02 2006 | 12:36 am
      Ah, Wesley, thanks. For some reason I hadn't thought of manually packing/unpacking the normal array from the model output. Thanks - that makes total sense.
      I humbly submit a request to have jit.gl.mesh take the normals from the 8 or 13 plane matrix that would 'normally' (no pun intended) come out of any gl object with matrixoutput 1 enabled. perhaps it would only be overridden if one manually entered a textcordinate array or normals array to the proper input.
      Ive shunted in your version wes to my main patch and it works fine. Thanks.
      as for jit.gl.sketch.. anyone? Ive tried playing with the syntax drawmatrix triangles 0 0 0 0 or 0 0 2 2 etc etc, with no luck.
      any idea about jit.gl.sketch anyone?
      v a d e //
      www.vade.info abstrakt.vade.info
      I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE!
      You will not be saved by the Holy Ghost. You will not be saved by the God Plutonium.
      In fact, YOU WILL NOT BE SAVED!