Volumetric bugfix master
- Added a temporary workaround to Lit.hlsl to avoid broken lighting code with Metal/AMD
- Fixed compilation errors on Nintendo Switch (limited XRSetting support).
- Fixed apply range attenuation option on punctual light
- Fixed issue when using more than one volume mask texture with density volumes.
### Added
- Add option supportDitheringCrossFade on HDRP Asset to allow to remove shader variant during player build if needed
{
if (textures.Contains(volumeTexture))
textures.Add(volumeTexture);
textures.Remove(volumeTexture);
needTextureUpdate = true;
}
// Express the voxel center in the local coordinate system of the box.
float3 voxelCenterBS = mul(voxelCenterWS - obb.center, transpose(obbFrame));
float3 voxelCenterUV = (voxelCenterBS / obbExtents) * 0.5 + 0.5;
float3 voxelCenterUV = (voxelCenterBS / obbExtents);
#if SOFT_VOXELIZATION
// We need to determine which is the face closest to 'voxelCenterBS'.
if (volumeAtlas != null)
volumeAtlasDimensions.x = volumeAtlas.width / volumeAtlas.depth; // 1 / number of textures
volumeAtlasDimensions.x = (float)volumeAtlas.width / volumeAtlas.depth; // 1 / number of textures
volumeAtlasDimensions.y = 1.0f / volumeAtlas.width;
volumeAtlasDimensions.z = volumeAtlas.width;