Image filters that use Vertex Shaders - how?

I have been using the Image Filter example project some, and am wondering how to create a similar project, where I can also manipulate a vertex shader, and the amount of vertices the grid has. Perhaps, even change the geometry altogether to some other Vuo object, like a sphere. Basically, if I could see how a height field works, it would be great… I enjoy making that kind of thing, and once I see how that goes down, I could add noise/waves, etc., and make some art in a manner I’m accustomed to.

I’d probably rather handle the geometry via Vuo meshes, if it makes sense to do it that way.

That said, I wouldn’t mind seeing some kind of example that draws some OpenGL geometry, and textures it with a shader….perhaps something like a “ribbon drawing” example.

Checkout what I got going based on the make wireframe shader example (I don’t know how to make the image display in the body of the thread here).

It’s patch that outputs a shader that can be applied to a Vuo Scene Object, like the sphere in this case.

I added in the image input/sampling, and uncommented the texture coord stuff that was already setup. I eliminated some of the geometry shader instances because they were unneeded.

The color is a debug thing…texture positions.

The test.adjustColorBrightness example node and most vuo.image nodes use the VuoImageRenderer API, which is loosely equivalent to Core Image: it takes a fragment shader that can remap individual pixels. VuoImageRenderer provides a passthru vertex shader, and renders a quad onto an FBO.

If you’re interested in doing more complex rendering inside a node — like providing geometry other than a quad, or performing 3D transforms, or providing a vertex or geometry shader — check out the VuoSceneRenderer API. The source code to the Rotate Image node shows how you can use VuoSceneRenderer to set up a scenegraph, render onto an FBO, and output an image from it.

To create a VuoSceneObject from vertex data, you could use VuoMesh_makeFromSingleSubmesh(), and feed the result to VuoSceneObject_make(). Or use VuoMeshParametric_generate().

And the source code to vuo.shader.make.wireframe shows how you can construct a VuoShader consisting of vertex+geometry+fragment GLSL phases.

Thanks Steve. When I posted this, and a couple more questions, I had forgotten that the code for the built in patches was available.