Add Fractal Voronoi Noise V.2 #106827

Merged
Jacques Lucke merged 77 commits from Hoshinova/blender:add-fractal-voronoi into main 2023-06-13 09:18:18 +02:00

77 Commits

Author SHA1 Message Date
Hoshinova 83e4712a29 Merge branch 'main' into add-fractal-voronoi 2023-06-10 16:40:42 +02:00
Hoshinova 7e67959031 -- Move comment to it's own line in noise.cc 2023-06-10 16:38:52 +02:00
Hoshinova cc18f8a9c0 Merge branch 'main' into add-fractal-voronoi
buildbot/vexp-code-patch-coordinator Build done. Details
2023-06-02 21:38:34 +02:00
Hoshinova 89d01cb953 -- Optimize Geometry nodes Smooth F1 performance
-- Implement HIP name mangling workaround
2023-06-02 21:25:31 +02:00
Hoshinova de77dce9c0 -- Refactor various things. 2023-05-31 20:31:36 +02:00
Hoshinova cb467c5ae7 -- GLSL and OSL Change macros to function macros
buildbot/vexp-code-patch-coordinator Build done. Details
-- GLSL use single value constructors for vectors
2023-05-27 20:43:41 +02:00
Hoshinova 7e845c5c96 Merge branch 'main' into add-fractal-voronoi 2023-05-27 20:01:24 +02:00
Hoshinova 2ba85a28af BLENDER_SOURCE_CODE_COMMIT commit message number: 6 2023-05-18 21:25:50 +02:00
Hoshinova eefbe0ae67 -- Remove duplicate definitions in "intern/cycles/util/math_float2.h" 2023-05-18 21:20:33 +02:00
Hoshinova 56d88a0c8f Merge branch 'main' into add-fractal-voronoi
--Removed "_N" translation macro
2023-05-18 18:27:25 +02:00
Hoshinova bc80544c52 -- Run Clang format 2023-05-15 20:31:54 +02:00
Hoshinova 27e203f52f Merge branch 'main' into add-fractal-voronoi 2023-05-15 20:17:14 +02:00
Hoshinova 78675bcb09 -- Run Clang format 2023-05-13 22:21:49 +02:00
Hoshinova 22550df1f2 Merge branch 'main' into add-fractal-voronoi
buildbot/vexp-code-patch-coordinator Build done. Details
2023-05-13 21:48:46 +02:00
Hoshinova cbe696d71c BLENDER_SOURCE_CODE_COMMIT commit message number: 5 2023-05-13 21:46:50 +02:00
Hoshinova 32cb4350cf -- Run Clang format 2023-05-07 16:36:41 +02:00
Hoshinova 25825c0a97 Merge branch 'main' into add-fractal-voronoi
buildbot/vexp-code-patch-coordinator Build done. Details
2023-05-07 15:24:57 +02:00
Hoshinova 1a3bf887c1 -- General refactor of GLSL implementation of Fractal Voronoi noise
-- Use macros in both GLSL and OSL implementations of Fractal Voronoi noise to reduce code
2023-05-07 15:19:59 +02:00
Hoshinova 6043f30d03 BLENDER_SOURCE_CODE_COMMIT commit message number: 4 2023-05-07 14:57:10 +02:00
Hoshinova 2d934f423f Refactor F1, Smooth F1 normalization
Rework F2, Distance to Edge normalization
2023-05-04 21:39:18 +02:00
Hoshinova 2a0b9c8633 -- Change Distance to Edge normalization logic 2023-05-01 19:19:35 +02:00
Hoshinova 3a059ab355 -- General refactor for OSL Fractal Voronoi noise
-- Fix Geo nodes voronoi_distance() functions
2023-05-01 18:16:45 +02:00
Hoshinova 537f6941cf BLENDER_SOURCE_CODE_COMMIT commit message number: 3 2023-05-01 17:50:17 +02:00
Hoshinova d22bb0e1c0 Refactor: General refactor for Geometry nodes Fractal Voronoi noise 2023-04-30 21:00:45 +02:00
Hoshinova 3888623026 BLENDER_SOURCE_CODE_COMMIT commit message number: 2 2023-04-28 21:38:30 +02:00
Hoshinova ac2a66b499 Merge branch 'main' into add-fractal-voronoi 2023-04-26 18:39:16 +02:00
Hoshinova f9d2cf3ad6 Refactor: further changes to SVM implementation
* Put normalization into it's own function to match GLSL implementation.
* Remove "octave_scale" variable.
* Remove "voronoi_" prefixes.
2023-04-26 18:37:02 +02:00
Brecht Van Lommel 7df52ac2d9 Refactor: further changes to SVM implementation
* More functional style definition to clarify what gets mutated where. Make
  VoronoiParams const, pass coordinate as own argument and return output by
  value.
* Don't use template class, subclassing and methods. Easier to use same logic
  in OSL and GLSL then. Slightly more overhead for always having fractal
  position accumulated in 4D, but should be ok.
* Don't use VoronoiOutput for distance and radius.
* Various other naming and organization tweaks.
2023-04-24 18:31:53 +02:00
Hoshinova c5f25a05b1 BLENDER_SOURCE_CODE_COMMIT commit message number: 1 2023-04-23 18:21:27 +02:00
Hoshinova a50c8ccf0a BLENDER_SOURCE_CODE_COMMIT commit message number: 6 2023-04-23 18:12:10 +02:00
Hoshinova 9b95d7a482 BLENDER_SOURCE_CODE_COMMIT commit message number: 5 2023-04-23 18:09:25 +02:00
Hoshinova affa7a0a15 Merge remote-tracking branch 'me/add-fractal-voronoi' into add-fractal-voronoi 2023-04-22 21:12:40 +02:00
Hoshinova fbc0c03bf7 Fully optimize voronoi.h implementation with helper structs VoronoiParams and VoronoiOutput 2023-04-22 21:05:42 +02:00
Hoshinova 966e44d892 AUTO_GIT_COMMIT commit message number: 5 2023-04-21 21:48:40 +02:00
Hoshinova 9bbe51266d AUTO_GIT_COMMIT commit message number: 4 2023-04-21 20:52:51 +02:00
Hoshinova 58612bd61a AUTO_GIT_COMMIT commit message number: 3 2023-04-21 20:26:14 +02:00
Hoshinova 061a38412f AUTO_GIT_COMMIT commit message number: 2 2023-04-20 21:15:09 +02:00
Hoshinova 22b1563883 Default Copy Constructors 2023-04-15 18:46:08 +02:00
Hoshinova 163bafffcb Add Voronoi Variable Exchange Classes.
Todo: Normalize functions.
2023-04-15 18:07:21 +02:00
Hoshinova 9c33d380ed Merge branch 'main' into add-fractal-voronoi 2023-04-12 17:13:39 +02:00
Hoshinova d7a7bd0024 Merge branch 'main' into add-fractal-voronoi
buildbot/vexp-code-patch-coordinator Build done. Details
2023-04-11 20:16:09 +02:00
Hoshinova 4bf1eddc83 Merge branch 'main' into add-fractal-voronoi 2023-04-11 17:57:28 +02:00
Hoshinova 4b11361f56 AUTO_GIT_COMMIT commit message number: 1 2023-03-17 17:04:51 +01:00
Hoshinova b42abaa077 AUTO_GIT_COMMIT commit message number: 1 2023-03-17 17:04:38 +01:00
Hoshinova d8c7ba4cc2 AUTO_GIT_COMMIT commit message number: 1 2023-03-17 16:32:58 +01:00
Hoshinova 570a19703c Merge branch 'main' into add-fractal-voronoi 2023-03-16 13:57:13 +01:00
Hoshinova 3be9ce5ddd Optimize Out All Instances of Variable "max_distance" 2023-03-03 19:42:45 +01:00
Hoshinova 32a880c9d0 Fully implement improved Fractal Voronoi noise 2023-03-02 20:43:21 +01:00
Hoshinova a1bf08b146 Implement improved Fractal Voronoi noise to EEVEE 2023-03-02 18:08:25 +01:00
Hoshinova 849a80e2f8 Implement improved Fractal Voronoi noise to Geometry nodes 2023-03-02 16:26:22 +01:00
Hoshinova d6761c4479 Implement improved Fractal Voronoi noise to \intern\cycles\kernel\svm\voronoi.h
Add "ccl_device_inline" before lerp() function in \intern\cycles\util\math.h
2023-03-02 14:42:25 +01:00
Hoshinova e70f46d4dd Merge branch 'main' into add-fractal-voronoi 2023-03-01 12:41:03 +01:00
Hoshinova ebdb9b917c Use Blender's "ceilf()" instead of "std::celif()" 2023-01-28 21:33:41 +01:00
Hoshinova 628660da4d Merge branch 'master' 2023-01-26 22:16:30 +01:00
Hoshinova 7461c3bc9d Add descriptions to "Detail", "Roughness" and "Lacunarity" inputs. 2023-01-22 21:31:10 +01:00
Hoshinova d52b229723 Fully implement Fractal Voronoi noise in EEVEE and OSL. 2023-01-19 22:45:52 +01:00
Hoshinova 326fb1c28e Intermediate state. 2023-01-19 20:31:39 +01:00
Hoshinova 4c4b600859 OSL Voronoi Smooth F1 Smoothness parameter broke. 2023-01-18 21:48:32 +01:00
Hoshinova 1f2e144946 Add new OSL header files "node_fractal_voronoi.h" and "node_voronoi.h". 2023-01-18 20:00:47 +01:00
Hoshinova eea6d000b5 Intermediate state 2023-01-15 18:59:00 +01:00
Hoshinova bd5a70d9b7 Fix GPU dependencies. 2023-01-14 22:32:35 +01:00
Hoshinova bcde2387b2 Add files "gpu_shader_material_voronoi.glsl" and "gpu_shader_material_fractal_voronoi.glsl". 2023-01-08 20:37:02 +01:00
Hoshinova 4a3a9f4687 Merge branch 'master' into add-fractal-voronoi 2023-01-08 15:57:49 +01:00
Hoshinova f39d06d374 First attempt at fixing memory leak. 2023-01-07 20:11:36 +01:00
Hoshinova 88842cb70d Use Blender's implementation of floorf instead of std::floorf 2022-12-23 14:11:48 +01:00
Hoshinova a168412819 Merge class VoronoiMinowskiFunction into class VoronoiMetricFunction in node_shader_tex_voronoi.cc. 2022-12-22 21:20:13 +01:00
Hoshinova 8f1b1e1fe9 Reduce Voronoi function calls. Improve Normalize behavior. 2022-12-18 21:08:59 +01:00
Hoshinova a8f6dae8df Intermediate State
.# Please enter the commit message for your changes. Lines starting
2022-12-18 16:31:54 +01:00
Hoshinova f59e1572d2 Put template Fractal Voronoi Noise functions from BLI_noise.h into noise.cc. 2022-12-18 16:31:54 +01:00
Hoshinova 54a5c9ad4d Add explicit address space qualifier "ccl_private" to pointers of template function parameters in voronoi.h. 2022-12-18 16:31:54 +01:00
Hoshinova 7c54499c54 Fix dereference potential nullptr r_distance. 2022-12-18 16:31:54 +01:00
Hoshinova 12a269d34f Use template functions to reduce the amount of lines of code. 2022-12-18 16:31:54 +01:00
Hoshinova 9b0ec80334 Nodes & Physics
Implement Fractal Voronoi Noise to Voronoi Texture Node.

---

For F1, Smooth F1, F2 Feature output:
The concept behind Fractal Voronoi Noise is the same as the one behind Fractal Perlin Noise.
Multiple Layers of Voronoi Noise are computed and the Distance outputs of each layer added together to create the final Distance output.

The amount of layers is being controlled by the "Detail" input.
If the "Detail" input has a non-integer value two instances of Fractal Voronoi will be computed
with each having the greatest whole integer smaller than the "Detail" input value
and the smallest whole integer greater than the "Detail" input value as the amount of layers respectively.
The fractional part of "Detail" will the be used as a factor to lerp between the two instances.

The Distance output of each layer is being multiplied by the "Roughness" input to the power of the zero based number of the current layer.
This means that for example if the "Roughness" input is 2.0 the the Distance output of the first layer is being multiplied by 2.0 ^ 0 = 1.0
for the second layer it being multiplied by 2.0 ^ 1 = 2.0 for the third layer it is being multiplied by 2.0 ^ 2 = 4.0 and so on.

The Scale input of each layer is being multiplied by the "Lacunarity" input to the power of the zero based number of the current layer.
This means that for example if the "Lacunarity" input is 2.0 the Scale input of the first layer is being multiplied by 2.0 ^ 0 = 1.0
for the second layer it is being multiplied by 2.0 ^ 1 = 2.0 for the third layer it is being multiplied by 2.0 ^ 2 = 4.0 and so on.

Additionally a "Normalize" boolean input is added which if checked will remap the entire Distance output to a 0.0 to 1.0 range.

The Color and Position outputs simply give out the Color and Position outputs of the highest Voronoi Layer being computed.

---

For Distance to Edge Feature output:
Multiple Layers of Voronoi Distance to Edge Textures are computed.
The resulting Distance output is the minimum of the Distance output of all layers.

The amount of layers is being controlled by the "Detail" input.
If the "Detail" input has a non-integer value the smallest whole integer greater than the "Detail" input value will be the amount of layers

The Scale input of each layer is being multiplied by the "Lacunarity" input to the power of the zero based number of the current layer.
This means that for example if the "Lacunarity" input is 2.0 the Scale input of the first layer is being multiplied by 2.0 ^ 0 = 1.0
for the second layer it is being multiplied by 2.0 ^ 1 = 2.0 for the third layer it is being multiplied by 2.0 ^ 2 = 4.0 and so on.

Additionally a "Normalize" boolean input is added which if checked will remap the entire Distance output to a 0.0 to 1.0 range.

---

The N-Sphere Radius Feature output is left unmodified.
2022-12-18 16:31:54 +01:00
Hoshinova f370d29622 Implement F2 and Smooth F1 Fractal Voronoi Noise in Cycles, OSL, EEVEE and Geometry Nodes.
Fix Normalize not normalizing correctly with metrics other than Euclidean.
2022-12-18 16:31:54 +01:00
Hoshinova 236b1ffeab Implement F1 Fractal Voronoi Noise in Cycles, OSL, EEVEE and Geometry Nodes. 2022-12-18 16:31:54 +01:00
Hoshinova 61f0d9bfd7 Fully implement new inputs to Cycles, OSL, EEVEE and Geometry Nodes. 2022-12-18 16:31:53 +01:00
Hoshinova e054ff7bdb First commit on branch "add-fractal-voronoi"
Add boolean input "Normalize"
Add float input "Detail"
Add float input "Roughness"
Add float input "Lacunarity"
2022-12-18 16:31:53 +01:00