Fix T57617 Volumetrics doesn't work on the Orthographic Camera
common_data.view_vecs were not updated before use.
This commit is contained in:
@@ -508,7 +508,7 @@ void EEVEE_update_noise(EEVEE_PassList *psl, EEVEE_FramebufferList *fbl, const d
|
||||
DRW_draw_pass(psl->update_noise_pass);
|
||||
}
|
||||
|
||||
static void EEVEE_update_viewvecs(float invproj[4][4], float winmat[4][4], float (*r_viewvecs)[4])
|
||||
void EEVEE_update_viewvecs(float invproj[4][4], float winmat[4][4], float (*r_viewvecs)[4])
|
||||
{
|
||||
/* view vectors for the corners of the view frustum.
|
||||
* Can be used to recreate the world space position easily */
|
||||
|
||||
@@ -860,6 +860,7 @@ struct GPUMaterial *EEVEE_material_hair_get(struct Scene *scene, Material *ma, i
|
||||
void EEVEE_materials_free(void);
|
||||
void EEVEE_draw_default_passes(EEVEE_PassList *psl);
|
||||
void EEVEE_update_noise(EEVEE_PassList *psl, EEVEE_FramebufferList *fbl, const double offsets[3]);
|
||||
void EEVEE_update_viewvecs(float invproj[4][4], float winmat[4][4], float (*r_viewvecs)[4]);
|
||||
|
||||
/* eevee_lights.c */
|
||||
void EEVEE_lights_init(EEVEE_ViewLayerData *sldata);
|
||||
|
||||
@@ -290,6 +290,12 @@ int EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
|
||||
common_data->vol_shadow_steps = 0;
|
||||
}
|
||||
|
||||
/* Update view_vecs */
|
||||
float invproj[4][4], winmat[4][4];
|
||||
DRW_viewport_matrix_get(winmat, DRW_MAT_WIN);
|
||||
DRW_viewport_matrix_get(invproj, DRW_MAT_WININV);
|
||||
EEVEE_update_viewvecs(invproj, winmat, sldata->common_data.view_vecs);
|
||||
|
||||
if (DRW_viewport_is_persp_get()) {
|
||||
float sample_distribution = scene_eval->eevee.volumetric_sample_distribution;
|
||||
sample_distribution = 4.0f * (1.00001f - sample_distribution);
|
||||
|
||||
Reference in New Issue
Block a user