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

2016-04-27, 21:35:19
Reply #15

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
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.
This should easily be possible.
But my head is already starting to spin imagining the node network for a whole bunch of materials blended this way.
I also tried a bunch of different composite maps for all the different materials and I haven't gotten any closer to achieving a similar result to the article I posted at the start of the topic. :|

2016-04-27, 22:12:55
Reply #16

Juraj

  • Active Users
  • **
  • Posts: 4768
    • View Profile
    • studio website
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.

Well, I know. That's the only way it would work :- ).

But the modifier has only single "height" option (I don't mean relative height of texture map, I mean the physical units inside the modifier, ie. 2 cm). You will have to use this for the material with bigger depth, and adjust the other heightmap.

While keeping displacement map in two different materials, you can keep your texture heightmaps unmodified and adjust each height respectively.
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, 22:43:49
Reply #17

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8885
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Sorry, i didn't read your post carefully enough for the first time. Yes, you're right, this method isn't flexible enough. Oh well, we have what we have for now. Let's hope layered material will be revisited someday :]

Anyway, recorded short video for OP. Just a proof of concept, nothing more:

I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-27, 22:57:40
Reply #18

Juraj

  • Active Users
  • **
  • Posts: 4768
    • View Profile
    • studio website
Quote
Let's hope layered material will be revisited someday :]

It could be bit more robust. Game engines now offer blend nodes that don't just lerp between two materials, but can 'stack' them (I think this is what the legacy Autodesk composite material was supposed to do ? But does anyone ever used it).
You could then lerp their diffuse/specular properties, but overlay normals.

This can be easily done through nodal network of course, but the charm of more advanced blend node, is that you can keep untouched presets, and mix them into final materials with very artistic, real-world resembling approach. A "dampness" layer, mixed with paving, would overlay normals, and multiply diffuse properties, lerping specularity, without any nodal network at all. Even a 5year old child could then easily create complex blended materials.

One can hope. Or not, when something like "check-box" caused hysteric reactions.
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, 23:45:27
Reply #19

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
Thanks the video is really nice especially for other people who want to do something similar in the future.

Now we have solved the issue of blending the dislplacements correctly and using Vertex Painting to mask the materials.
I am still not any closer to actually blending the materials properly based on height. Doing it in a DirectX material wouldn't be too hard but I am not sure how that would even work with Corona.
And in all honesty. The offline render displacements look so good that anything gained by heightmap based blending would almost be marginal.

On a different note, concering Juraj_Talcik's post.
The material system inside of 3ds Max is kinda meh in all honesty.
I don't mean Corona or Vray, just in general the native 3ds Max slate editor.
Comparing it to something like the UE4 material editor which is essentially just HLSL code presented as template nodes, 3ds Max's material editor is just meh.
Maybe it's my lack of experience working indepth with the 3ds Max material system but to me it feels simply too obscure to make more difficult things with.

2016-04-28, 00:18:10
Reply #20

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
Alright, here are the blended materials.
Unfourtanetly I just realized that the normals are not blended either so I will have to do that tomorrow since it also just uses the Base Materials normal.


2016-04-28, 00:50:36
Reply #21

Juraj

  • Active Users
  • **
  • Posts: 4768
    • View Profile
    • studio website
Quote
I am still not any closer to actually blending the materials properly based on height.

Because you are currently not blending with heightmap as mask, but with vertex map. The vertex map, should be used to 'drive' the heightmap used as mask. You started with the latter, from opposite direction than you should have :- ).

Quote
....just in general the native 3ds Max slate editor.
Comparing it to something like the UE4 material editor....

We know : /


BTW, fantastic tutorial where I saw this method first is by Aaron Kaminer. It's...unsurprisingly UE4 tutorial that goes a little bit deeper but it's cheap and great. The macros should be (albeit awkardly) replicable in 3dsMax, you just won't create final master shader :- )

https://gumroad.com/aaronkaminer

« Last Edit: 2016-04-28, 00:54:11 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-28, 09:07:17
Reply #22

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8885
  • Let's move this topic, shall we?
    • View Profile
    • My Models
I really need to try UE4 someday, to see if grass is really THAT greener on the other side :]
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-28, 11:50:15
Reply #23

Juraj

  • Active Users
  • **
  • Posts: 4768
    • View Profile
    • studio website
I really need to try UE4 someday, to see if grass is really THAT greener on the other side :]

Some day, in 5 years, where GPUs will be all powerful, real-time antialiasing and GI on same level as offline raytracing, it will be game over :- ) But not yet.

But the material system is really well thought out and nice, with hundreds of nodes for anything. And you can use a thousand of them if you want, it will use more drawcalls, but nothing hindering. Unlike archaic 3dsMax, where bunch of composite and color corrections maps together already start taxing the rendering time. Like...huh ?
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-28, 17:38:05
Reply #24

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
Alright I followed the tutorial that Juraj posted. One question though, is there someway to "Divide" two maps in 3ds Max? Composite map doesnt have that blend option and I don't see any other way of doing that.

2016-04-28, 17:58:58
Reply #25

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8885
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Try CoronaMix, it has divide blend mode.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-04-28, 18:03:15
Reply #26

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
Try CoronaMix, it has divide blend mode.
Corona to the rescue :D
« Last Edit: 2016-04-28, 18:06:53 by JJG »

2016-04-28, 18:24:47
Reply #27

mferster

  • Active Users
  • **
  • Posts: 523
    • View Profile
Here is an alternative for elevation based blending that gives you a ton of control in changing the blends, and allows any number of layers.

Use the gradient ramp map!  What many people dont know is that if you right click on the colour flags and select properties, you can actually replace the colours with any kind of map.

Here are the steps I made in my example

1. mapped my elevation with planar mapping in one channel,
2. flip the uvw so it's oriented from top to bottom
3. add in your different colour flags in your gradient ramp map to determine your different levels.
4. add in your textures to each flag on a separate mapping channel, add in additional uvw mapping for said map channel
5. move the flags on the fly to make adjustments!

edit: and if you only want hard line transitions just change the interpolation to solid. <!-- you can change the blend curve here too -->

Obviously the downside is that it can be quite cumbersome once you add in additional gradients ramps for other map channels such as bumps, and reflections. but if you work on it incrementally I think it's manageable
« Last Edit: 2016-04-28, 20:11:27 by mferster »

2016-04-28, 19:51:46
Reply #28

JJG

  • Active Users
  • **
  • Posts: 20
    • View Profile
Thanks mferster I will try that at some point aswell.

Here is what I have gotten so far.
I am following the guide Juraj posted by the letter, I wouldn't know where I deviate from him.
The result looks different from the normal linear blending for sure, I am just not sure if it really is correct.






And last but not least an image of my node graph.


I really dont think I am doing this correctly. The water puddle especially just looks a bit wonky to me.

2016-12-13, 20:08:32
Reply #29

Deckel

  • Users
  • *
  • Posts: 1
    • View Profile
Hello there.
I am actually not a Corona or Max user but i think i find a way for this in Maya and vRay.
It schould be possible to do that in other render engines or software pakages where you can render vertex color information.
I also searched for a way for that and the only topic in the whole internet seems to be this topic.
Really strange by the way because this is an really awesome technique.
I made a short video tutorial for that:

t=1s