LuxCore icon indicating copy to clipboard operation
LuxCore copied to clipboard

Improve Displacement Implementation

Open AlexeyAdamitsky opened this issue 5 years ago • 0 comments

I like the LuxCore render. It's progressing really well and getting better and better.

I want to offer a suggestion how to improve recent Height Displacement implementation.

What is the issue?

The issue is how displacement is calculated currently. It calculates displacement from 0 to 1 where 0 is no displacement and 1 if full strength of displacement. Figma_rfZ1XMM7e5

The displacement map I used for testing. blender_1GeHOQC352

As a result we gets this: blender_eJgxInZixx

You see that it's calculated from surface normals only in positive (1) direction.

To compensate for this we need to define Midlevel where 50% gray is neutral or 0 point displacement. Everything less than 50% gray will push displacement in a negative direction and everything that is greater than 50% gray will push displacement in positive direction.

To make it work correctly you can use Offset of the Height Displacement node: image

Now it works as expected: image

Well, not really, because if we decide to change the Scale to let's say 2 our Midpoint will shift. blender_w3CcY3F5yA blender_yPQbAFXYv9

Now we need to recalculate our Offset for our Midpoint like this: Offset = Scale * -0.5 Ok. Let's do this. imageimage

Now we corrected our Midpoint Offset. image

But to recalculate it every time is a terrible workflow. It's a lot of manual work.

It could be made easier with a math nodes. But there is no way to feed the values to Height Displacement node: image

Still, even with exposed values and math nodes solution it's a bad workflow. You need to recalculate Offset for Midlevel each time and you go into negative numbers to fix the Offset which is a bad UX.

Proposition

  1. Expose Scale and Offset value of the Height and Vector Displacement nodes.
  2. Implement the Cycles' way to control displacement where you define the Midlevel and not Offset. Set nodes Midlevel to default 0.5 which will be 50% gray point or 0 displacement.

You can try my test scene to see what the issue is: Displacement.zip


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

AlexeyAdamitsky avatar Apr 27 '20 08:04 AlexeyAdamitsky