Results 1 to 15 of 15

Thread: Surface/Normal blending in LW

  1. #1
    Registered User WaveRider's Avatar
    Join Date
    Dec 2014
    Location
    origin
    Posts
    23

    Question Surface/Normal blending in LW

    How can I achieve something like this in LW with two separate surfaces?
    https://www.youtube.com/watch?v=SjtItfeyHII

  2. #2
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,263
    With two separate surfaces, you can't do it in LW.

    With single surface you can use Gradient/Weight Map, and Material Mixer.


    But you can do it in TrueArt's Global Materials.
    http://globalmaterials.trueart.eu
    There is separate version for LW v11.x-2015.x, and for LW 2018-2020.

    Basically entire surfacing you should move to Global Materials global Node Editor, and in GM you can have access to both materials used on surface A and B in the single Node Editor, and eventually you can mix them together using Material Mixer, as you wish.

  3. #3
    Registered User WaveRider's Avatar
    Join Date
    Dec 2014
    Location
    origin
    Posts
    23
    With two separate surfaces, you can't do it in LW.
    Is that due to internal limitations of how LW handles surfaces?


    Thank you, I'll consider purchasing it.

  4. #4
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,263
    Quote Originally Posted by WaveRider View Post
    Is that due to internal limitations of how LW handles surfaces?
    It is quite natural limitation.. the same you have in e.g. OpenGL, DirectX...
    Polygon can have just one material assigned at one particular moment.
    To support multiple materials on single polygon, there is needed redraw of the same polygon multiple times with alpha which adds to 1.0. e.g. 0.8 from 1st material and 0.2 from 2nd material.
    Which would make OpenGL (or rendering) many times slower than it is now.
    Some people make such changes in post-production.

  5. #5
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,263
    Suppose so we have two surfaces, which have sharp boundary like on screen-shot #1.
    Both Principled BSDF materials in LW 2020.0.2.
    One is greenish (pretending grass).
    Other one is brown (pretending rocks).

    We want to smoothly blend one material to other.
    I created weight map, and plugged it to Gradient to be able to adjust it without having to modify weight map. Then to Material Mixer.

    Instead of Gradient, you can add Multi Material Switch node, and connect multiple different materials to it, and switch them easily from one version to other version during show to client different surfacing.





    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	GM 1.jpg 
Views:	334 
Size:	575.4 KB 
ID:	148758   Click image for larger version. 

Name:	GM 2.jpg 
Views:	336 
Size:	572.0 KB 
ID:	148759   Click image for larger version. 

Name:	GM 3.jpg 
Views:	327 
Size:	580.7 KB 
ID:	148760  

  6. #6
    Registered User
    Join Date
    Feb 2005
    Location
    Barcelona
    Posts
    334
    Seems to me like a surface being affected by a mask based on +Y axis and blended with a camera projection

  7. #7
    Registered User
    Join Date
    Mar 2018
    Location
    Perth, Australia
    Posts
    158
    First of all, WOW!!!! thats an amazing feature!

    Second, looking at the video closely you can see that the ground material is actually sticking onto the rock (it rotates with the rock, meaning it is part of the rock and not the ground). I think this means means that you would have to have the ground material inside the rock object next to the rock material and use some kind of fancy ray detection thing 'I obviously suck at using nodes properly) and then use a material mixer to mix both ground and rock texture with the data from that ray detection thingo....

    Makes sense in my mind, I just can't make it work with nodes though...

    @sensei
    your example is 1 object. In the video it's clearly 2+ objects. So the question is can 2 separate objects detect intersecting geometry and use that data?

  8. #8
    Registered User
    Join Date
    Mar 2018
    Location
    Perth, Australia
    Posts
    158
    Correction.... in the end of the video you can clearly see the ground texture stays put while the rocks rotate.... Oh well, maybe just make the ground texture World coordinates and the rock texture local or something.... what do I know, still would be a very powerful feature if LW could have that.

  9. #9
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,263
    Quote Originally Posted by peebeearr View Post
    @sensei
    your example is 1 object. In the video it's clearly 2+ objects. So the question is can 2 separate objects detect intersecting geometry and use that data?
    It does not matter how many objects you have. It is one global Node Editor for all objects all surfaces (or the one which you want).
    GM does not detect any geometry intersections.. It is global Node Editor. So definition of grass and rock materials would be in one place (instead of two places). So blending them together is trivial.

  10. #10
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,208
    I made some experimentation close to this effect,
    the ball has the same UV map name than the box,
    native image node set to Object UV, offsetting the U & V for the Ball,

    Click image for larger version. 

Name:	test-crossing.gif 
Views:	53 
Size:	127.2 KB 
ID:	148766

    alas it is slow to render.

    Denis.

  11. #11
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,263
    If you could send occlusion ray which is not detecting self occlusion result of it could be used as parameter to LW 2018+ clip. It would work in some camera orientations when secondary material is behind primary material.

  12. #12
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,208
    Found another way for such similar edge blending,
    with one evaluation per Color and one per Normal, so faster to render,
    but not a "one node" solution.

    No Blending:

    Click image for larger version. 

Name:	test0.gif 
Views:	45 
Size:	173.7 KB 
ID:	148769

    Blending:

    Click image for larger version. 

Name:	test-edge-crossing.gif 
Views:	72 
Size:	222.7 KB 
ID:	148770

    using the Replace Spot node from DP Filter,
    I updated it with a new "Ray Direction" input,
    when pluging a normalized direction vector,
    the node fires a ray for catching the underlying object and replaces current local, world and uv coordinates
    by those found on the intersected object.

    So taking the normal output from the native Edge Shader node,
    get the Normal for smoothing,
    also inverse it with the Vector Scale node to plug a Ray Direction
    in the Replace Spot node placed after the same Image mapping
    than underlying box object.

    Click image for larger version. 

Name:	setup-blended-edge.jpg 
Views:	63 
Size:	268.5 KB 
ID:	148768

    Input what you want in the Mixer node for texturing the rest of the ball object.
    the edge output modified by the gradient may be used for mixing
    some other part of the current object material with the underlying object material.

    Here a Grass procedural texture with Object UV mapping,

    Click image for larger version. 

Name:	blended-edge.jpg 
Views:	86 
Size:	401.1 KB 
ID:	148771


    Denis.

  13. #13
    Registered User WaveRider's Avatar
    Join Date
    Dec 2014
    Location
    origin
    Posts
    23
    @dpont
    Excellent, thank you for sacrificing your time. It's a great start, I will try it this way.

  14. #14
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,208
    I attached my animated test scene above.
    UV-crossing.ZIP

    Didn't mention that beside this ObectUV mapping,
    other world or local coordinates mapping is possible,
    also you can get Bump output, will be blended
    with the normal.

    Denis.

  15. #15
    Registered User WaveRider's Avatar
    Join Date
    Dec 2014
    Location
    origin
    Posts
    23
    Great, thanks again dpont.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •