Unity Products:Amplify Shader Editor/Parallax Mapping

From Amplify Creations Wiki
Revision as of 00:06, 2 December 2023 by AmplifyWiki (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Samples

The ASE package includes several Parallax samples, be sure to check them out.

AmplifyShaderEditor\Examples\Official\ParallaxMapping
AmplifyShaderEditor\Examples\Official\ParallaxOcclusionMappingPOM
AmplifyShaderEditor\Examples\Official\ParallaxOffsetFakeInterior

About

Parallax mapping (also called offset mapping or virtual displacement mapping) is an enhancement of the bump mapping or normal mapping techniques applied to textures. Parallax mapping is implemented by displacing the texture coordinates at a point on the rendered polygon by a function of the view angle in tangent space (the angle relative to the surface normal) and the value of the height map at that point. At steeper view-angles, the texture coordinates are displaced more, giving the illusion of depth due to parallax effects as the view changes.[Reference]

Node

The Parallax Mapping node calculates offseted UVs used in the parallax mapping effect. The output can be connect to the Texture Sample node UV Input Ports, note that it should be connect to all channels (Albedo, Normal etc) in order to ensure that the effect is properly displayed.

Input

  • UV - Requires UV coordinates, the example below uses the Texture Coordinates node to define its parameters.
  • Height - Height/displacement texture to be used in the Parallax effect.
  • Scale - Scale value of the Parallax effect.
  • ViewDir - View direction used to calculate the Parallax effect. You can plug a View Direction (tangent) node directly into the Parallax Mapping ViewDir Input Port or supply your own tangent values for specific effects.

Output

  • UV Coordinates - Offseted UVs, transform if needed, plug into the Texture Sampler UV Input Port.
ParallaxMapping.jpg

Node Properties

  • Normal - Cheaper approximation, view dependent.
  • Planar - More accurate than the Normal mode but generates higher aliasing artifacts at steep angles.

1 Iteration

ParallaxMapping.jpg

4 Iterations

You can stack several Parallax Mapping nodes for added detail.

ParallaxMapping2.jpg

Back to Node List