Noise artefacts when lacunarity is near 1 #112661

Closed
opened 2023-09-21 11:59:47 +02:00 by Charlie Jolly · 4 comments
Member

For all noises that have fractal detail and lacunarity set close to 1 this outputs a zoom type effect.

image

This is caused by the noise origin occurring in the same place.

It is possible to mitigate this by offsetting the fractal layers but fixing this would be a breaking change.

+#define FRACTAL_OFFSET 1259.0
+
 /* The fractal_noise functions are all exactly the same except for the input type. */
 float fractal_noise(
     vec3 p, float octaves, float roughness, float lacunarity, bool normalize)
@@ -78,7 +80,7 @@ float fractal_noise(
   octaves = clamp(octaves, 0.0, 15.0);
   int n = int(octaves);
   for (int i = 0; i <= n; i++) {
-    float t = snoise(fscale * p);
+    float t = snoise(fscale * p + i * FRACTAL_OFFSET);
     sum += t * amp;
     maxamp += amp;
@@ -87,7 +89,7 @@ float fractal_noise(
   }
   float rmd = octaves - floor(octaves);
   if (rmd != 0.0) {
-    float t = snoise(fscale * p);
+    float t = snoise(fscale * p + (n + 1) * FRACTAL_OFFSET);
     float sum2 = sum + t * amp;
     return normalize ? mix(0.5 * sum / maxamp + 0.5, 0.5 * sum2 / (maxamp + amp) + 0.5, rmd) :

For all noises that have fractal detail and lacunarity set close to 1 this outputs a zoom type effect. ![image](/attachments/ff4355c1-4e5b-4ad7-8193-496357390931) This is caused by the noise origin occurring in the same place. It is possible to mitigate this by offsetting the fractal layers but fixing this would be a breaking change. ```Diff +#define FRACTAL_OFFSET 1259.0 + /* The fractal_noise functions are all exactly the same except for the input type. */ float fractal_noise( vec3 p, float octaves, float roughness, float lacunarity, bool normalize) @@ -78,7 +80,7 @@ float fractal_noise( octaves = clamp(octaves, 0.0, 15.0); int n = int(octaves); for (int i = 0; i <= n; i++) { - float t = snoise(fscale * p); + float t = snoise(fscale * p + i * FRACTAL_OFFSET); sum += t * amp; maxamp += amp; @@ -87,7 +89,7 @@ float fractal_noise( } float rmd = octaves - floor(octaves); if (rmd != 0.0) { - float t = snoise(fscale * p); + float t = snoise(fscale * p + (n + 1) * FRACTAL_OFFSET); float sum2 = sum + t * amp; return normalize ? mix(0.5 * sum / maxamp + 0.5, 0.5 * sum2 / (maxamp + amp) + 0.5, rmd) : ```
588 KiB
Charlie Jolly added the
Type
Report
Severity
Normal
Status
Needs Triage
labels 2023-09-21 11:59:48 +02:00

I'm not familiar enough to say for sure that this is a bug.
Lacunarity was implemented in 0702c24a36 by @Hoshinova

@Hoshinova, could you shed some light on this?

I'm not familiar enough to say for sure that this is a bug. Lacunarity was implemented in 0702c24a36 by @Hoshinova @Hoshinova, could you shed some light on this?
Member

Right, these "artifacts" were also mentioned by some artists in https://blenderartists.org/t/thanks-to-your-help-fractal-voronoi-noise-was-added-into-blender/1448508/26?u=hoshinova
Some Textures like for example low Randomness Voronoi depend on having the same origin, so I wouldn't call it a bug.
If at all I'd add a boolean toggle to add or not add an offset. Simply changing it to always adding it would unnecessarily break backwards compatibility.

Right, these "artifacts" were also mentioned by some artists in https://blenderartists.org/t/thanks-to-your-help-fractal-voronoi-noise-was-added-into-blender/1448508/26?u=hoshinova Some Textures like for example low Randomness Voronoi depend on having the same origin, so I wouldn't call it a bug. If at all I'd add a boolean toggle to add or not add an offset. Simply changing it to always adding it would unnecessarily break backwards compatibility.
Author
Member

@Hoshinova so it's a kind of feature/bug :)

Maybe something to look at in your musgrave patch?

@Hoshinova so it's a kind of feature/bug :) Maybe something to look at in your musgrave patch?

Thanks for the info @Hoshinova, I'm closing this report then.

(It can be reopened as ToDo or Design if the team agrees).

Thanks for the info @Hoshinova, I'm closing this report then. (It can be reopened as ToDo or Design if the team agrees).
Blender Bot added
Status
Archived
and removed
Status
Needs Info from Developers
labels 2023-09-22 14:41:41 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Asset System
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#112661
No description provided.