another vertex_attribute shader example

Jan 22, 2009 at 10:47pm

another vertex_attribute shader example

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

#41892
Jan 23, 2009 at 12:06am

great patch!
thanks for sharing.

#149493
Jan 23, 2009 at 3:46am

wow it’s beautiful,
thank you for sharing

#149494
Jan 28, 2009 at 12:38am

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

#149495
Jan 28, 2009 at 1:24pm

> 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

#149496
Feb 28, 2009 at 10:43am

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…

#149497
May 7, 2011 at 5:01pm

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?

#149498
Apr 5, 2012 at 9:17am

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.

#149499

You must be logged in to reply to this topic.