39 PassSimple clear_ps_ = {
"World.Background.Clear"};
45 void sync(
GPUMaterial *gpumat,
float background_opacity,
float background_blur);
111 PassMain render_ps_ = {
"Shadow.Surface"};
151 bool has_opaque_ =
false;
152 bool has_transparent_ =
false;
244class DeferredPipeline;
247 friend DeferredPipeline;
252 static constexpr int max_lighting_tile_count_ = 128 * 128;
269 {
"direct_radiance_1"}, {
"direct_radiance_2"}, {
"direct_radiance_3"}};
272 {
"indirect_radiance_1"}, {
"indirect_radiance_2"}, {
"indirect_radiance_3"}};
274 Texture dummy_black = {
"dummy_black"};
276 GPUTexture *radiance_feedback_tx_ =
nullptr;
282 Texture tile_mask_tx_ = {
"tile_mask_tx_"};
286 bool use_split_radiance_ =
true;
288 bool use_feedback_output_ =
false;
289 bool use_raytracing_ =
false;
290 bool use_screen_transmission_ =
false;
291 bool use_screen_reflection_ =
false;
292 bool use_clamp_direct_ =
false;
293 bool use_clamp_indirect_ =
false;
306 void end_sync(
bool is_first_pass,
bool is_last_pass,
bool next_layer_has_transmission);
329 GPUTexture *radiance_behind_tx);
333 friend DeferredLayer;
338 DeferredLayer opaque_layer_;
339 DeferredLayer refraction_layer_;
340 DeferredLayer volumetric_layer_;
342 PassSimple debug_draw_ps_ = {
"debug_gbuffer"};
344 bool use_combined_lightprobe_eval;
348 : opaque_layer_(inst), refraction_layer_(inst), volumetric_layer_(inst){};
368 return max_ii(opaque_layer_.closure_layer_count(), refraction_layer_.closure_layer_count());
374 return max_ii(opaque_layer_.normal_layer_count(), refraction_layer_.normal_layer_count());
381 return opaque_layer_.is_empty() && refraction_layer_.is_empty();
385 void debug_pass_sync();
418 PassMain volume_layer_ps_ = {
"Volume.Layer"};
425 std::optional<Bounds<float2>> combined_screen_bounds_;
434 const ::Material *blender_mat,
437 const ::Material *blender_mat,
456 std::optional<Bounds<float>> object_integration_range_;
458 bool has_scatter_ =
false;
459 bool has_absorption_ =
false;
477 for (
auto &layer : layers_) {
478 if (layer->has_scatter) {
486 for (
auto &layer : layers_) {
487 if (layer->has_absorption) {
530 return opaque_layer_.closure_layer_count();
536 return opaque_layer_.normal_layer_count();
562 GPUTexture *depth_layer_tx,
579 PassMain surface_ps_ = {
"Capture.Surface"};
604 static constexpr int lut_size_sqr = lut_size * lut_size;
628 layer.data[
y][
x][2] = 0.0f;
645 layer.data[
y][
x][3] = 0.0f;
708 data.is_sphere_probe =
false;
732 switch (pipeline_type) {
734 return probe.prepass_add(blender_mat, gpumat);
736 return probe.material_add(blender_mat, gpumat);
743 switch (pipeline_type) {
745 return planar.prepass_add(blender_mat, gpumat);
747 return planar.material_add(blender_mat, gpumat);
754 switch (pipeline_type) {
756 return deferred.prepass_add(blender_mat, gpumat,
false);
758 return forward.prepass_opaque_add(blender_mat, gpumat,
false);
760 BLI_assert_msg(0,
"Overlap prepass should register to the forward pipeline directly.");
764 return deferred.prepass_add(blender_mat, gpumat,
true);
766 return forward.prepass_opaque_add(blender_mat, gpumat,
true);
769 return deferred.material_add(blender_mat, gpumat);
771 return forward.material_opaque_add(blender_mat, gpumat);
773 return shadow.surface_material_add(blender_mat, gpumat);
775 return capture.surface_material_add(blender_mat, gpumat);
779 BLI_assert_msg(0,
"Volume shaders must register to the volume pipeline directly.");
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
MINLINE int max_ii(int a, int b)
MINLINE int count_bits_i(unsigned int n)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
void GPU_texture_update_mipmap(GPUTexture *texture, int mip_level, eGPUDataFormat data_format, const void *pixels)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
Texture(const char *name="gpu::Texture")
detail::PassBase< command::DrawMultiBuf > Sub
void sync(GPUMaterial *gpumat, float background_opacity, float background_blur)
BackgroundPipeline(Instance &inst)
PassMain::Sub * surface_material_add(::Material *blender_mat, GPUMaterial *gpumat)
CapturePipeline(Instance &inst)
void end_sync(bool is_first_pass, bool is_last_pass, bool next_layer_has_transmission)
DeferredLayer(Instance &inst)
bool has_transmission() const
PassMain::Sub * prepass_add(::Material *blender_mat, GPUMaterial *gpumat, bool has_motion)
PassMain::Sub * material_add(::Material *blender_mat, GPUMaterial *gpumat)
int normal_layer_count() const
PassMain::Sub * material_add(::Material *material, GPUMaterial *gpumat)
int closure_layer_count() const
void debug_draw(draw::View &view, GPUFrameBuffer *combined_fb)
DeferredPipeline(Instance &inst)
PassMain::Sub * prepass_add(::Material *material, GPUMaterial *gpumat, bool has_motion)
int closure_layer_count() const
PassMain::Sub * prepass_add(::Material *material, GPUMaterial *gpumat)
DeferredProbePipeline(Instance &inst)
PassMain::Sub * material_add(::Material *material, GPUMaterial *gpumat)
int normal_layer_count() const
PassMain::Sub * prepass_opaque_add(::Material *blender_mat, GPUMaterial *gpumat, bool has_motion)
PassMain::Sub * material_opaque_add(::Material *blender_mat, GPUMaterial *gpumat)
PassMain::Sub * material_transparent_add(const Object *ob, ::Material *blender_mat, GPUMaterial *gpumat)
ForwardPipeline(Instance &inst)
PassMain::Sub * prepass_transparent_add(const Object *ob, ::Material *blender_mat, GPUMaterial *gpumat)
A running instance of the engine.
WorldVolumePipeline world_volume
DeferredProbePipeline probe
UtilityTexture utility_tx
BackgroundPipeline background
PipelineModule(Instance &inst, PipelineInfoData &data)
PassMain::Sub * material_add(Object *, ::Material *blender_mat, GPUMaterial *gpumat, eMaterialPipeline pipeline_type, eMaterialProbe probe_capture)
PlanarProbePipeline planar
DeferredPipeline deferred
PlanarProbePipeline(Instance &inst)
PassMain::Sub * prepass_add(::Material *material, GPUMaterial *gpumat)
PassMain::Sub * material_add(::Material *material, GPUMaterial *gpumat)
PassMain::Sub * surface_material_add(::Material *material, GPUMaterial *gpumat)
ShadowPipeline(Instance &inst)
VolumeLayer(Instance &inst)
bool bounds_overlaps(const VolumeObjectBounds &object_aabb) const
PassMain::Sub * occupancy_add(const Object *ob, const ::Material *blender_mat, GPUMaterial *gpumat)
void add_object_bound(const VolumeObjectBounds &object_aabb)
PassMain::Sub * material_add(const Object *ob, const ::Material *blender_mat, GPUMaterial *gpumat)
std::optional< Bounds< float > > object_integration_range() const
VolumeLayer * register_and_get_layer(Object *ob)
bool has_absorption() const
bool use_hit_list() const
VolumePipeline(Instance &inst)
WorldPipeline(Instance &inst)
void sync(GPUMaterial *gpumat)
void sync(GPUMaterial *gpumat)
WorldVolumePipeline(Instance &inst)
#define RAYTRACE_RADIANCE_FORMAT
#define UTIL_DISK_INTEGRAL_COMP
#define UTIL_DISK_INTEGRAL_LAYER
#define UTIL_BTDF_LAYER_COUNT
#define UTIL_LTC_MAT_LAYER
#define UTIL_SSS_TRANSMITTANCE_PROFILE_LAYER
#define UTIL_BLUE_NOISE_LAYER
detail::Pass< command::DrawCommandBuf > PassSimple
detail::Pass< command::DrawMultiBuf > PassMain
const float ltc_mat_ggx[64][64][4]
const float burley_sss_profile[64][1]
const float brdf_ggx[64][64][3]
const float random_walk_sss_profile[64][1]
const float ltc_disk_integral[64][64][1]
const float btdf_ggx[16][64][64][1]
const float bsdf_ggx[16][64][64][3]
const float blue_noise[64][64][4]
@ MAT_PIPE_PREPASS_FORWARD_VELOCITY
@ MAT_PIPE_VOLUME_MATERIAL
@ MAT_PIPE_PREPASS_DEFERRED
@ MAT_PIPE_PREPASS_OVERLAP
@ MAT_PIPE_PREPASS_PLANAR
@ MAT_PIPE_PREPASS_DEFERRED_VELOCITY
@ MAT_PIPE_VOLUME_OCCUPANCY
@ MAT_PIPE_PREPASS_FORWARD
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 3 > float3
eClosureBits closure_bits_
int closure_layer_count() const
PassMain::Sub * gbuffer_double_sided_ps_
PassMain::Sub * gbuffer_double_sided_hybrid_ps_
PassMain::Sub * prepass_double_sided_static_ps_
PassMain::Sub * gbuffer_single_sided_ps_
PassMain::Sub * prepass_single_sided_static_ps_
void gbuffer_pass_sync(Instance &inst)
PassMain::Sub * prepass_double_sided_moving_ps_
PassMain::Sub * gbuffer_single_sided_hybrid_ps_
int normal_layer_count() const
PassMain::Sub * prepass_single_sided_moving_ps_
std::optional< Bounds< float2 > > screen_bounds
VolumeObjectBounds(const Camera &camera, Object *ob)
std::optional< Bounds< float > > z_range