Forums > Jitter

another vertex_attribute shader example

January 22, 2009 | 10:47 pm

Here’s another example of a shader using vertex attributes. A matrix
generated by jit.bfg manipulates the geometry and the colour of the primitve
in jit.gl.mesh on the GPU.

http://wiki.pelado.co.uk/jitter/shaders/vertex_attribute

pelado


January 23, 2009 | 12:06 am

great patch!
thanks for sharing.


January 23, 2009 | 3:46 am

wow it’s beautiful,
thank you for sharing


January 28, 2009 | 12:38 am

I was just experimenting with creating geometry with this BFG + gridshape method, this is a cool shader to use with it. Im not sure if I understand the use of the morph parameter, it seems to do the same thing as the weight parameter of the BFG, is this true?

Very cool shader, good work


January 28, 2009 | 1:24 pm

> I was just experimenting with creating geometry with this BFG + gridshape
> method, this is a cool shader to use with it. Im not sure if I understand
> the use of the morph parameter, it seems to do the same thing as the weight
> parameter of the BFG, is this true?
>
> Very cool shader, good work
>

Taking a look at the shader jxs file you’ll see the following line:

vec4 pos = mix(gl_Vertex, ATTR_vertex , morph);

– gl_Vertex is a GLSL attribute that takes the values declared by
openGL. In this example, it is the matrix that is passed from
jit.gl.gridshape to the left input of jit.gl.mesh.
– ATTR_Vertex is the vertex attribute passed to jit.gl.mesh and is the
matrix generated by jit.bfg.
– morph is the variable that returns the mix (a linear blend) between
these two matrices.

Give morph a value of 0. and the resultant matrix will be that described by
the vertex matrix of jit.gl.mesh (which is in fact the matrix output by
jit.gl.gridshape). With a value of 1. the matrix will be the same as that
generated by jit.bfg. Hope that helps to describe what is going on in the
shader.

The weight attribute in jit.bfg is a scaling factor for the matrix that it
generates

Thanks to Georg Bosch the example file is now also available in Max 4
format.

pelado



dtr
February 28, 2009 | 10:43 am

great! in a project i’m creating similar complex gradient patterns. i had to use gradient images drawn in illustrator as masks for blending with slabs. next step was going to be working out how to generate the masking gradient patterns in max. guess i ve got my answer right there!

i need to learn coding shaders asap…


May 7, 2011 | 5:01 pm

hi. pelado’s website seems to no longer exist.
Does anyone have p.jit.gl externals as a zip file that they could email to me please?


April 5, 2012 | 9:17 am

I was searching about Mesh and found this old thread, does anyone have Pelado’s vertex_attribute shader ? That one seems particularly interesting !

@AgentSpock, I have the p.jit.gl.shader and p.jit.gl.tools_package if you are still interested.


Viewing 8 posts - 1 through 8 (of 8 total)