Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline float SampleDensity(float3 pos, float scale, float phase)
- {
- float bias = 10000;
- float3 texScale = _VolumeTex_ST.xyx / bias / scale;
- float3 texOffset = (_TexOffset + _ScrollOffset) * phase * texScale;
- float3 texPos = pos * texScale + texOffset;
- //radial mask
- //needs...
- //float4 _RadiusOffset;
- //float _RadiusMaskHeight;
- //at the top of this class.
- //and those properties to be exposed in MassiveCloudsMaterial.shader
- //_RadiusOffset("RadiusOffset", Vector) = (0,0,0,0)
- //_RadiusMaskHeight("RadiusMaskHeight", Float) = 0
- float2 posxz = (float2(pos.x, pos.z));
- float2 radiusOffset = (float2(_RadiusOffset.x, _RadiusOffset.y));
- float distFromCenter = distance(((posxz / (pos.y * _RadiusMaskHeight)) + radiusOffset), float2(0, 0));
- float saturated = saturate((distFromCenter + _RadiusOffset.z) * _RadiusOffset.w);
- float3 densityRadialMask = (saturated).xxx;
- //end radial mask. Multiply density by this!
- return tex3Dlod(_VolumeTex, float4(texPos.xyz, 0)).a * densityRadialMask; // *(1.0 - densityRadialMask);
- }
Advertisement
Add Comment
Please, Sign In to add comment