Forums > Jitter

Globally set material for gridshapes without changing color

January 25, 2013 | 5:39 pm

Hello Again Community,

I’ve got a patch which is parsing incoming OSC messages and generating sphere gridshapes dynamically. I’ve got the colors of the individual spheres (see the ‘balls’ subpatcher) as arguments in their objects, but there’s a jit.gl.material which is globally setting the texture of the spheres. Since this animation is reminiscent of planets in orbit, I wanted to try setting the texture of the global material object to the packaged dirt.wall. Doing so cancels out my sphere’s selected colors. Anyone see what I need to do to retain the selected color, but apply a different texture from the global jit.gl.material object? Or do I need to add names/flags to make this work?

Thanks!

Attachments:
  1. spheres.maxpat

January 25, 2013 | 9:50 pm

when you load the dirt.wall material file (either using the @matfile attribute, or from the material browser) it forces the jit.gl.material object to override any color values on your attached gl objects.

jit.gl.material will override attributes of attached objects, whenever you provide a value for that attribute, and loading a material file usually provides those attributes.

the solution is to not provide those attributes to the gl.material object, and instead manually build your material using the texture inputs and material options.

the below patch should get you started, let me know if you have questions.
the built-in material files all live in Max6/Cycling ’74/jitter-materials/dirt.wall.jitmtl
and are just text file that can be opened in any text editor.

– Pasted Max Patch, click to expand. –

January 28, 2013 | 4:08 pm

Thank you, Rob. The solution is beautifully simplistic! And thanks for all your work on the excellent tutorials you do on the site. They are certainly a source of inspiration!

Random question: Are there any Max/MSP/Jitter training programs, university programs or even instruction offered by Cycling 74 that you could recommend? I’m learning a ton just through the forums, but could use some traditional teaching regarding jitter expressions and the more complex objects available.


January 28, 2013 | 5:47 pm

hi
Peter Elsea wrote some amazing jitter tutorials: ftp://arts.ucsc.edu/pub/ems/maxtutors/Jit.tutorials/


January 29, 2013 | 7:39 pm

make sure you check out the tutorials link above:

http://cycling74.com/category/articles/tutorials/

specifically, this one:

http://cycling74.com/2010/03/08/demystifying-expressions-in-jitter/


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