publicreadonlyGUIContentsssTransmittancePreview1=newGUIContent("Shows the fraction of light passing through the object as thickness increases to 1.");
publicreadonlyGUIContentsssNumProfiles=newGUIContent("Number of profiles");
publicreadonlyGUIContentsssProfileStdDev1=newGUIContent("Standard deviation #1","Determines the shape of the 1st Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
publicreadonlyGUIContentsssProfileStdDev2=newGUIContent("Standard deviation #2","Determines the shape of the 2nd Gaussian filter. Increases the strength and the radius of the blur of the corresponding color channel.");
publicreadonlyGUIContentsssProfileLerpWeight=newGUIContent("Filter interpolation","Controls linear interpolation between the two Gaussian filters.");
publicreadonlyGUIContentsssProfileTransmission=newGUIContent("Enable transmission","Toggles simulation of light passing through thin objects. Depends on the thickness of the material.");
publicreadonlyGUIContentsssProfileThicknessRemap=newGUIContent("Thickness remap","Remaps the thickness parameter from [0, 1] to the desired range.");
publicreadonlyGUIContentsssTexturingMode=newGUIContent("Texturing mode","Specifies when the diffuse texture should be applied.");
publicreadonlyGUIContent[]sssTexturingModeOptions=newGUIContent[3]{newGUIContent("Pre-scatter","Before the blurring pass. Effectively results in the diffuse texture getting blurred together with the lighting."),newGUIContent("Post-scatter","After the blurring pass. Effectively preserves the sharpness of the diffuse texture."),newGUIContent("Pre- and post-scatter","Both before and after the blurring pass.")};
readonlyintm_CameraDepthStencilBufferCopy;// This is temporary, we will need to provide the correct opaque depth buffer to transparent without needing a copy
// For opaque forward we have split rendering in two categories
// Material that are always forward and material that can be deferred or forward depends on render pipeline options (like switch to rendering forward only mode)
// 'm_CameraDepthStencilBufferCopyRT' is a temporary copy of the depth texture and should be removed
// once we are able to read from the depth buffer during transparent pass.
using(newUtilities.ProfilingSample("Copy depth-stencil buffer after all opaque",renderContext))
// If full forward rendering, we did just rendered everything, so we can copy the depth buffer
uint2 viTilUR = min( viTilLL+uint2(16,16), uint2(iWidth, iHeight) ); // not width and height minus 1 since viTilUR represents the end of the tile corner.
uint2 viTilLL = TILE_SIZE_CLUSTERED*tileIDX;
uint2 viTilUR = min( viTilLL+uint2(TILE_SIZE_CLUSTERED,TILE_SIZE_CLUSTERED), uint2(iWidth, iHeight) ); // not width and height minus 1 since viTilUR represents the end of the tile corner.
// In case lightData.shadowDimmer == 0.0 we need to avoid rendering the shadow map... see how it can be done with the culling (and more specifically, how can we do that BEFORE sending for shadows)
publicstaticGUIContenttessellationShapeFactorText=newGUIContent("Shape factor","Strength of Phong tessellation shape (lerp factor)");
publicstaticGUIContenttessellationBackFaceCullEpsilonText=newGUIContent("Triangle culling Epsilon","If -1.0 back face culling is enabled for tessellation, higher number mean more aggressive culling and better performance");
publicstaticGUIContenttessellationObjectScaleText=newGUIContent("Enable object scale","Tessellation displacement will take into account the object scale - Only work with uniform positive scale");
publicstaticGUIContenttessellationTilingScaleText=newGUIContent("Enable tiling scale","Tessellation displacement will take into account the tiling scale - Only work with uniform positive scale");
// Return the maximun amplitude use by all enabled heightmap
// use for tessellation culling and per pixel displacement
// TODO: For vertex displacement this should take into account the modification in ApplyTessellationTileScale but it should be conservative here (as long as tiling is not negative)
float GetMaxDisplacement()
{
float maxDisplacement = 0.0;
// - Blend Mask use same mapping as main layer (UVO, Planar, Triplanar)
// From these rules it mean that PPD is enable only if the user 1) ask for it, 2) if there is one heightmap enabled on active layer, 3) if mapping is the same for all layer respecting 2), 4) if mapping is UV0, planar or triplanar mapping
// Most contraint are handled by the inspector (i.e the UI) like the mapping constraint and is assumed in the shader.
uint2 viTilUR = min( viTilLL+uint2(16,16), uint2(iWidth, iHeight) ); // not width and height minus 1 since viTilUR represents the end of the tile corner.
uint2 viTilLL = TILE_SIZE_CLUSTERED*tileIDX;
uint2 viTilUR = min( viTilLL+uint2(TILE_SIZE_CLUSTERED,TILE_SIZE_CLUSTERED), uint2(iWidth, iHeight) ); // not width and height minus 1 since viTilUR represents the end of the tile corner.