PDA

View Full Version : quick node tree UV shading question



monovich
09-09-2007, 10:36 PM
Hello,

I've got a quick one I can't seem to quite crack with nodes. I know it's simple, but my mind is to fuzzy to figure it out and I was hoping someone could shed light on it.

What I'm doing is using Revision Remapper (http://revisionfx.com/products/remap/) to re-map some rendered panels with images in After Effects.

What I need out of lightwave is a good render of the UV properly shaded for the format of the plugin, which would take the UV coordinates and shade them in green and red to create shading which the Remap plugin can use. The shading would actually look the same as it would if I mapped a simple red/green UV gradient (see below) to the image with the UV and set the luminosity to 100 and the diffuse to 0. That isn't ideal, though, because the output quality would be tied to the resolution of the map I used.

Instead of doing that, I'd like to use nodes to shade the UV info in an additive green and red, which would be resolution independent.

Can anyone shed light on what the node tree would look like?

thanks!

Stephen

Pomfried
09-10-2007, 06:14 AM
Hey,

there are several different approaches to do what you want.
One would be like in the attached screenshot. Just create one black to green gradient (with the values corresponding to the dimensions of your model), set the input to Y Coordinate, create another black to red gradient, but this time with the input set to X Coordinate and in the end add the two color outputs via the use of an Add Vector node plug that result into Diffuse Shading.

Another approach would be to use the Vertex Paint tool inside Modeler and either use the Vertex Color node plugged into Diffuse Shading or just set your Luminosity to 100% and Diffuse to 0% and select the Vertex Color map in the advanced tab of the surface editor . That's most likely easier to use, since you don't have to change the dimensions inside the node editor if you edit your model.

:)

monovich
09-11-2007, 12:08 PM
Pomfried, thanks for the reply! That first one looks very close, but it looks like it is using model geometry to render the gradients instead of UV information from a specified UV map (which could be handy in other cases). How do you hook up the green gradient to the U and the red gradient to a V?

thanks again! even what you posted was very insightful.

p.s. I tried this with an image map just to see how it works, and it looks like a great technique/plugin for my workflow. The Image map way does create a pixelated remap, but the node way won't once its working.
I'm using a timewarped camera in my comp, so there is no practical way to export my baked camera or corner pin info (at least not easily). That problem goes away in this case with the ability to use rendered UV output for texture mapping instead. This is even more handy because using a Real Lens camera created lens distortion that can't be easily matched in AE without this technique.

monovich
09-11-2007, 12:42 PM
Hmm...

I tried Denis' UV node, and plugged it into the color channel. Strangely it doesn't render the UV the way I thought it would. It seems to render it at 50% scale. Is this right?

I tried multiplying the xyz by 2.0, but that just made it brighter.

monovich
09-11-2007, 01:12 PM
ah. got it! I plugged Denis' node into the input of the gradient node. To get the right range I made the gradient from -.5 to .5 because I guess LW evaluates nodes in a way I didn't expect, so this normalized the data for the Re:map plugin

I had to "rotate" the data for the green (V) channel because the gradient was only seeing the (U) data.

thanks again Pomfried. Wouldn't have figured it out without you.

Pomfried
09-11-2007, 01:19 PM
ah. got it! I plugged Denis' node into the input of the gradient node. To get the right range I made the gradient from -.5 to .5 because I guess LW evaluates nodes in a way I didn't expect, so this normalized the data for the Re:map plugin

I had to "rotate" the data for the green (V) channel because the gradient was only seeing the (U) data.

thanks again Pomfried. Wouldn't have figured it out without you.

You are welcome :)
Didn't even know Denis released a UV node, I guess this might be handy at some point. And you don't need to use that rotate node, just use a vector to scalar node and be sure to select "Y Channel" (if I am not completely wrong now) in its properties. Otherwise, if you plug a vector output into a scalar one, LW will only use the first value (the X channel, or R in case of a color output) as an input value as far as I know.

dpont
09-11-2007, 01:22 PM
Since it is for exporting local or world position,
the UV node is recentered,
x = u - 0.5
y = v - 0.5
Hope that help.

Denis.

monovich
09-11-2007, 02:17 PM
more good info. thanks guys!

now that I think of it, that rotate trick would only work on a box like this. Everywhere else it would give you a messed up map with two U's (one rotated).

monovich
12-18-2007, 12:10 PM
for posterity, here is the node tree I used in the end, which worked quite well.

thanks all.