39 float distribution = uni.
uniform_buf.volumes.depth_distribution;
42 return (
exp2(
z / distribution) - near) / far;
46 return near + (far - near) *
z;
53 const ViewMatrices view,
float depth,
float near,
float far,
float distribution)
57 return distribution *
log2(
max(1e-8, depth * far + near));
61 return (depth - near) / (far - near);
202 uni.
uniform_buf.volumes.history_depth_distribution);
204 if (uvw_history.
z < 0.0f || uvw_history.
z > 1.0f) {
212 return 1.0f / (4.0f *
M_PI);
219 g =
clamp(g, -1.0f + 1e-3f, 1.0f - 1e-3f);
221 return (1 - sqr_g) /
max(1e-8f, 4.0f *
M_PI *
pow(1 + sqr_g - 2 * g *
cos_theta, 3.0f / 2.0f));
ccl_device_inline float cos_theta(const float3 w)
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
#define VOLUME_PROP_SCATTERING_IMG_SLOT
#define VOLUME_PROP_PHASE_WEIGHT_IMG_SLOT
#define VOLUME_TRANSMITTANCE_TEX_SLOT
#define VOLUME_PROP_EXTINCTION_IMG_SLOT
#define VOLUME_PROP_PHASE_IMG_SLOT
#define VOLUME_SCATTERING_TEX_SLOT
#define VOLUME_PROP_EMISSION_IMG_SLOT
float volume_view_depth_get(const eevee::Uniform &uni, float3 vP)
float3 volume_resolve_to_screen(const eevee::Uniform &uni, const ViewMatrices view, float3 coord)
SphericalHarmonicL1< float4 > volume_phase_function_as_sh_L1(float3 V, float g)
float volume_z_to_view_z(const eevee::Uniform &uni, const ViewMatrices view, float z)
float3 volume_view_to_jitter(const eevee::Uniform &uni, const ViewMatrices view, float3 vP)
float3 volume_jitter_to_view(const eevee::Uniform &uni, const ViewMatrices view, float3 coord)
float3 volume_screen_to_resolve(const eevee::Uniform &uni, const ViewMatrices view, float3 coord)
float volume_phase_function(float3 V, float3 L, float g)
float volume_phase_function_isotropic()
float3 volume_screen_to_view(const eevee::Uniform &uni, const ViewMatrices view, float2 screen_uv, float view_z)
float volume_froxel_jitter(int2 froxel, float offset)
float view_z_to_volume_z(const ViewMatrices view, float depth, float near, float far, float distribution)
float3 volume_history_uvw_get(const eevee::Uniform &uni, const ViewMatrices view, int3 froxel)
bool volume_uses_radial_depth(const eevee::Uniform &uni)
#define image(slot, qualifiers, format)
bool any(VecOp< bool, D >) RET
VecBase< bool, D > greaterThan(VecOp< T, D >, VecOp< T, D >) RET
VecBase< float, D > normalize(VecOp< float, D >) RET
float dot(VecOp< float, D >, VecOp< float, D >) RET
constexpr T clamp(T, U, U) RET
float length(VecOp< float, D >) RET
ImageBase< float, 3 > image3D
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
SamplerBase< float, 3 > sampler3D
MatBase< float, 4, 4 > float4x4
VecBase< float, 3 > float3
float interleaved_gradient(float2 pixel, float seed, float offset)
float L1_M0_coef(float3 v)
float L1_Mn1_coef(float3 v)
float L1_Mp1_coef(float3 v)
spherical_harmonics::BandL1< T > L1
spherical_harmonics::BandL0< T > L0
sampler3D volume_transmittance_tx
VolumeResolveSample resolve(float3 ndc_P) const
sampler3D volume_scattering_tx
image3D in_extinction_img
image3D in_phase_weight_img
image3D in_scattering_img
bool is_perspective() const
float3 perspective_divide(float4 hs_P) const
float depth_screen_to_view(float ss_depth) const
T ndc_to_screen(T ndc_P) const
T screen_to_ndc(T ss_P) const
float depth_view_to_screen(float v_depth) const
ViewMatrices get(uint view_id) const
CCL_NAMESPACE_BEGIN struct Window V