42 int64_t render_pixel_count = render_extent.x * (
int64_t)render_extent.y;
44 extent_[0] = extent_[1] =
ceilf(
sqrtf(1 + (render_pixel_count / 6)));
49 extent_ = render_extent;
62 const float(*viewmat_p)[4] = viewmat.
ptr(), (*winmat_p)[4] = winmat.
ptr();
66 float side = cam.clip_near * 1.05f;
67 float near = cam.clip_near;
68 float far = cam.clip_far;
70 viewmat = face_matrix_ * cam.viewmat;
73 viewmat_p = cam.viewmat.ptr();
74 winmat_p = cam.winmat.ptr();
77 main_view_ =
DRW_view_create(viewmat_p, winmat_p,
nullptr,
nullptr,
nullptr);
105 combined_fb_.ensure(GPU_ATTACHMENT_TEXTURE(rbufs.
depth_tx),
107 prepass_fb_.ensure(GPU_ATTACHMENT_TEXTURE(rbufs.
depth_tx),
108 GPU_ATTACHMENT_TEXTURE(rbufs.
vector_tx));
120 GPU_framebuffer_clear_color(prepass_fb_, clear_velocity);
122 float4 clear_color = {0.0f, 0.0f, 0.0f, 1.0f};
124 GPU_framebuffer_clear_color_depth(combined_fb_, clear_color, 1.0f);
146 postfx_tx_.release();
154 if (!dof_.postfx_enabled() && !mb_.enabled()) {
159 postfx_tx_.acquire(extent_,
GPU_RGBA16F, (
void *)name_);
161 GPUTexture *velocity_tx = velocity_.view_vectors_get();
165 dof_.render(depth_tx_, &input_tx, &output_tx);
166 mb_.render(depth_tx_, velocity_tx, &input_tx, &output_tx);
171 void ShadingView::update_view()
typedef float(TangentPoint)[2]
void window_translate_m4(float winmat[4][4], float perspmat[4][4], float x, float y)
void perspective_m4(float mat[4][4], float left, float right, float bottom, float top, float nearClip, float farClip)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
struct GPUTexture GPUTexture
const CameraData & data_get() const
float2 pixel_jitter_get() const
void accumulate(const DRWView *view)
int2 render_extent_get() const
void render(const DRWView *view, Framebuffer &prepass_fb, Framebuffer &combined_fb, GPUTexture *depth_tx, GPUTexture *combined_tx)
RenderBuffers render_buffers
TextureFromPool combined_tx
void acquire(int2 extent, void *owner)
TextureFromPool vector_tx
GPUTexture * render_post(GPUTexture *input_tx)
bool camera_has_motion() const
void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse)
DRWView * DRW_view_create(const float viewmat[4][4], const float winmat[4][4], const float(*culling_viewmat)[4], const float(*culling_winmat)[4], DRWCallVisibilityFn *visibility_fn)
DRWView * DRW_view_create_sub(const DRWView *parent_view, const float viewmat[4][4], const float winmat[4][4])
void DRW_view_update_sub(DRWView *view, const float viewmat[4][4], const float winmat[4][4])
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_view_set_active(const DRWView *view)
void DRW_stats_group_start(const char *name)
void DRW_stats_group_end(void)
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img GPU_RGBA16F
smooth(Type::VEC3, "prev") .smooth(Type CameraData
vec_base< float, 4 > float4
vec_base< float, 2 > float2