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:
authorJulian Eisel <julian@blender.org>2022-11-10 15:17:42 +0300
committerJulian Eisel <julian@blender.org>2022-11-10 15:17:42 +0300
commit7246c387435769a169ac24c91434c615df6434b4 (patch)
tree61842e3e0ce85e80720fdd7476d44d2e629f59fd /source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_map_value.glsl
parentc5f55d17096d373791363e46004176e3f7f7ae52 (diff)
parent0b4bd3ddc016298e868169a541cf6c132b10c587 (diff)
Merge branch 'master' into asset-browser-grid-viewasset-browser-grid-view
Diffstat (limited to 'source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_map_value.glsl')
-rw-r--r--source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_map_value.glsl56
1 files changed, 0 insertions, 56 deletions
diff --git a/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_map_value.glsl b/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_map_value.glsl
deleted file mode 100644
index 20874b4ef44..00000000000
--- a/source/blender/gpu/shaders/compositor/library/gpu_shader_compositor_map_value.glsl
+++ /dev/null
@@ -1,56 +0,0 @@
-/* An arbitrary value determined by Blender. */
-#define BLENDER_ZMAX 10000.0
-
-void node_composite_map_range(float value,
- float from_min,
- float from_max,
- float to_min,
- float to_max,
- const float should_clamp,
- out float result)
-{
- if (abs(from_max - from_min) < 1e-6) {
- result = 0.0;
- }
- else {
- if (value >= -BLENDER_ZMAX && value <= BLENDER_ZMAX) {
- result = (value - from_min) / (from_max - from_min);
- result = to_min + result * (to_max - to_min);
- }
- else if (value > BLENDER_ZMAX) {
- result = to_max;
- }
- else {
- result = to_min;
- }
-
- if (should_clamp != 0.0) {
- if (to_max > to_min) {
- result = clamp(result, to_min, to_max);
- }
- else {
- result = clamp(result, to_max, to_min);
- }
- }
- }
-}
-
-void node_composite_map_value(float value,
- float offset,
- float size,
- const float use_min,
- float min,
- const float use_max,
- float max,
- out float result)
-{
- result = (value + offset) * size;
-
- if (use_min != 0.0 && result < min) {
- result = min;
- }
-
- if (use_max != 0.0 && result > max) {
- result = max;
- }
-}