Add Lacunarity and Normalize Inputs to the Noise Texture Node #110839
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
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, Assets & 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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110839
Loading…
Reference in New Issue
No description provided.
Delete Branch "Hoshinova/blender:add-noise-inputs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds the Lacunarity and Normalize inputs from the Voronoi Texture node to the Noise Texture node.
The Lacunarity input controls by which factor each successive Perlin noise octave is scaled. Currently it is hard coded to a value of
2.0
. This input makes it changeable to the user.The Noise node normalizes it's output by default. The Normalize input makes it possible for the user to turn it off.
To keep the behavior consistent with past versions it is on by default.
I've only added the inputs for now but knowing how long the review process takes, I created the PR so design questions can already be discussed.
Code wise the
fractal_voronoi_x_fx
function from46a17df415/intern/cycles/kernel/svm/voronoi.h (L883)
has exactly the same fractalization logic as the one used for the Noise Texture node with the additional inputs already added, so I plan to replace the corresponding Noise Texture functions with a modified version of that.What is a practical example for turning off normalization? That doesn't seem very useful to me.
Also adding Lacunarity kind of turns the noise texture into a Musgrave texture doesn't it?
Pretty mich all cases where the height of the Fractal Perlin noise actually matters, like with procedural terrain generation.
Surprisingly no. The Dimension input of the Musgrave Texture does a very weird thing, where it acts like the Roughness inputs but is the value is taken as Roughness = Lacunarity^(-Dimension)
d870f9e841/intern/cycles/kernel/svm/musgrave.h (L202)
, which is completely unintuitive to even the most technical users, which is probably why I see many artists shy away from it.So while the Musgrave Texture has a Lacunarity input it effectively has no usable Roughness input.
But you're bringing up an interesting point. I've always wondered why Blender has 2 Perlin noise nodes, neither of which being called Perlin noise, but both of which having features the other one doesn't.
Ideally my plan is to merge the Musgrave Texture node and the Noise Texture node into a single Perlin noise node, but implementation wise that still has many open questions regarding backwards compatibility.
Which is why for now I decided to at least make the Noise Texture have it's full set of features.
Also code wise I noticed, that there is actually no need to replace any functions. Simple replacing 2.0 with lacunarity already does the trick. And for the normalization an if statement around the corresponding code should also be enough.
So I don't see any downsides to this, neither user experience nor code wise.
Since work to bring features from Musgrave texture to the noise texture was approved before in D7065, I see no reason to block the addition of Lacunarity.
I still don't see how normalization could be useful, Perlin noise intrinsically has no reasonable maximum, so leaving it to its own maximum brings us what value? Can you demonstrate a visual practical example?
A while ago I posted this picture in the Pull Request for Fractal Voronoi noise:
Both the water and the fire were created using a combination of Voronoi Texture node and Noise Texture node.
The fire and the water were created using two separate node trees and as you can see they are aligned such that the fire sits perfectly on top of the water.
The fact that the Noise Texture node normalizes the Fractal Perlin noise makes that alignment much more difficult, because it introduces an offset to the midlevel of the noise which scales along as you scale the noise output.
To combat this issue I had to manually un-normalize the output for every node, which gets tedious if the node setup is complex like in this case.
Alternatively I could've used the Musgrave Texture node which unlike the Noise Texture node doesn't normalize it's output, but found the Dimension input to be hard to work with, just as Hoshinova described.
Apart from that the Noise Texture node normalization tends to overcompensate for higher Roughness values making the entire output just 0.5ish.
@OmarEmaraDev So there you have it.
Thanks again @Raiko for your explanation!
Add Lacunarity and Normalize Inputs to the Noise Texture Nodeto WIP: Add Lacunarity and Normalize Inputs to the Noise Texture Node@blender-bot package
Package build started. Download here when ready.
The functionality and Cycles implementation look fine to me.
I guess the Eevee implementation is still missing since it does not use the parameters.
As you may have noticed I changed the way normalization is done.
In the old code the octaves are first normalized individually then added together then normalized again.
In the new code both steps are combined into one normalization step after the fractalization process.
This makes the new code slightly faster as it saves a few additions and multiplications but more importantly it separates the normalization step from the fractalization process, making it possible to easily turn on or off.
To dispel any possible doubts about whether or not the new code always computes the same output as the old code and for future reference here is a quick proof:
The way the old code computes the output can be explicitly written as:
where
maxamp = \sum_{i=0}^{detail}(roughness^i)
The way the new code computes the output can be explicitly written as:
The old and new code always compute the same output iff the expression on the right side of both equations are equivalent.
Thus:
This concludes the proof.
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
Here's a test file to show that the new behavior is same for all shader node implementations:
Noise_Test_File.blend
The output of the new Noise Texture node should be identical with the old one when
Normalize
is turned on andLacunarity
is set to 2.0.The code looks fine to me too, but it's breaking a bunch of tests currently. That should be fixed.
I haven't looked at it in detail yet, but the reason might just be missing versioning code for the normalize property.
@ -1216,3 +1216,3 @@
NodeTexBase base;
int dimensions;
char _pad[4];
int normalize;
Use
uint8_t
fornormalize
and keep a padding of 3 bytes.@blender-bot package
Package build started. Download here when ready.
Charlie Jolly referenced this pull request2023-08-10 21:50:19 +02:00
LGTM.
Ah, you still have to increase
BLENDER_FILE_SUBVERSION
in this patch.@blender-bot build
WIP: Add Lacunarity and Normalize Inputs to the Noise Texture Nodeto Add Lacunarity and Normalize Inputs to the Noise Texture Node@blender-bot build
If you don't want us to merge a specific patch, add the
WIP:
prefix to the commit title. Besides that, I don't know what you expect us to do when we want to merge it?@ -5157,0 +5157,4 @@
prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "normalize", 0);
RNA_def_property_ui_text(prop, "Normalize", "Normalize output Distance to 0.0 to 1.0 range");
Misplaced mentioned of Distance.
@ -31,0 +32,4 @@
.min(0.0f)
.max(1000.0f)
.default_value(2.0f)
.description("The scale of a Voronoi layer relative to that of the previous layer");
Misplaced mention of Voronoi. Also maybe use Octave instead of Layer.