Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonis Ryakiotakis <kalast@gmail.com>2022-02-07 21:37:15 +0300
committerAntonis Ryakiotakis <kalast@gmail.com>2022-02-07 21:37:15 +0300
commitd8c05502272990173381bfd2590884bbc95aa5f5 (patch)
tree8bd65efacbe6484b838d4550597d0f4a54ddddd9 /source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh
parentb64d551f3b2fa409b4eeefb641fc581eb6cd0bd6 (diff)
parentfe1816f67fbc6aaf383ec77847d668367335d093 (diff)
Merge branch 'master' into KTX_supportKTX_support
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh')
-rw-r--r--source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh55
1 files changed, 55 insertions, 0 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh
new file mode 100644
index 00000000000..252a7d4f3a3
--- /dev/null
+++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_effect_dof_info.hh
@@ -0,0 +1,55 @@
+
+#include "gpu_shader_create_info.hh"
+
+GPU_SHADER_CREATE_INFO(workbench_effect_dof)
+ /* TODO(fclem): Split resources per stage. */
+ .sampler(0, ImageType::FLOAT_2D, "inputCocTex")
+ .sampler(1, ImageType::FLOAT_2D, "maxCocTilesTex")
+ .sampler(2, ImageType::FLOAT_2D, "sceneColorTex")
+ .sampler(3, ImageType::FLOAT_2D, "sceneDepthTex")
+ .sampler(4, ImageType::FLOAT_2D, "backgroundTex")
+ .sampler(5, ImageType::FLOAT_2D, "halfResColorTex")
+ .sampler(6, ImageType::FLOAT_2D, "blurTex")
+ .sampler(7, ImageType::FLOAT_2D, "noiseTex")
+ .push_constant(Type::VEC2, "invertedViewportSize")
+ .push_constant(Type::VEC2, "nearFar")
+ .push_constant(Type::VEC3, "dofParams")
+ .push_constant(Type::FLOAT, "noiseOffset")
+ .fragment_source("workbench_effect_dof_frag.glsl")
+ .additional_info("draw_fullscreen")
+ .additional_info("draw_view");
+
+GPU_SHADER_CREATE_INFO(workbench_effect_dof_prepare)
+ .define("PREPARE")
+ .fragment_out(0, Type::VEC4, "halfResColor")
+ .fragment_out(1, Type::VEC2, "normalizedCoc")
+ .additional_info("workbench_effect_dof")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(workbench_effect_dof_downsample)
+ .define("DOWNSAMPLE")
+ .fragment_out(0, Type::VEC4, "outColor")
+ .fragment_out(1, Type::VEC2, "outCocs")
+ .additional_info("workbench_effect_dof")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(workbench_effect_dof_blur1)
+ .define("BLUR1")
+ .define("NUM_SAMPLES", "49")
+ .uniform_buf(1, "vec4", "samples[49]")
+ .fragment_out(0, Type::VEC4, "blurColor")
+ .additional_info("workbench_effect_dof")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(workbench_effect_dof_blur2)
+ .define("BLUR2")
+ .fragment_out(0, Type::VEC4, "finalColor")
+ .additional_info("workbench_effect_dof")
+ .do_static_compilation(true);
+
+GPU_SHADER_CREATE_INFO(workbench_effect_dof_resolve)
+ .define("RESOLVE")
+ .fragment_out(0, Type::VEC4, "finalColorAdd", DualBlend::SRC_0)
+ .fragment_out(0, Type::VEC4, "finalColorMul", DualBlend::SRC_1)
+ .additional_info("workbench_effect_dof")
+ .do_static_compilation(true); \ No newline at end of file