Noise nodes in geometry nodes #91156

Closed
opened 2021-09-03 12:01:42 +02:00 by Jacques Lucke · 19 comments
Member

For Blender 3.0 we intend to support at least one or two noise texture nodes in geometry nodes (probably Noise and Voronoi). There are a few user oriented and technical decisions we have to make.

UI

For geometry nodes we would probably want to have a vector output next to "Fac(tor)" and "Color". Contrary to the existing outputs, this output should probably be approximately in the [-1, 1] range instead of [0, 1]. Should this also be added to shader nodes?

Technical

We already have some noise functions in BLI_noise.h. However, those are not enough to fully implement the noise nodes.
Currently, the same noise functions are implemented in three places:

  • Cycles C++ (e.g. svm_noise.h).
  • Cycles OSL (e.g. node_noise_texture.osl).
  • Eevee GLSL (e.g. gpu_shader_material_tex_noise.glsl).

Unfortunately, none of these implementations can be used by Blender itself. The Cycles c++ implementation comes the closest, but given how tightly integrated it is with Cycles, it seems unlikely that we can use this.

Currently, the best option I can see is to add a new implementation of all the noise functions in blenlib. Maybe there is an option I'm not aware of.

For Blender 3.0 we intend to support at least one or two noise texture nodes in geometry nodes (probably Noise and Voronoi). There are a few user oriented and technical decisions we have to make. **UI** For geometry nodes we would probably want to have a vector output next to "Fac(tor)" and "Color". Contrary to the existing outputs, this output should probably be approximately in the [-1, 1] range instead of [0, 1]. Should this also be added to shader nodes? **Technical** We already have some noise functions in `BLI_noise.h`. However, those are not enough to fully implement the noise nodes. Currently, the same noise functions are implemented in three places: * Cycles C++ (e.g. `svm_noise.h`). * Cycles OSL (e.g. `node_noise_texture.osl`). * Eevee GLSL (e.g. `gpu_shader_material_tex_noise.glsl`). Unfortunately, none of these implementations can be used by Blender itself. The Cycles c++ implementation comes the closest, but given how tightly integrated it is with Cycles, it seems unlikely that we can use this. Currently, the best option I can see is to add a new implementation of all the noise functions in blenlib. Maybe there is an option I'm not aware of.
Author
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Author
Member

Added subscriber: @brecht

Added subscriber: @brecht

Added subscriber: @GeorgiaPacific

Added subscriber: @GeorgiaPacific

Added subscriber: @GottfriedHofmann

Added subscriber: @GottfriedHofmann

I think adding another implementation is the right solution, there's no good way to share the code unfortunately. This should eventually replace the current Blender texture nodes also, so it will allow removing that code eventually.

Adding a vector output to the current nodes seems fine to me, but maybe do that as a second step once you have the initial compatible implementation with color and factor?

Two points about that:

  • I thinking outputting a unit vector is probably most useful, but randomly generating those based on procedural noise is more complicated than just normalizing 3 numbers, since you don't get a uniform distribution that way. I'm not immediately sure what the best way to do it is.
  • Adding an equivalent to the Displacement and Vector Displacement nodes could be done also, and covers many of the same use cases.
I think adding another implementation is the right solution, there's no good way to share the code unfortunately. This should eventually replace the current Blender texture nodes also, so it will allow removing that code eventually. Adding a vector output to the current nodes seems fine to me, but maybe do that as a second step once you have the initial compatible implementation with color and factor? Two points about that: * I thinking outputting a unit vector is probably most useful, but randomly generating those based on procedural noise is more complicated than just normalizing 3 numbers, since you don't get a uniform distribution that way. I'm not immediately sure what the best way to do it is. * Adding an equivalent to the Displacement and Vector Displacement nodes could be done also, and covers many of the same use cases.

Added subscriber: @Florian-10

Added subscriber: @Florian-10

When the Noise gets a refactor. Maybe there is a way to make it better? I have currently no idea what could be better (Performance?). But if you touch it anyway? I mean it is an oppurtunity.

When the Noise gets a refactor. Maybe there is a way to make it better? I have currently no idea what could be better (Performance?). But if you touch it anyway? I mean it is an oppurtunity.
Author
Member

Adding a vector output to the current nodes seems fine to me, but maybe do that as a second step once you have the initial compatible implementation with color and factor?

Doing that as a separate step is fine with me.

I thinking outputting a unit vector is probably most useful, but randomly generating those based on procedural noise is more complicated than just normalizing 3 numbers, since you don't get a uniform distribution that way. I'm not immediately sure what the best way to do it is.

I'm also not sure what's a good way to generated these unit vectors. Need to do some research.

Adding an equivalent to the Displacement and Vector Displacement nodes could be done also, and covers many of the same use cases.

I still have to check what those are doing exactly, but sounds reasonable.

When the Noise gets a refactor. Maybe there is a way to make it better? I have currently no idea what could be better (Performance?). But if you touch it anyway? I mean it is an oppurtunity.

We are not touching the existing code yet. Instead we want to make a compatible version available in geometry nodes. So the other noise implementations won't change. Also, given time constraints, we probably won't have highly optimized noise code in geometry nodes for 3.0, but we'll see. That's something that can be optimized in isolation relatively easily later on.

> Adding a vector output to the current nodes seems fine to me, but maybe do that as a second step once you have the initial compatible implementation with color and factor? Doing that as a separate step is fine with me. > I thinking outputting a unit vector is probably most useful, but randomly generating those based on procedural noise is more complicated than just normalizing 3 numbers, since you don't get a uniform distribution that way. I'm not immediately sure what the best way to do it is. I'm also not sure what's a good way to generated these unit vectors. Need to do some research. > Adding an equivalent to the Displacement and Vector Displacement nodes could be done also, and covers many of the same use cases. I still have to check what those are doing exactly, but sounds reasonable. > When the Noise gets a refactor. Maybe there is a way to make it better? I have currently no idea what could be better (Performance?). But if you touch it anyway? I mean it is an oppurtunity. We are not touching the existing code yet. Instead we want to make a compatible version available in geometry nodes. So the other noise implementations won't change. Also, given time constraints, we probably won't have highly optimized noise code in geometry nodes for 3.0, but we'll see. That's something that can be optimized in isolation relatively easily later on.

In #91156#1216873, @Florian-10 wrote:
When the Noise gets a refactor. Maybe there is a way to make it better? I have currently no idea what could be better (Performance?). But if you touch it anyway? I mean it is an oppurtunity.

Let's not get side tracked with this kind of thing, the same opportunity is always there.

> In #91156#1216873, @Florian-10 wrote: > When the Noise gets a refactor. Maybe there is a way to make it better? I have currently no idea what could be better (Performance?). But if you touch it anyway? I mean it is an oppurtunity. Let's not get side tracked with this kind of thing, the same opportunity is always there.

Added subscriber: @myway880

Added subscriber: @myway880

Just in case, this is useful (https://github.com/Auburn/FastNoise2/). It's MIT licensed.

Just in case, this is useful (https://github.com/Auburn/FastNoise2/). It's MIT licensed.
Contributor

Added subscriber: @Eary

Added subscriber: @Eary
Contributor

Is it going to have the same result as the material noise node with the same settings and the same mapping? Because the prototype noise produces different result from the material node even with same settings and mapping, not sure whether the official one will tackle this so I am asking.

Is it going to have the same result as the material noise node with the same settings and the same mapping? Because the prototype noise produces different result from the material node even with same settings and mapping, not sure whether the official one will tackle this so I am asking.
Author
Member

The computed noise should be that same as in cycles and eevee.
The noise node in the prototype used a different implementation which was not compatible with cycles, that's why this task exists.

The computed noise should be that same as in cycles and eevee. The noise node in the prototype used a different implementation which was not compatible with cycles, that's why this task exists.
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Added subscriber: @CharlieJolly

Added subscriber: @CharlieJolly
Member

In #91156#1216803, @brecht wrote:
Two points about that:

  • I thinking outputting a unit vector is probably most useful, but randomly generating those based on procedural noise is more complicated than just normalizing 3 numbers, since you don't get a uniform distribution that way. I'm not immediately sure what the best way to do it is.

In #91156#1216877, @JacquesLucke wrote:
I'm also not sure what's a good way to generated these unit vectors. Need to do some research.

As an aside, the uniform distribution was tackled in this patch, needs updating when fields is merged D10883: Geometry Nodes: Attribute Randomize Spherical Node.

> In #91156#1216803, @brecht wrote: > Two points about that: > * I thinking outputting a unit vector is probably most useful, but randomly generating those based on procedural noise is more complicated than just normalizing 3 numbers, since you don't get a uniform distribution that way. I'm not immediately sure what the best way to do it is. > In #91156#1216877, @JacquesLucke wrote: > I'm also not sure what's a good way to generated these unit vectors. Need to do some research. As an aside, the uniform distribution was tackled in this patch, needs updating when fields is merged [D10883: Geometry Nodes: Attribute Randomize Spherical Node](https://archive.blender.org/developer/D10883).

In #91156#1217613, @CharlieJolly wrote:
As an aside, the uniform distribution was tackled in this patch, needs updating when fields is merged D10883: Geometry Nodes: Attribute Randomize Spherical Node.

For random numbers a uniform mapping like that works. But for procedural texture patterns you would get distortion and/or discontinuities.

> In #91156#1217613, @CharlieJolly wrote: > As an aside, the uniform distribution was tackled in this patch, needs updating when fields is merged [D10883: Geometry Nodes: Attribute Randomize Spherical Node](https://archive.blender.org/developer/D10883). For random numbers a uniform mapping like that works. But for procedural texture patterns you would get distortion and/or discontinuities.
Author
Member

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Jacques Lucke self-assigned this 2021-09-17 15:50:38 +02:00
Sign in to join this conversation.
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
9 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#91156
No description provided.