Maya for 3D Printing - Rapid Prototyping
In this course we're going to look at something a little different, creating technically accurate 3D printed parts.
# 1 16-01-2014 , 08:19 PM
Registered User
Join Date: Jan 2014
Posts: 2

Applying Gradient To Net with complex UVs

Hey everyone,

I've been working on a net sculpture using a custom plugin for Maya. While I am well versed in the modeling aspect, rendering is not my strong suit. The gist of my issue is that I've been trying to figure out how to add a color gradient to the net, from outside to inside, the only problem is that the polygon mesh is incredibly complex, not only is the net 3D, but each twine is a cylinder, all with their own independent UV properties. Based on internet advising, I have been trying to use a 2d image of the gradient as a means of app[lying color to the whole thing, but obviously that isn't working. If using an image isn't the smartest way of creating a gradient, might anyone have a better idea?

I've attached a link to a portion of the poly export (The whole thing is huge) and the image of the color gradient to give you an idea.

https://www.dropbox.com/sh/1irk2lkv1f0utt6/M7_mQSnbTE


Any help would be greatly appreciated!

# 2 21-01-2014 , 03:10 PM
LauriePriest's Avatar
Moderator
Join Date: May 2003
Location: London
Posts: 1,001
Right so your file isn't very useful as you using custom plugins which I don't have.

The solutions for this are simple but frustratingly difficult to do with out the box maya and you will probably need a little set of plugins. UV based texturing and shading is great for a painterly and non-destructive way of working with shading compared to lets say PTEX. However for the case you are describing its not suitable at all.

To do this in uv mapping it is possible but it would involve a script to do a one of calculation that you might as well do at render time.

When you say the outside to the inside of the net do you mean the front and back of the net surface or do you mean from the outside to the inside of the sculpture?

In the case that you want to effect the color of your net from the inside of the sculpture to the outside, one way would be to make an SDF volume representation of your sculpture (you can probably do this using the open VDB tool set) assuming you have a geometry representation. Then in the shader you just need to query the gradient of the volume with the world position of your shaded point (using the samplerInfo node and some shader plugin that can query volumes) then the resulting number will be a number telling you how far away you are from the surface of your volume. You can then use this to drive a color ramp.

If you are trying to solve the case where you want a gradient from the inside to outside face of your net then you will again need some other geometry that better represents the decision you are making. Assuming you have generated the net from a simpler 'parent' surface such as a plane or other mesh you just need the dot product of the world normal of your net (you can use the sampler info node for this) and the world normal of your 'parent' geometry (who's normals should represent the 'outward' facing direction of your net). This will give you a number from -1 to 1 saying which way the net point being shaded is facing which you can then use to drive a ramp. The main thing missing that you will need to achieve this is a point cloud generater and point cloud look up shader.

This kind of thing is much simpler in a package like houdni, where you can do all of this in around 5 minuites as it has a much stronger tool set to deal with volumes and a flexible shader writing environment where things like point cloud or volume look-ups are trivial.


FX supervisor - double negative
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads