31
Jan
08

Vertex Noise Fun

I’ve been having fun messing around with the Vertex Noise shader from the GLSL Orange Book.

I took the Quartz Composer version from the QC 3.0 Developer Examples folder as a starting point, and added some new features and tweaks.

Here are some examples of the shader’s output:

Vertex Noise Edit 310108 01Vertex Noise Edit 310108 02
Vertex Noise Edit 310108 03

OpenGL sometimes has problems showing the back faces through the transparent areas (an issue known as z-fighting), so rendering is a bit glitchy at times, but it’s still quite cool.

I’ve added inertia to all the controls too, which makes using it more fun, I think!


6 Responses to “Vertex Noise Fun”


  1. January 31, 2008 at 9:44 pm

    OpenGL even with glEnable(GL_DEPTH_TEST) will not always draw things “properly” because of vertex ordering. If your geometry is opaque it wont matter, but if it has transparency there can be ordering issues. Remember openGL uses the painters algorithm, and depth testing happens when you draw your verts, so if you draw verts front to back, you will get visual glitches/errors, and you will have to correct for your camera positioning, which is generally called Z order or Z sorting problems. Solutions can be a pain to program, but to be correct they are typically required. I dont bother 🙂

    BTW, looks nice 🙂

    I need to get my shit together and start being more active in QC land. Har. Nice work!

  2. January 31, 2008 at 10:10 pm

    Hi
    How are you generating those shapes?
    are you using a special patch?
    will you post the files?

    cheers

    Alex

  3. 3 toneburst
    January 31, 2008 at 11:26 pm

    Hi vade!

    I’ve been reading about z-ordering glitches, so I pretty-much knew I was going to hit this problem. I’m not sure there’s a workaround in GLSL. If you had direct access to the mesh polygons, I guess you could change the order they were drawn in on-the-fly, but with only access to the vertices, I don’t see how you could do this. Having said that, I’m really hazy about all this 3D stuff. I’ve been concentrating almost exclusively on 2D image-mangling so far, so I’ve got a long way to go before I understand the subtleties of OpenGL’s 3D world…

    I does look nice though. The plan is to try and convert some of my simple waveform algorithms so they work in the Vertex Shader, then maybe try and get them to work in polar space, to distort a sphere in different geometric ways. Might have to draft in my maths-graduate brother again, I think 😉

    Catch you in the VDMX chat sometime,

    alx

  4. 4 toneburst
    January 31, 2008 at 11:32 pm

    Hi Alex,

    this is a tweaked version of the ‘Vertex Noise.qtz’ Quartz Composer composition that comes in the ‘/Developer/Examples/Quartz Composer/Compositions/GLSL’ folder. If you have the Developer Tools installed under Leopard, you’ll have it.

    I’ve added extra controls for rotation and zoom and extra code to the Fragment shader to create the stripes.

    There’s no special extra plugin involved; it’s all done with Vertex and Fragment Shader code in a GLSL patch.

    alx

  5. 5 ian
    February 4, 2008 at 10:10 pm

    Hi, I really like the simplicity of the undulating sphere ribbons. The stills look great – very Bridget Riley! You inspired me to take a look at making stripes in GLSL, and taking apart the vertex noise and the lattice examples. I am slowly ‘getting it’. QC3 really helps to test this stuff out.

    I’d be keen if you could shed some light on the ‘inertia’ expression you mention.

    Nioe work! All the best, Ian

  6. 6 toneburst
    February 4, 2008 at 10:27 pm

    Hi ian,

    cheers!
    I’m quite a fan of Bridget Riley, as it happens, so that’s a gret compliment!

    QC is great for quickly testing ideas, definitely.

    Any chance of seeing some of your experiments?

    By ‘Inertia’ I basically just meant I’ve slapped the ‘Smooth’ patch on all the controls, so when you rotate the objects, for example, it gradually slows to a stop when you let go of the control. I’ve added Smoothing to most of the parameters, including the inputs to the noise function which distort the goemetry.

    Thanks for the encouraging comments!

    alx


Leave a comment


January 2008
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Links

Blog Stats

  • 502,072 hits