Parallax Occlusion Mapping

  1. Oh, damn i was confused by duplicated referenceplane and scale parameters and thought that it requires scalar valuse and not vector.
    Why it requires “Displacement node” and have same settings inside material?
    obraz

  2. Okay fair enough. I hop thet design of Dsiplacement inpuit will be redesigned soon.

  3. Ok. Hmm, What if there was “Depth Offset” node with shader and offset inputs?
    obraz
    Would it be possible to implement like that? (And 5. AO also? I’ve asked Campbell why AO is not exposed in Principled and goal was to have separate output or something like that)

Or have enable/disable shader features for more advanced users:
obraz

  1. The problem is, the displacement node is not required, you can create other valid displacement outputs without using it. And the displacement node is not clamped at the input. If you feed values outside the 0…1 range to the Height input, you will get displacements larger than the range given by Midlevel/Scale. For the POM code it is very difficult to reliably (by static analysis) predict the range (in world space units) that an arbitrary valid displacement node tree could output. That’s why originally I intended to add a “max displacement” and a “min displacment” parameter to the material POM settings. In practical use I realized that always converting the Midlevel/Scale parameters (which is the still the typical setup) to Min/Max parameters manually is not very convenient. For world space units the conversion is quite simple:
Min = -Midlevel * Scale
Max = Scale - Midlevel * Scale
Midlevel = -Min / (Max - Min)
Scale = Max - Min

The global Min/Max displacement (or alternatively Midlevel/Scale) information is required for the POM ray search, to know which space has to be covered. The Min/Max parameters act as a bounding “box” for the displaced geometry.

  1. Technically this is no problem at all. In the first version I have implemented it this way, see the first post in this thread. It could be added back (should be easy) if this is something that the Blender team wants.

The colorful SSR glitches and the PDO intersection artifacts are no longer present in the latest build.

7 Likes

I have uploaded a new diff with some improvements. The new code diff and a sample blend file can be found here: https://developer.blender.org/D9792. An experimental build can be found here: https://blender.community/c/graphicall/frbbbc/

Changes in this new version:

  • There is a new optimized GLSL shader for rendering shadow maps. The material has now two parameters for the number of samples: One for the number of ray marching steps when shading the surface fragment and an additional one for the number when rendering shadow maps. Often the rendering of shadow maps requires less samples for acceptable visual quality, so this additional parameter helps improve overall performance.

  • I have ported the automatic image texture LOD selection used in the original POM node based approach (see first post in this thread and diff linked there) to this displacement node tree based approach. For image textures with linear interpolation used in the displacement node tree it will use a LOD (mipmap level) based on gradients calculated at the first step of the POM iteration. It will then keep this LOD fixed for any further POM iterations in order to avoid any issues with divergent code branches (in the 2x2 blocks used for differential approximation). Good LOD selection is important in order not to be bottle-necked by memory access/bandwith when sampling the image textures. This improvement should remove the main performance drawback of the displacement node tree based approach compared to the original node based approach. For image textures with cubic interpolation I have kept Blender default of using LOD 0. This is not so great for performance, but still gives generally the best quality (except for potential aliasing issues).

  • The new version also fixes a small memory leak issue present in previous versions.

25 Likes

Is it going to be part of blander soon ?

I just wanted to chime in and thank you for your effort in implementing POM into Blender.
I did test the feature with some custom textures and it looked nice.
Thank you again, i hope to see this at some point in trunk, it really helps for the game art side of things.

4 Likes

I made a few test images for the POM.


I used a mist pass for the depth, and I found that using a normal map gives really good results.
Even at 4 samples, and a texture resolution limitation of 128x128, the understanding of the image holds up.

I find best results when the POM and displacement node drivers match each other, drivers work well for this.

1 Like

Here’s a small test.

https://youtu.be/o1IeDvwCJ-Q

37 Likes

So cool, the usage is really nice. When I see that, I think I will not face problem for my uses !! Integrating just perfect !!

This is awesome! I’m so hooked by POM for Eevee, we need this!
Tried a lot of stuff with it, it’s even usefull for massiv scale Environments:

11 Likes

Why do you have the preview textures in the nodes? Is this an addon?

6 Likes

Hell yess, this is awesome!

1 Like

Is it possible to cut plane edges (pixel offset)?
like this: https://blenderartists.org/t/parallax-displacement-in-cycles/1126874
At least for cycles.

searched and found:

5 Likes

Hi,

will this land on 2.92? or 2.93?
if not, is it not being worked on anymore?

5 Likes

Hope we can have a branch with the new DOF included in 2.93. Will be awesome to implement both effects in eevee. I not a programmer so i´m not having luck with git.

(apologies I misunderstood)

1 Like

Hadriscus, what i mean is that i wish we have this POM feature included in blender 2.93 the one that has implemented the new Unreal engine like Depth of Field. Regards!

7 Likes

i agree, i would also love a 2.93 build, i really need those updated eevee light/volumetric updates…! This POM build is awesome really.

4 Likes

+1, even this build with it’s stated limitations has already proven invaluable to me

3 Likes