PDA

View Full Version : Blending surfaces with gradient....



blackmondy
08-26-2017, 04:24 PM
As in creating a seamless transition between two parts on a same object. Can it be controlled with weight-maps or gradient ?

Danner
08-26-2017, 04:50 PM
Not two surfaces per se, but you can have two totally different looks in one surface and blend them with weight maps using them as alpha in the layerered textures, or have two completely different shaders and mix them with nodes.

blackmondy
08-27-2017, 08:03 AM
Thanks for the helpful reply. :)

Surrealist.
08-27-2017, 10:27 AM
You can also use the Surface Mixer Shader. Will mix between two surfaces in your scene using the Texture Editor and it can also be animated using the Graph Editor.

137774

blackmondy
08-27-2017, 10:46 AM
You can also use the Surface Mixer Shader. Will mix between two surfaces in your scene using the Texture Editor and it can also be animated using the Graph Editor.

137774

Thanks :)

prometheus
08-27-2017, 01:45 PM
Yep..lot of options here, and to further aid with what Danner said..

you would need to copy weightmap and color map to the bump channels as well, and maybe invert some of the maps, add specularity gradient set to bump, and you will only have specularity on one texture, and corresponding bump map based on the two different color images.. if it is set up correctly in the bump channel with the weigth maps.

though it may be better to use surface mixer or going nodal..it is possible to do it within standard layering.

http://forums.newtek.com/attachment.php?attachmentid=137775&d=1503862930

137775

blackmondy
08-27-2017, 01:51 PM
Yep..lot of options here, and to further aid with what Danner said..

you would need to copy weightmap and color map to the bump channels as well, and maybe invert some of the maps, add specularity gradient set to bump, and you will only have specularity on one texture, and corresponding bump map based on the two different color images.. if it is set up correctly in the bump channel with the weigth maps.

though it may be better to use surface mixer or going nodal..it is possible to do it within standard layering.

http://forums.newtek.com/attachment.php?attachmentid=137775&d=1503862930

137775

Thanks :)

I was thinking of using nodes to accomplish this. The traditional texture-layering way is too limited by today's standards.

prometheus
08-27-2017, 02:16 PM
Thanks :)

I was thinking of using nodes to accomplish this. The traditional texture-layering way is too limited by today's standards.

Absolutely...I have no objections on that approach, just wanted to show the fast old crude way...if that would have been all you needed.

Surrealist.
08-27-2017, 02:31 PM
Yep it is good to know options. Nodes would open up a world of possibilities. But if you need it quick and dirty Surface Mixer is good.

blackmondy
08-28-2017, 08:23 AM
Found a great video by William Vaughan on this topic.


https://www.youtube.com/watch?v=2mAK_bRnmC8

lertola2
08-28-2017, 06:50 PM
You can also use the Surface Mixer Shader. Will mix between two surfaces in your scene using the Texture Editor and it can also be animated using the Graph Editor.

137774

I have been using Lightwave for about 20 years and I never found out about Surface Mixer. I wonder what other goodies are hanging out in Lightwave that I don't know about.

Surrealist.
08-28-2017, 07:46 PM
Lol yeah. Something to keep in mind is also that since it is on the surface or level it can be a node based surface AFAIK. Something we have been waiting a long time for though is Nodes option each time we click on a T button.

jeric_synergy
08-28-2017, 10:39 PM
I have been using Lightwave for about 20 years and I never found out about Surface Mixer. I wonder what other goodies are hanging out in Lightwave that I don't know about.

What I newly learned is you can create a W.Map w/o having anything selected, and it still works. D'oh!

Scazzino
08-29-2017, 09:50 AM
You can even tie the transition from node map to node map to other controls as well. In this project I'm transitioning from one node map to another to drive both a displacement map as well as using the same node map in the surface editor to also control the surfaces. In this case I've tied a bunch of scalar nodes to the Y position of a set of nulls. These control the transition from one compound node map to another over time as well as controlling the depth of various parts of the displacement maps within the compound maps. Nodes are pretty powerful!

137780

jeric_synergy
08-29-2017, 10:35 AM
Speaking of weight maps: is there a difference between an UNASSIGNED weight map value and a value of ZERO%? I always thought there was, but another William Vaughn video, https://www.youtube.com/watch?v=TtqK7X34Gt4 , makes me wonder if I have Yet Another Weight Map Value Misconception (YAWMVM). :cry:

Scazzino
08-29-2017, 11:05 AM
Haven't tested it lately, but yes there used to be at least. I do all my modeling in modo and it treated interpolation from unassigned weight map points as zero through the subdivided mesh, as LW Modeler did, but LightWave Layout interpolated them differently. So I always got into the habit of starting any weight map by setting all the points around the area that I was working with specifically to zero. Not sure if that's been fixed lately, but I just do that by habit now.

Scazzino
08-29-2017, 11:13 AM
Here's an excerpt from my book about what it used to do anyway. Regarding unset weight map points. Layout would interpolate the underlying subdivision mesh points differently. I reported it at the time so it may have been fixed since then. I haven't specifically retested it since then.

"LW Modeler and modo both smoothly interpolate between the weight set at 100% down to 0% across the underlying subdivided mesh points. For example, if the underlying mesh were subdivided at a level of three, the subdivided mesh points would be 100%, 66% 33% and 0% in both LW Modeler and modo. LW Layout, however, interpolates between the two cage points differently and would instead treat the points on the same exact subdivided mesh as 100%, 0%, 0% and 0%, so the weight map would fall off much quicker in your renders than it did in modeler..."

http://dreamlight.com/shop/creating-a-3d-animated-cgi-short/

jeric_synergy
08-29-2017, 03:39 PM
Scazzino, thanks for the technical info!

And: wow, that BLOWS. They should really have addressed that, if they never did.

Surrealist.
08-29-2017, 05:18 PM
I think... correct me if I am wrong here - that it has mostly to do with the limitations set by rigging. Well I know this much, I think every point in the rigged mesh has to have a weight map value. (if you are using weight maps) This may be to do with normalization. Not sure. It has been a while. But the idea is to normalize the points you have to have a value on them. They can not have no weight assigned. Something like that.

jeric_synergy
08-29-2017, 06:29 PM
My incorrect assumptions about weight maps may include:

1) They could be a subset of the vertices of a mesh. (From William's video, they appear to encompass the entire mesh, all the time.)

2) When created, if a subset of the points or polys were selected, those were the ONLY vertices (derived from the polys if they were selected) that were included in the w.map (is that just #1 restated?).

3) There was a fundamental difference (unknown by me) between an unassigned vertice's value, and the value of 0%.

3b) A vertice could be unassigned, 0%, or {not a member} of a w.map.

4) And although it never came up pour moi, I assumed subd 'virtual points' values were extrapolated smoothly between real points with values

Surrealist.
08-29-2017, 08:17 PM
A weight map just like UV in Modeler can exist on just a set of points on a mesh. It does not have to be all. But I learned a rigging technique that taught you should have all points on a mesh assigned to a weight map with at least a value of 0. And this is different than no assignment at all. So my perspective is mostly coming from rigging and I don't understand the higher math outside of that as far as how subdivided points are affected.

Outside of that it is pretty simple. A point is either inside a weight group or it isn't. So that is the distinction. To be inside the group it needs to be assigned. And from there it is 0-100 basically as far as influence.

For rigging I might have this wrong or forgotten. But I think it has to do with the fact that in the bone properties the normalization is limited to points inside a weight group. It can not normalize on points that are not assigned to a group. Again the main distinction.

And there is one more practical value depending on your technique of weighing. Some people don't use weight painting. But I came from the old old school of learning how to paint on all weights in Modeler. And in this scenario it is the general practice to have all of the influences on a point add up to 100. 50/50 30/70 and so on between two bones for example. Or 100/0. Or three bones, 10/20/70 and so on. Normalization of course should take care of this for you if it is not perfect. But I just learned to do it this way. Another reason for the distiction of a bone weight having 0 influence as opposed to not being a part of the group.

So a sequence away from a joint would be:

50/50
40/60
30/70
20/80
10/90
0/100

In both directions on sequential edge loops. To over simplify.

This is all old school stuff and you don't have to do it like this. Just how I learned it and I think this is some of the reasoning behind how weights are set up in Modeler and in LightWave as far as influence.

Scazzino
08-30-2017, 07:59 AM
Yes, so you don't necessarily have to set all points to zero, just those that will be interpolated to. I.e. those next to points that do have a value. Though that can be tricky sometimes so it would be safest to start with a full map with all points set to 0%. The biggest problem when using weight maps to drive a surface is that Modeler and Layout interpolate weight maps on subD objects differently. So if you are working with weight maps on a subD object in Modeler you are getting a false impression of what it will look like when used in Layout. I just verified that it still works this way in 2015.3.

Here's the same simple subD object in Modeler and Layout (using nodes to drive the surface color by the weight map). The left points are set to 0%, the center points are set to 100% and the right points are not set at all. The subD level is set to 3. Notice how the subD interpolation is drastically different between Modeler and Layout. This is why I always specifically set the points to 0% around the edges of any areas in a weight map I'll be using in Layout.

137788

Modeler interpolates from a set cage point to an adjoining cage point, smoothly across all intermediate subdivided surface points, whether the cage point is explicitly set to 0% or unset. Layout however only does the same for points that are explicitly set to 0%. When interpolating between cage points that are set and unset it subdivides the surface and assigns 0% to the subdivided surface point closest to the set point (probably all of them but the only one we can observe the effect on is the adjacent one). So the weight map interpolates not smoothly across all those subdivided points, but only between the set cage point and the next adjacent subdivided surface point. This drastically changes the interpolation of the weight map between Modeler and Layout and can cause problems if you are not aware of what it's doing. That's how I figured it out. It caused problems in my renders years ago.

Surrealist.
08-31-2017, 08:54 AM
Yeah that is pretty much how I learned it so I guess my memory is still intact. The difference between Modeler and Layout I would think is because Modeler is only giving you a preview of the subdivision where as Layout is actually subdividing before rendering it. So for textures you'd have a drastic difference in fall off between a map value of 0 and no map value at all. I don't know if there is a way to do this on nodes. But to match modeler's display you'd have to create the texture before it gets subdivided.

Similar to changing sub division order in the object properties. With Subdivision set to "After Bones" you would get a similar display of fall off from a bone based on how it looks in Modeler whether it was mapped to 0 or no map assignment at all. Set to "First" you'd get a fall off that mimics what it does for textures.

Of course it is simpler to understand this distinction and assign values according to what you will see in Layout for texturing.

137796

No assignment on adjacent loop.

137797

Set to "first" the the bone moves only that loop and not the ones with no assignment. But also because it is subdividing before displacement, it falls off to the first subdivided loop.

137798

Texture goes from assigned loop to next subdivided loop. Here of course that distance is stretched by the bone.

137799

Subdivision set to after bones is similar to modeler display and also displacement from a weight map with SubD. But the texture is still falling off to the next subdivided loop.

137800

Adjacent loops set to 0 and it falls off across that loop. The texture fall off and the bone fall off are not the same but similar enough to illustrate.