Metaball and shaders

   8155   7   1
User Avatar
Member
22 posts
Joined: July 2005
Offline
i was wondering if you can have two metaballs with different shaders on each.

i tried attaching one shader (ie. blue) to one metaball, and attaching another shader (ie. red) to the other metaball. but when i render it, both of the metaballs are red.

is there a way so that one is red and one is blue?
User Avatar
Member
412 posts
Joined: July 2005
Offline
You can do it through coloring each of the metaballs through the point sop. After merging, the colors will even mix correctly.

As far as an output goes..you can render at the merge sop and render through the open gl rop (either as shaded or wireframe). If you want to actually render through mantra, you will have to add a shader after the merge. In the diffuse of the shader (i used a vex layered), put Cr,Cg,Cb in the fields. Then render with mantra, and voila, colored metaballs.

As far as having different textured shaders on each of the metaballs, that might be tough. Don't have a solution for that one yet and don't know if there will be one.

Here's an example file, if you're interested..


http://studentpages.scad.edu/~dquiru20/metacolor.hip [studentpages.scad.edu]

Dave
Dave Quirus
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Yah, that would be tough. It's one thing to have a colour attribute that can be associated with a metaball, but the only way a detailed texture could work would be with shader strings via the shader SOP…and how do you “interpolate” between two shader strings?

Cheers.

J.C.
John Coldrick
User Avatar
Member
344 posts
Joined: July 2005
Offline
Check this out.

Metaballs with blended shaders



Metaballs with blended textures



Made an attribute for the metaballs and used it as a bias for a layered VOP shader. You can belnd as many as you want, but you have to daisy chain your networks in SOPs and VOPs to do it.

http://s91408461.onlinehome.us/meta.hipnc [s91408461.onlinehome.us]

I'm rendering an animation of the paint version. Will post it later.
User Avatar
Member
4140 posts
Joined: July 2005
Offline
Well, yah, if you want to use the method I suggested elsewhere, *sure*…



Cheers,

J.C.
John Coldrick
User Avatar
Member
412 posts
Joined: July 2005
Offline
Well, yah, if you want to use the method I suggested elsewhere, *sure*…

hahahaha..


yeaaaaa.. but now the trick is to have the metaball algorithm decide the blending as opposed to manually blending them by hand. :wink:
Dave Quirus
User Avatar
Member
344 posts
Joined: July 2005
Offline
http://s91408461.onlinehome.us/junk/painty2.mov [s91408461.onlinehome.us]

Here's a quicktime. It seems to look best in this case if you use lots of larger metaballs with miniscule weights.


What can I say? It was a good idea and it has millions of uses It''s like a whole new world of possibilities for shader creation has been opened to me.

You can really get crazy with this. You can use custom attributes to index shaders, you can blend them based on weight, and you can pass attributes back and forth with attribute transfer, modifiy attributes based on collision…

It's tons of fun to play with!
User Avatar
Member
412 posts
Joined: July 2005
Offline
here we go.. texture blends based off of the metaball fields. too bad you're limited to three metaballs with this method (just used the rgb channel data as reference for the blending)… still neat none the less.




http://studentpages.scad.edu/~dquiru20/metacolor.hip [studentpages.scad.edu]


Neat blobby stuff Michael. Pretty cool stuff. I'd love to see anything else you adventure in to with this method of texturing. Keep me updated.
Dave Quirus
  • Quick Links