Parallax shader with Silhouette Clipping for Blender 2.8 Eevee and Cycles

Hello!
This is based on the work of Blenderartists user Binary for Cycles (2013), which
was itself based on Blenderclan user Zelouille original version for Blender Internal (2009).

I organized the nodes in a more user-friendly manner, and implemented the extra image map
nodes (for Metalness/Roughness/Transparency/Emission) as well as some tweak nodes (Inverse/Strenght)
which all connect to the Principled Shader node.

All you have to do to use it is remove the built-in images from the Image nodes and replace them
with your own. Also, remember to change the Height and Normal maps to Non-Color instead of sRGB.
The Image nodes that you are not using (e.g: Emission) can be left empty… but you can freely
mess with the Invert node Factor as well as the Strenght node Factor and Color fields directly.

The Material is set up to use the “Alpha Clip” option inside the Settings Tab of the material.
This means that transparent areas on the viewport are either completely opaque or 100% transparent
and is something required for the Silhouette Clipping feature of the shader to work correctly.

If you wish to use the Alpha Blend option instead (to allow for partially transparent areas or image maps), go to the “Settings” tab of the Material and enable the “Backface Culling” option, or alternatively disable the “Show Backface” option that appears after you select “Alpha Blend”.

AlphaBlend

Apparently the shader (or Blender itself) has trouble trying to show semi-transparency AND the backfaces of the models at the same time. If you wish to use the Parallax shader and at the same time MUST see the backfaces, I’d recommend duplicating the mesh, flipping the normals and ajusting it’s scale/positions. (Solidify doesn’t help here)

Some screenshots:


The Silhouette Clipping, as well as some shininess/roughness on the bricks:

Have fun!
Evandro Costa

EDIT1: Reorganized the Height Map to be inside of a group, because it’s referenced elsewhere in the node tree. (Thanks @filibis!)

Zip File:
Parallax_eevee_cycles_silhouette_clipping.zip (897.2 KB)

39 Likes

That.

Looks.

Amazing.

Strangely it also looks a lot simpler than I thought it would be.

2 Likes

Hi Evandro, this looks great! Thank you for sharing it.

Just an enhancement to the material: If you create a node group for height map like this it would be better in my opinion. Because that height map is referenced inside Parallax Main, so that we only need to change one.

image

3 Likes

Hi there Filibis!

Thanks a lot for the suggestion, you are correct, I forgot about the height map inside the Main group.

I think a Mapping node could also probably be squeezed somewhere to allow for dynamic resizing of the textures, instead of having to change the UV islands size as it is currently.
Later I’ll try to implement it.

I’ll change the file on the main post.
Anyway here’s the updated node and a demonstration that it’s working correctly with other maps:


Reminder: if using other maps, remember to change the Height and Normal maps to Non-Color instead of sRGB inside their nodes.

3 Likes

This is insane!! Thanks for sharing :slight_smile:

1 Like

Works marvelous, thanks!

1 Like

really nice ! One of the best attempt so far !!!

but how the roughness, emission, metallic and transparency map can be correct if they aren’t moving with the depending on the view ?

also i saw that the height map is instanced, is there a way to make an all in one PBR node ? im trying to make the node simple

3 Likes

This is Awesome! Mast have. Thanks for sharing!

1 Like

Awesome work! This is the best parallax shader I found for Blender so far. And it’s free!
I’ve been doing some Fur R&D and your shader has helped immensely.

If you haven’t already, UE4 has POM documentation

Some integrations I’d love to see is ‘Height Ratio’ and ‘Tiling’. Here’s an example of ue4’s shader. I’m having trouble making the hair look long using your shader

Hair R&D Video

1 Like

Dove more into your shader, I messed around with the View Vector and Parallax Pass parameters to try and slide each ‘layer’ to fake longer hair.

I ended up throwing a Multiply on the top two View Vector Dot Products. Not exactly sure what is really going on. But it kind of works. The ‘Directional lengthen’ breaks the shader when you multiply too much, ideally each ‘hair strand’ wouldnt get more blurry, just lengthen.

2 Likes

Hi there, nice results! Cool that it worked approximately like the Ue4 shader.
I think your high value Directional option is very similar to the Height Ratio example from ue4, IMO that one also became blurry. But I think parallax works better with short hair anyway.

I’m not sure what the Tiling option does in the ue4 shader. Does it repeat the UV? If so, I think this is easy to implement, with a mapping node going to all image textures at once, and changing the X/Y scale values. But I’m out of free time atm to work on this, maybe when I have some I can add it for you.

A cool effect that I wish was possible, but I don’t think it’s so easy to implement, would be something like the fur on GTA5, which appears to do a parallax effect (multiple repetitions of the same texture at different heights according to the POV), but with an alpha effect increasing at each layer, which works even at the profiles/silhouettes, giving that fluffy effect:

1 Like

That GTA5 shader looks great. The silhouette breakup really sells it. I believe it’s a shell/fin shader.

Here’s a similar shader build in ue4. I’m not really sure how you would automate the mesh extrusion and fur length variation. Any ideas?

1 Like

Hi,

Thank you very much for this awesome share.
When I tried to change the image of the sphere, its showing a gap as in the image below. Could you please help to solve this issue?


Also my image is not a seamless texture so I use curve, mesh deform and shrink wrap modifiers to wrap the image around a sphere. That works quite well for me. So is there any option to apply the parallax effect in this?

The gap is usually because of the Silhouette Clipping slider value. Try to change it to more or less.

As long as the image has the proper height map (and optionally a normal map to give more detail), and is properly UV mapped into the mesh, then it doesn’t matter how you distort the mesh after, the parallax effect will still work… of course the texture will stretch or squash according to the mesh deformation, but this is expected (just as it appears stretched in the original sphere or pillar that are in the file).

I wouldn’t advice using modifiers instead of properly uv-unwrapping the texture into a sphere, but this is a discussion for another topic, and has nothing to do with the shader.

1 Like

Continuing the discussion from Parallax shader with Silhouette Clipping for Blender 2.8 Eevee and Cycles:

OMG!!! SOLID GOLD!! thanks!! a lot! a ton! :smiley: this is something I was looking for a long long time ago :smiley: :orange_heart: :orange_heart: :orange_heart:

1 Like

Thank alot man !!!

1 Like