39 int64_t render_pixel_count = render_extent.x *
int64_t(render_extent.y);
41 extent_[0] = extent_[1] =
ceilf(
sqrtf(1 + (render_pixel_count / 6)));
46 extent_ = render_extent;
66 viewmat = face_matrix_ * cam.
viewmat;
73 main_view_.
sync(viewmat, winmat);
119 float4 clear_color = {0.0f, 0.0f, 0.0f, 1.0f};
151 render_transparent_pass(rbufs);
160 GPUTexture *combined_final_tx = render_postfx(rbufs.
combined_tx);
169void ShadingView::render_transparent_pass(
RenderBuffers &rbufs)
176 float4 clear_color = {0.0f, 0.0f, 0.0f, 1.0f};
183GPUTexture *ShadingView::render_postfx(GPUTexture *input_tx)
199 GPUTexture *output_tx = postfx_tx_;
208void ShadingView::update_view()
215 if (film.scaling_factor_get() > 1) {
219 float left, right, bottom,
top, near, far;
223 const float2 render_size_with_overscan = top_right_with_overscan - bottom_left_with_overscan;
225 float2 bottom_left = bottom_left_with_overscan;
226 float2 top_right = top_right_with_overscan;
227 float2 render_size = render_size_with_overscan;
230 if (overscan > 0.0f) {
233 const float max_size_original = max_size_with_overscan / (1.0f + 2.0f * overscan);
234 const float overscan_size = (max_size_with_overscan - max_size_original) / 2.0f;
236 bottom_left = bottom_left_with_overscan + overscan_size;
237 top_right = top_right_with_overscan - overscan_size;
239 render_size = top_right - bottom_left;
243 const float2 pixel_size = render_size /
float2(film.film_extent_get());
246 const int2 render_extent = film.render_extent_get() * film.scaling_factor_get();
247 const int overscan_pixels = film.render_overscan_get() * film.scaling_factor_get();
249 const float2 render_bottom_left = bottom_left - pixel_size * float(overscan_pixels);
250 const float2 render_top_right = render_bottom_left + pixel_size *
float2(render_extent);
255 render_bottom_left.
y,
263 render_bottom_left.
y,
276 jitter_view_.
sync(viewmat, winmat);
281 render_view_.
sync(viewmat, winmat);
292 const auto update_info = inst_.
sphere_probes.world_update_info_pop();
293 if (!update_info.has_value()) {
300 if (update_info->do_render) {
304 update_info->clipping_distances.x,
305 -update_info->clipping_distances.x,
306 update_info->clipping_distances.x,
307 update_info->clipping_distances.x,
308 update_info->clipping_distances.y);
309 view.sync(view_m4, win_m4);
317 inst_.
sphere_probes.remap_to_octahedral_projection(update_info->atlas_coord,
true);
327 while (
const auto update_info = inst_.
sphere_probes.probe_update_info_pop()) {
335 int2 extent =
int2(update_info->cube_target_extent);
351 update_info->clipping_distances.x,
352 -update_info->clipping_distances.x,
353 update_info->clipping_distances.x,
354 update_info->clipping_distances.x,
355 update_info->clipping_distances.y);
356 view.sync(view_m4, win_m4);
377 inst_.
sphere_probes.remap_to_octahedral_projection(update_info->atlas_coord,
false);
399 const float radius = inst_.
lookdev.sphere_radius_;
402 -radius, radius, -radius, radius, clip);
404 view_.
sync(view_m4, win_m4);
void window_translate_m4(float winmat[4][4], float perspmat[4][4], float x, float y)
void projmat_dimensions(const float winmat[4][4], float *r_left, float *r_right, float *r_bottom, float *r_top, float *r_near, float *r_far)
void GPU_debug_group_end()
void GPU_debug_group_begin(const char *name)
#define GPU_ATTACHMENT_TEXTURE(_texture)
#define GPU_ATTACHMENT_TEXTURE_CUBEFACE(_texture, _face)
#define GPU_ATTACHMENT_NONE
void GPU_framebuffer_clear_color_depth(GPUFrameBuffer *fb, const float clear_col[4], float clear_depth)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void GPU_framebuffer_clear_color(GPUFrameBuffer *fb, const float clear_col[4])
#define GPU_ATTACHMENT_TEXTURE_LAYER(_texture, _layer)
void ensure(GPUAttachment depth=GPU_ATTACHMENT_NONE, GPUAttachment color1=GPU_ATTACHMENT_NONE, GPUAttachment color2=GPU_ATTACHMENT_NONE, GPUAttachment color3=GPU_ATTACHMENT_NONE, GPUAttachment color4=GPU_ATTACHMENT_NONE, GPUAttachment color5=GPU_ATTACHMENT_NONE, GPUAttachment color6=GPU_ATTACHMENT_NONE, GPUAttachment color7=GPU_ATTACHMENT_NONE, GPUAttachment color8=GPU_ATTACHMENT_NONE)
void acquire(int2 extent, eGPUTextureFormat format, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL)
void clear(float4 values)
GPUTexture * layer_view(int layer)
bool is_persp(int view_id=0) const
const float4x4 & winmat(int view_id=0) const
const float4x4 & viewmat(int view_id=0) const
void sync(const float4x4 &view_mat, const float4x4 &win_mat, int view_id=0)
void render_pass(View &view)
void render(View &view, Framebuffer &combined_fb)
const CameraData & data_get() const
int normal_layer_count() const
int closure_layer_count() const
int header_layer_count() const
void render(View &main_view, View &render_view, Framebuffer &prepass_fb, Framebuffer &combined_fb, Framebuffer &gbuffer_fb, int2 extent, RayTraceBuffer &rt_buffer_opaque_layer, RayTraceBuffer &rt_buffer_refract_layer)
void render(View &view, Framebuffer &prepass_fb, Framebuffer &combined_fb, Framebuffer &gbuffer_fb, int2 extent)
int closure_layer_count() const
int normal_layer_count() const
int header_layer_count() const
void render(View &view, GPUTexture **input_tx, GPUTexture **output_tx, DepthOfFieldBuffer &dof_buffer)
void jitter_apply(float4x4 &winmat, float4x4 &viewmat)
bool postfx_enabled() const
float2 pixel_jitter_get() const
struct blender::eevee::Film::DepthState depth
void accumulate(View &view, GPUTexture *combined_final_tx)
int2 render_extent_get() const
void render(View &view, Framebuffer &prepass_fb, Framebuffer &combined_fb, int2 extent)
void debug_draw(View &view, GPUFrameBuffer *view_fb)
void set_source(GPUTexture **texture, int layer=-1)
VolumeProbeModule volume_probes
SphereProbeModule sphere_probes
AmbientOcclusion ambient_occlusion
RenderBuffers render_buffers
DepthOfField depth_of_field
PlanarProbeModule planar_probes
UniformDataModule uniform_data
MotionBlurModule motion_blur
void set_view(View &view, const int2 extent)
void debug_draw(View &view, GPUFrameBuffer *view_fb)
bool postfx_enabled() const
void render(View &view, GPUTexture **input_tx, GPUTexture **output_tx)
DeferredProbePipeline probe
BackgroundPipeline background
DeferredPipeline deferred
void set_view(const draw::View &main_view, int2 main_view_extent)
void viewport_draw(View &view, GPUFrameBuffer *view_fb)
TextureFromPool combined_tx
void acquire(int2 extent)
RenderBuffersInfoData & data
TextureFromPool vector_tx
void debug_draw(View &view, GPUFrameBuffer *view_fb)
void viewport_draw(View &view, GPUFrameBuffer *view_fb)
bool camera_has_motion() const
void draw_compute(View &main_view, int2 extent)
void draw_prepass(View &main_view)
void viewport_draw(View &view, GPUFrameBuffer *view_fb)
float4x4 cubeface_mat(int face)
MatBase< T, 4, 4 > orthographic(T left, T right, T bottom, T top, T near_clip, T far_clip)
Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to ...
MatBase< T, 4, 4 > orthographic_infinite(T left, T right, T bottom, T top)
Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to ...
MatBase< T, 4, 4 > perspective(T left, T right, T bottom, T top, T near_clip, T far_clip)
Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-...
T reduce_max(const VecBase< T, Size > &a)
MatBase< T, NumCol, NumRow > translate(const MatBase< T, NumCol, NumRow > &mat, const VectorT &translation)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
const c_style_mat & ptr() const
void acquire(int2 extent, int header_count, int data_count, int normal_count)