Author Topic: Height Based Texture Blending  (Read 29257 times)

2016-04-25, 20:30:46

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
Hey,
I was wondering if it is possible to blend multiple materials together inside of 3ds Max using Vertex Color and something similar to THIS?

I have to admit I haven't checked indepth yet if something like this is possible using corona. But maybe someone here has already tried or done this before?

2016-04-25, 20:52:15
Reply #1

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8877
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Nothing you couldn't do with composite map, IMHO.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-25, 20:55:59
Reply #2

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
Well, I couldn't really find anything about this online. And granted I haven't tried for very long yet but I couldn't make something that comes even close to the blending there.
Because all I am doing is changing the Vertex Color which is as far as I know just the texture coordinates for the blending ( I have no idea if I have this right ) instead of changing the way the material blend node actually blends.

2016-04-25, 22:32:58
Reply #3

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8877
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Well, if you have two textures with carefully prepared height maps, then it shouldn't be hard to blend those textures and use height maps as masks for conditional blending. Why you should need vertex colours for that, i don't know. But maybe i didn't understand that article fully - didn't read it carefully.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-26, 01:03:47
Reply #4

Juraj

  • Active Users
  • **
  • Posts: 4765
    • View Profile
    • studio website
Each of you got part of it correctly :- )

There are two blendings happening here:

1) Vertex color mask (easy to paint and use in real-time) to paint areas where blending between two materials happen, and where not (only base material shows).
2) Height-map mask to blend between two materials. You need at least one height map (the one with more depth ideally of course) for that. The better this heigh-map is, the more convincing is the result, so it's either sculpt based or scan-based. Alternatively, you can derive one from diffuse texture using Quixel NDO/Bitmat2Material/Skald/etc... but if won't be as convincing because it's only guessing the depth.

This is done using standard 3dsMax nodes as Romullus said.

With that said, this technique makes most sense in real-time, because the surface will be rendered only using parallax techniques. In Corona, you can just use displacement of two different surfaces and the effect will happen naturally (instead of vertex painting you can z-height paint directly using polygon brush).
« Last Edit: 2016-04-26, 01:07:10 by Juraj_Talcik »
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2016-04-26, 09:51:10
Reply #5

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8877
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Vertex colours are good when you have relatively dense mesh to paint on or when there's a need to have maximum interactive feedback. In other cases i would stick with texmaps.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-26, 12:25:09
Reply #6

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12784
  • Marcin
    • View Profile
Answer: yes, it is possible with Corona. :)
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2016-04-26, 23:03:21
Reply #7

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
I should have cleared up why I am asking and what I am trying to achieve in the first place.

I am using World Machine to create large scale terrains.
Now with a little bit of setting up, World Machine can provide masks that are then planar mapped onto the terrain mesh that define where a material is supposed to be displayed.
Simplest example would be a slope mask that defines where the cliff material is supposed to go and where grass is supposed to go.
Usually I would end up with around 5 of those masks for 5 different materials.

Up unto this point the whole thing is procedural and works A+ for backrounds especially.
But often times I would like to have a bit more fine control for areas closer to the camera on where the different materials go, so I would use Vertex Paint for that.

I haven't actually checked how to do this inside of 3ds max natively yet. Not sure if you can drag and drop a bitmap into a vertex paint slot to use as a base to later paint over manually.
( Usually I am using game engines like UE4 for this kinda stuff )

And in the end I would like to blend all those materials together using the height based blending approach.
The textures are Photoscanned textures provided by a guy named Christoph Schindelar. And the heightmaps are pretty much top of the line.
I'm real sorry that I haven't provided any actual examples yet ( I kinda don't have too much time lately ) but I will try to post an actual example tomorrow perhabs.

2016-04-26, 23:14:33
Reply #8

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8877
  • Let's move this topic, shall we?
    • View Profile
    • My Models
As for texture to vertex colours, you can bake that info with vertexpaint modifier. You just have to use scanline renderer for that.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-26, 23:23:26
Reply #9

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
As for texture to vertex colours, you can bake that info with vertexpaint modifier. You just have to use scanline renderer for that.
Sounds good to me, I will give all of that a try tomorrow when I am come home from work, and post the results here.

2016-04-27, 12:12:34
Reply #10

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12784
  • Marcin
    • View Profile
I think for what you have described vertex paint modifier + vertex color map will be the base. Then you can experiment with setting different map channels for the vertex paint, baking (as Romullus suggested), mixing vertex map with procedurals to create masks, etc...
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2016-04-27, 19:33:49
Reply #11

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
Just started looking at it again. And right off the bat I think something seems "fucky".


Sand Material


Forest Ground Material


Both of them blended together using "Corona Layer Mtl" and a "Vertex Color" node set to map channel 0, as the mask.
Only the albedo seems to be blended. The height and normal seem to only come from the "Forest Ground Material" though.

So, am I doing something wrong right from the start?
« Last Edit: 2016-04-27, 19:38:39 by JJG »

2016-04-27, 21:00:59
Reply #12

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8877
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Displacement is taken from base material only. That's current limitation of layered material unfortunatelly. Bump map should be picked correctly AFAIK. Try to mix displacement at map level instead of material level. Alternatively you can blend everything in single material.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-27, 21:15:27
Reply #13

Juraj

  • Active Users
  • **
  • Posts: 4765
    • View Profile
    • studio website
Displacement is taken from base material only. That's current limitation of layered material unfortunatelly. Bump map should be picked correctly AFAIK. Try to mix displacement at map level instead of material level. Alternatively you can blend everything in single material.

You could alternatively just decouple displacement to map level (as you suggest), but place it using Disp modifier onto geometry object.

This would retain benefits of layered material (separate maps, easier tweakable).

But by any of the above solutions, you loose the option to easily adjust height of each displacement separately no ? So it's not such an ultimate solution to current problem.
Please follow my new Instagram for latest projects, tips&tricks, short video tutorials and free models
Behance  Probably best updated portfolio of my work
lysfaere.com Please check the new stuff!

2016-04-27, 21:21:34
Reply #14

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8877
  • Let's move this topic, shall we?
    • View Profile
    • My Models
But by any of the above solutions, you loose the option to easily adjust height of each displacement separately no ? So it's not such an ultimate solution to current problem.

Well, you can use that same vertex colours map as mask for displacement mix. That should work.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures