Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Height / Displacement bake?

  1. #1
    Registered User
    Join Date
    Oct 2016
    Location
    Germany
    Posts
    5

    Question Height / Displacement bake?

    hello y'all!
    i need to bake a few displacement maps. is there a way to do that in Lightwave?
    something like the normal cast node?

    i don't need anything fancy. no 32 bit informations.
    jut a black and white heightmap of a hi-poly organic model baked onto a low-poly version.
    ... for use as a bump/height map. ie. just for shading ... not for displacement.

    many thanks in advance

  2. #2
    Registered User squarewulf's Avatar
    Join Date
    Aug 2014
    Location
    South Bend, Indiana
    Posts
    395
    In layout go to File>Save>Save Trans Object

    This will save out your object as it is seen in layout.

  3. #3
    Registered User
    Join Date
    Oct 2016
    Location
    Germany
    Posts
    5
    thank you! but, that's not what i mean.
    i have a hi-poly model. i desire to bake its difference in detail as a black and white texture into a low poly version.
    ie. areas poking out would be white and details bumping in should be black.
    it should look like an displacement map. but without the extra informations.
    a DOF cast node ... if you will.

  4. #4
    Dreamer Ztreem's Avatar
    Join Date
    Jun 2003
    Location
    Sweden
    Posts
    4,131
    Yes its possible. Use a raycast or raytrace node and drag the distance to color.

  5. #5
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,897
    Imagine you have low-poly model of mesh.
    Each spot on low-poly polygon is using ray-trace/ray-cast node,
    to learn how deep is true high-poly mesh.
    RayCast>Ray origin = Info>World Spot, RayCast>Ray Direction = Info>Ray Direction
    Low-poly mesh has to be transparent to ray-cast (toggle Object Properties > Render > Unseen by rays),
    high-poly mesh has to be transparent to camera (Unseen by camera).
    And storing value from ray-cast (distance between low-poly spot, to high-poly, except -1.0 which means ray-cast shut to environment).
    Last edited by Sensei; 10-24-2016 at 04:18 PM.

  6. #6
    Registered User
    Join Date
    Oct 2016
    Location
    Germany
    Posts
    5
    heyyy, thank You guys, very much! this seems to go in the right direction.
    however, i'm too naive with nodes to make it work properly.
    node flow and result shown in the screenshots.
    it seems to sample only in the outward direction? intersecting areas are rendered black.

    Click image for larger version. 

Name:	height_cast.png 
Views:	81 
Size:	198.0 KB 
ID:	134911
    Click image for larger version. 

Name:	height_cast2.png 
Views:	84 
Size:	60.2 KB 
ID:	134912

  7. #7
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,897
    The first of all,
    you can't connect it to Color, but to Diffuse Shading.
    Color is affected by shading.
    Diffuse Shading is param to merge it with other .. Shadings to make Material.
    So you can use Make Material and feed it by your Gradient output and then plug to Material.

    Secondly you might need to slightly move away from surface.
    If you have Ray Origin and Ray Direction,
    origin += direction * length (when length > 0 ) it's going in one direction,
    but if
    origin += direction * length (when length < 0 ) it's going in second direction.

    In the case of low-poly mesh, which is nearly equal to high-poly mesh, distance to move away from surface is very very short needed.
    Last edited by Sensei; 10-24-2016 at 06:43 PM.

  8. #8

    you can do somethin' like this...

    LW vidz   DPont donate   LightWiki   RHiggit   IKBooster   My vidz

  9. #9
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,729
    Right, erikals, it seemed that a Normal Map was actually what the OP wanted rather than a displacement map.

    (Although I don't know the finder differences between the two, my impression is that normal maps are more for detailed work than displacement maps.)
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  10. #10
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,897
    Quote Originally Posted by jeric_synergy View Post
    Right, erikals, it seemed that a Normal Map was actually what the OP wanted rather than a displacement map.

    (Although I don't know the finder differences between the two, my impression is that normal maps are more for detailed work than displacement maps.)
    Normal map is 3D,
    displacement map is 1D.
    World Spot += Normal Vector (calculated) * Length (from Displacement map).

  11. #11
    Registered User
    Join Date
    Oct 2016
    Location
    Germany
    Posts
    5
    thank you all very much for pitching in.

    feeding into diffuse shading gives me the same result as in color.
    i think it's because i render with 0% diffuse 100% luminance?
    Click image for larger version. 

Name:	height_cast3.png 
Views:	65 
Size:	191.4 KB 
ID:	134913

    i think Erik is right to use the normal cast.
    however, playing with the curve i do not get an as ... rich? result as i get from the ray cast.
    it looks rather dull.
    Click image for larger version. 

Name:	height_cast4.png 
Views:	69 
Size:	39.3 KB 
ID:	134914

    i think i would prefer the use the ray cast, if it would work properly.

    for context: i intend to use it for height maps in Unity.
    https://docs.unity3d.com/Manual/Stan...HeightMap.html

  12. #12
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,897
    Also remember about color space..
    It could influence your results..
    While baking such stuff, you cannot have gamma color correction..

  13. #13
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    14,961
    Quote Originally Posted by jeric_synergy View Post
    Right, erikals, it seemed that a Normal Map was actually what the OP wanted rather than a displacement map.

    (Although I don't know the finder differences between the two, my impression is that normal maps are more for detailed work than displacement maps.)
    A normal map is more of illusionary 3d with baked height/3d info info..which will look very good straight on viewed, but for a profile with contours, not good, normal maps needs no extra geometry divisions, while a displacement map is totally dependent on geometry, to reach fine detail however..you would need insane amount of polys, that is why you often combined a mid-high level displacement with a normal map.
    Displacement on normals is s different thing...just concerns in what directon the displacement is going.

  14. #14
    Registered User
    Join Date
    Oct 2016
    Location
    Germany
    Posts
    5
    apologies about the confusion. i shouldn't have said displacement. nothing is being displaced.
    this is about height maps /parallax normal maps.

    i am too unfamiliar with notes to get it to work properly.

    the normal cast gives me a too plain result.

    the ray cast has nice and crispy depth but can't deal with the intersections.
    i tried to turn play with unseen/seen by double sided ect. but i can't get rid of the black islands.
    what am i doing wrong?

    Click image for larger version. 

Name:	d2.jpg 
Views:	59 
Size:	381.2 KB 
ID:	134942
    Click image for larger version. 

Name:	d1.jpg 
Views:	49 
Size:	437.8 KB 
ID:	134943

  15. #15
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,897
    You should move away (or forward) slightly from/to World Spot in direction +/-Ray Direction let's say 1mm, or 0.1mm for a start.
    You should see these black areas are disappearing, while using higher offset value.

    World Spot2= World Spot +/- Ray Direction * offset

    Or yours low-poly mesh is simply too close to high-poly mesh?
    Absolutely it cannot intersect with high-poly...
    Remember World Spot is taken from low-poly mesh,
    and then ray is fired in direction equal to Camera Ray (Ray Direction),
    it has to fly a bit and give you distance, between them.
    If high-poly mesh intersects with low-poly, ray hits completely different side of mesh than you need.. it's like trying to fire ray while being inside of sphere..

    Output from Ray Cast (Distance) (as long as it's not -1) + Ray Length (from camera to low-poly mesh), is total distance from Camera to high-poly mesh.
    Last edited by Sensei; 10-29-2016 at 05:22 PM.

Page 1 of 2 12 LastLast

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
  •