wireframe display with shaders

edited February 2014 in GLSL / Shaders

Hello! I'm practicing with shaders these days, and found this great ressource: http://www.creativeapplications.net/processing/geometry-textures-shaders-processing-tutorial/

I'd like to achieve the effect you see in the beginning of the video and here: http://www.creativeapplications.net/wp-content/uploads/2013/05/AmnonOwed-GTS-GLSL_SphereDisplacement01.jpg, displaying the texture of a shape only on his wireframe structure (this effect is not included in the sources of the tutorial).

Any idea?

Answers

  • Answer ✓

    Processing's inner architecture, especially related to OpenGL, is constantly changing.

    Right now, you could use the following code.

    // add global import
    import javax.media.opengl.GL2;
    
    // place before shader & shape calls in draw()
    GL2 gl = ((PJOGL)beginPGL()).gl.getGL2();
    gl.glPolygonMode( GL2.GL_FRONT_AND_BACK, GL2.GL_LINE );
    
    // place after shader & shape calls in draw()
    gl.glPolygonMode( GL2.GL_FRONT_AND_BACK, GL2.GL_FILL );
    endPGL();
    
  • thanks for your reply, it works!

  • Hi There. I was looking for the same effect, but on video capture.
    I want to display the video.start(); only on his wireframe. Can anyone help me?

Sign In or Register to comment.