AmplifyCreations / AmplifyShaderEditor-Feedback

4 stars 0 forks source link

Revamp tessellation and displacement for HDRP #19

Open diogovtx opened 2 years ago

diogovtx commented 2 years ago

Notes: tessellation is changed a lot in HDRP and Unity uses this new system in HDRP Displacement Mode needs study to see if this would be better to make it into a new ASE node/function/ template or combination of systems consider using HDRP shaders internal tessellation

Dawie3565 commented 2 years ago

// Tessellation specific [Enum(None, 0, Phong, 1)] _TessellationMode("Tessellation mode", Float) = 0 _TessellationFactor("Tessellation Factor", Range(0.0, 64.0)) = 4.0 _TessellationFactorMinDistance("Tessellation start fading distance", Float) = 20.0 _TessellationFactorMaxDistance("Tessellation end fading distance", Float) = 50.0 _TessellationFactorTriangleSize("Tessellation triangle size", Float) = 100.0 _TessellationShapeFactor("Tessellation shape factor", Range(0.0, 1.0)) = 0.75 // Only use with Phong _TessellationBackFaceCullEpsilon("Tessellation back face epsilon", Range(-1.0, 0.0)) = -0.25

include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl"

pragma shader_featurelocal _TESSELLATION_DISPLACEMENT _PIXEL_DISPLACEMENT

pragma shader_feature_local_domain _TESSELLATION_PHONG

define TESSELLATION_ON

define HAVE_TESSELLATION_MODIFICATION

// No tessellation for Meta pass

undef TESSELLATION_ON

Note:::::: within HeightMap we also use tessellation with displacement _HeightOffset("Height Offset", Float) = 0

// In this shader, the heightmap implies depth offsets away from the camera.
#ifdef _HEIGHTMAP
#define _CONSERVATIVE_DEPTH_OFFSET
#endif
Dawie3565 commented 1 year ago

this is a milestone that should not be skipped as its needed prior to terrain work