Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/volumetric.c
| Context not available. | |||||
| #include "volumetric.h" | #include "volumetric.h" | ||||
| #include "volume_precache.h" | #include "volume_precache.h" | ||||
| #include "IMB_colormanagement.h" | |||||
| /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ | /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ | ||||
| /* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ | /* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ | ||||
| /* only to be used here in this file, it's for speed */ | /* only to be used here in this file, it's for speed */ | ||||
| Context not available. | |||||
| if (shi->mat->vol.shadeflag & MA_VOL_RECV_EXT_SHADOW) { | if (shi->mat->vol.shadeflag & MA_VOL_RECV_EXT_SHADOW) { | ||||
| mul_v3_fl(lacol, vol_get_shadow(shi, lar, co)); | mul_v3_fl(lacol, vol_get_shadow(shi, lar, co)); | ||||
| if (rgb_to_luma_y(lacol) < 0.001f) return; | if (IMB_colormanagement_get_luminance(lacol) < 0.001f) return; | ||||
| } | } | ||||
| /* find minimum of volume bounds, or lamp coord */ | /* find minimum of volume bounds, or lamp coord */ | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| if (rgb_to_luma_y(lacol) < 0.001f) return; | if (IMB_colormanagement_get_luminance(lacol) < 0.001f) return; | ||||
| normalize_v3(lv); | normalize_v3(lv); | ||||
| p = vol_get_phasefunc(shi, shi->mat->vol.asymmetry, view, lv); | p = vol_get_phasefunc(shi, shi->mat->vol.asymmetry, view, lv); | ||||
| Context not available. | |||||
| if (t0 > t1 * 0.25f) { | if (t0 > t1 * 0.25f) { | ||||
| /* only use depth cutoff after we've traced a little way into the volume */ | /* only use depth cutoff after we've traced a little way into the volume */ | ||||
| if (rgb_to_luma_y(tr) < shi->mat->vol.depth_cutoff) break; | if (IMB_colormanagement_get_luminance(tr) < shi->mat->vol.depth_cutoff) break; | ||||
| } | } | ||||
| vol_get_emission(shi, emit_col, p); | vol_get_emission(shi, emit_col, p); | ||||
| Context not available. | |||||
| add_v3_v3(col, radiance); | add_v3_v3(col, radiance); | ||||
| /* alpha <-- transmission luminance */ | /* alpha <-- transmission luminance */ | ||||
| col[3] = 1.0f - rgb_to_luma_y(tr); | col[3] = 1.0f - IMB_colormanagement_get_luminance(tr); | ||||
| } | } | ||||
| /* the main entry point for volume shading */ | /* the main entry point for volume shading */ | ||||
| Context not available. | |||||
| copy_v3_v3(shr->combined, tr); | copy_v3_v3(shr->combined, tr); | ||||
| shr->combined[3] = 1.0f - rgb_to_luma_y(tr); | shr->combined[3] = 1.0f - IMB_colormanagement_get_luminance(tr); | ||||
| shr->alpha = shr->combined[3]; | shr->alpha = shr->combined[3]; | ||||
| } | } | ||||
| Context not available. | |||||