PDA

View Full Version : Falloff of Texture Nodal



simpfendoerfer
06-04-2007, 03:23 PM
Anybody has an idea how to scale a texture across a distance in nodal?

I have a ripple texture around a point in the water and would like to flatten out the texture the farther I get away from the point. I also would like to be able to increase the distance over time.

Before nodal one could use a gradient with distance to object as alpha mask. But it could not be animated.

How do I do it in nodal?

I would appreciate any suggestions.

GregMalick
06-04-2007, 06:56 PM
Probably many ways.
A couple come to mind. These are gueses - I'll have to test them when I get home though...


Add a Scalar Layer Node and set it up to be a gradient with distance to object.
Feed the Scalar output into your Ripples Scale input.

OR

Add a Gradient Node and hook it's Alpha output into the Ripples Scale input.
Drive the Input of the Gradient node from a Distance node....

If this is a displacement you're doing, you can probably run the node into the transparancy.

eFFeFFe
06-13-2007, 08:52 AM
Hi ... Did someone maybe tested or created a node setup for this, I can't seem to find a node setup that can drive the 'distance to object' as an input for a gradient ...

tnx,
eF.

dpont
06-13-2007, 09:41 AM
The Distance node is located in Math->Vector,
then you need to input two positions as vectors
to output the result to the Gradient node.
The center of the object is output by the Item Info node
(select the object in its panel popup),
The spot which is evaluated in the node editor
is ouput by the Spot Info node (Object & World).
Then you must to know if you need Local(Object)
or World positions, in current map texturing we use
Local/Object coordinates.

Denis.

simpfendoerfer
06-13-2007, 10:15 AM
That's how I did it.

eFFeFFe
06-14-2007, 01:50 AM
Tnx! ... I managed to get it work ... What I wanted to do was to create a floor object that became more transparent. The transparency I wanted to control by a null, and the further away from the null (pivot) the more transparent the floor would get ...

In noticed when using the distance node that you don't have to drive the 'from' part of the dictance node ... If you would do that that then result of the distance node is, i guess, a constant value .. if you leave the 'from' part unassigned then it looks like he calculates the distance from any given point to the item precified in the 'to' part.

I attached my node setup, I also added a scalar and subtract node to enlarge the gradient without touching the gradient settings (keys) itself.

grtz,
ef.

dpont
06-14-2007, 03:08 AM
Yes, this is undocumented, but without input connection,
first vector (From) of Distance node is set to the Spot position,
the second (To) is set to <0 0 0>.
Here the Null selected in Item Info is animated in its X position
to increase/decrease the radial gradient.

47177

Denis.

simpfendoerfer
06-14-2007, 06:04 AM
Thanks, now I know how to do a radial gradient.

dpont
06-14-2007, 06:20 AM
My Vector constant <0 0 0> is useless,
we need only to connect the Reference Item Info
position to First (From) and leave empty the (To)
which means <0 0 0>.
The gradient is spherical but since my surface
is a plane we get only a sliced radial gradient.

Denis.

eFFeFFe
06-14-2007, 08:35 AM
Nice, it's clear now ...

... another thing that I can't seem to make with nodals (if you might be interested) :

I have a crust node (random dots) that I would like to use as an alpha. I also have a crumple node, and the crumple can only be visible depending on the dots created by the crust node, for instance as bump on a surface ... I can't seem to set the crust node as an alpha for the crumple node ... Tried to connect the alpha of the crust to the opacity of the crumple, didn't work. With a subtract node, or with bump layer nodes, with mixer nodes, ... all didn't work ... I'm previewing with Fprime ...

grtz,
ef.

dpont
06-14-2007, 08:52 AM
The simply way:
Input the crumple bump in vector input of a Math Vector Scale,
Invert the crust and input its alpha in the scale,
ouput the Math in bump.
You could use the Mixer node, crumple bump in bgcolor,
crust inverted alpha in opacity, but since it fails to connect
a color in bump root, use a Math Vector Scale (default 100%)
to bypass and connect the result to bump.

Denis.

dpont
06-14-2007, 09:09 AM
But no a more simply one:
47195

Denis.

eFFeFFe
06-14-2007, 09:17 AM
Denis, thanks again ... I worked fine ... but I do find it strange in logic that the alpha value drives the scale value of the math vector scale (?!) ... The other method with the mixer didn't work for me ... I guess you connect then the color output of the mixer with the vector input of the math vector scale en then the result of math vector scale to the bump root of your surface. ... When doing that I get strange dark shading ... as maybe mentioned in the documentation ...
"Care should be taken when connecting to this input. Connecting dissimilar types or non directional vectors may cause the surface to shade wrongly."

grtz,
ef.

blabberlicious
06-14-2007, 10:02 AM
That's for the tip...but I have a further problem.

I need to be able to animate the floor glow radiating from this object.

1. The glows (I animate the gradient using the method desribed)

2. The bject moves off across the floor.

3. The animated glow needs to stick to the pivot point of the Object and move


This is a trifle in layers....

How do I do it in Nodal???

Many thanks


http://farm2.static.flickr.com/1167/548118151_43320a3440_o.jpg

dpont
06-14-2007, 10:45 AM
but I do find it strange in logic that the alpha value drives the scale value of the math vector scale (?!) ...
the crust BumpAmp is scaled by bump vector this is the same thing
than scaling the bump vector by the crust. (scaling=multiply)


other method with the mixer didn't work for me
It should,
the color is a clamped positive vertor, the Bump vector (as bgcolor)
is scaled by the crust opacity (the alpha need to be inverted in crust)
then the bypass is easy (this is illegal, but it works).


1. The glows (I animate the gradient using the method desribed)

2. The object moves off across the floor.

3. The animated glow needs to [B]stick to the pivot point of the Object and move[/QUOTE]

You need to add the Object (Pivot) as reference with an
Item Info position to replace the <0 0 0> of the distance
for gradient input.
Then parent the Null to the object and leave the distance for the Key
of the gradient with same settings.
This Reference Null could be replaced by an animated (envelope)
constant scalar to vary the diameter of the gradient.

blabberlicious
06-14-2007, 10:46 AM
I got it working, just as you described, a few seconds after I posted!


Many thanks.

dpont
06-14-2007, 11:03 AM
The others complicated/illegal method:
With Math:
47198
With Mixer:
47197

Denis.

dpont
06-14-2007, 11:12 AM
What I missed to explain is that you
can input the crumple bump either in fg or bgcolor,
but the other color must be a pure black = zero bump.

Denis.

eFFeFFe
06-15-2007, 01:25 AM
More enlightening ! tnx Denis ... What is was wandering then from the mixer method, ... can't you directly connect the alpha from the crust to the opacity of the crumple and the connect the bump of the crumple to the root bump, that didn't seem to work for me, maybe my fore and background color of the crumple where wrong, gonna try some more ...

dpont
06-15-2007, 01:31 AM
In LW procedurals the opacity doesn't control the bumpiness,
it is replaced by the bump amplitude.

Denis.

blabberlicious
06-15-2007, 01:34 AM
3. The animated glow needs to [B]stick to the pivot point of the Object and move

You need to add the Object (Pivot) as reference with an
Item Info position to replace the <0 0 0> of the distance
for gradient input.
Then parent the Null to the object and leave the distance for the Key
of the gradient with same settings.
This Reference Null could be replaced by an animated (envelope)
constant scalar to vary the diameter of the gradient.[/QUOTE]



If I have more than one Key in my gradient, and I want the 'inner' keys (between 0 and 1) and my outer 'falloff' key to maintain a relationship, how would I do that?

I guess I might have to add a multiplier to each 'child' of the falloff key, that offsets its position relative to the value of the 'parent' key?

Does that make sense - or is there an easier way to do it?



The reason I ask is that I want the same gradient to control the Luminosity of the glows, but I need more control for the falloff of the alpha > lum. So I'd like to be able to use the same gradients & control alpha to drive the scalar>Lum.


I appreciate you help on this!


It's a shame you get no visual feedback onb thhe gradient when a keys inout changes.

dpont
06-15-2007, 02:01 AM
If you have more than one input key in Gradient node,
you could try to input a Constant scalar (node) for each
key and scale all of them (Math Scalar) by the reference distance,
a tedious task.

Denis.

blabberlicious
06-15-2007, 02:18 AM
I feel a node coming on!

Creating a 'concertina' type gradient input relationship - seem like something you'd want to use a lot.

Being able to animate gradients is all very well - but it's quote rare that I would want to use a simple two key gradient.


Thanks for the reply - keep up the good work

dpont
06-16-2007, 01:01 AM
I forgot that we can use the Scale node from DP Kit,
especially if you are using a lot of keys in Gradient node,
but if you are using the default Distance node with
nothing in "From", the distance is calculated with
World position of spot (until you connect the object spot
instead), in this case you must check "World Coordinates"
in the Scale node, the scale factor could be animated
as well for each axes.
47247

Denis.

Thomas M.
06-16-2007, 01:48 AM
Just one question. Is there a way to avoid a null or any object as a reference and still have a way in nodal editor to turn and move the texture centers of 2d/3d textures? The input is there, but no rotation or position output from a turn/move node.

Cheers
Thomas

dpont
06-16-2007, 02:53 AM
Not sure to understand your question or the context.
The center of a 2D/3D texture node is the position parameter
of its transformation panel that can be also input from any
Vector output of another node, that moves the whole texture
for this node only.
If you use a Move node (companion of above Scale node)
you can move all 2D/3D texture nodes connected in the
node chain (color/scalar or bump), even a Spot Info
position connected before will be modified/altered by
this node (i.e: the Default distance which uses a World
Spot position).


Denis.

blabberlicious
06-16-2007, 03:24 AM
I forgot that we can use the Scale node from DP Kit,
especially if you are using a lot of keys in Gradient node,
but if you are using the default Distance node with
nothing in "From", the distance is calculated with
World position of spot (until you connect the object spot
instead), in this case you must check "World Coordinates"
in the Scale node, the scale factor could be animated
as well for each axes.
47247

Denis.


Fantastic!

Thomas M.
06-16-2007, 05:33 AM
And what abou the rotration node? In the end I just want to avoid the texture reference null (as it is scene related) and be able to change the position, scale and rotation of all nodes at the same time. Isn't a vector just a direction? It wouldn't work for rotations, or?

dpont
06-16-2007, 08:22 AM
There could be confusion in terms, because
currently we are calling a vertor any type of
triplet numbers <x,y,z> or <h,p,b> and even
a color <r,g,b> or <h,s,v>, but in nodes color
has a separate definition because it is stictly
a positive clamped vector between
<0,0,0> and <1,1,1>.


A direction is a different vector like a normal
it is often normalized between <-1,-1,-1> and
<1,1,1>, it is used mainly for raytrace functions.

As I now a Rotation for texture is defined as a vector,
or three Heading/Pitch/Bank angles expressed in degrees,
but a rotation could be expressed also with three
vector/direction Right/Up/Forward like in output of
Spot and Item Info nodes.

The rotation node need a vector of three angles in
degrees like any texture transformation panel,
but internally it converts them as Right/Up/Forward
vectors to rotate the Spot.

You can use the Position/Rotation/Scale nodes
of DP Kit at the end of the node tree just before
connecting output to the node editor root.

Denis.

blabberlicious
06-16-2007, 09:48 AM
I forgot that we can use the Scale node from DP Kit,
especially if you are using a lot of keys in Gradient node,
but if you are using the default Distance node with
nothing in "From", the distance is calculated with
World position of spot (until you connect the object spot
instead), in this case you must check "World Coordinates"
in the Scale node, the scale factor could be animated
as well for each axes.
47247

Denis.


Is there a mac version of this?


Many thanks

dpont
06-16-2007, 10:03 AM
An OSX version is planed.

Denis.

Lightwolf
06-17-2007, 09:28 AM
Is there a mac version of this?

Blame me if it doesn't show up soon ;)

Cheers,
Mike