Expand Voronoi node functionality in Cycles #45797

Closed
opened 2015-08-14 13:36:47 +02:00 by Michel Anders · 10 comments
Member

This minor functional patch expands the functionality of the Voronoi textture input node in Cycles on two fronts:

  • it adds a second output socket "F2" which provides the distance to the second nearest neighbour
  • it adds a drop down selection to the node with a choice of distance metrics.

Addition of the F2 node makes it possible for texture designers to obtain the F2 - F1 (aka Voronoi crackle) pattern by chaining it to a subtract node. The distance metrics added allow for a greater variety of patterns. I have implemented the Manhattan, Chebychev and Distance metrics (besides the default Distance squared)

Care has been taken to keep the node fully backward compatible with the existing Voronoi node: the default distance metric is "Distance Squared" an the old 'Fac' output socket is retained although it might have been slightly more logical to rename it to F1 but this would break existing noodles.

It is a deliberate choice to add an F2 socket and not a F2F1 socket as this opens up more possibilities for the end user (and reduces the computational overhead by a single subtract although adding a subtract node in a noodle might actually be more expensive). Also I have left out the Minkowsky metrics as there are less commonly used and would clutter the node interface with a bunch of extra parameters. We could always introduce that later if there would be a huge demand for it.

As indicated in the comments in svm_voronoi.h, there is some room for performance improvement in the code, both in the SSE2 branch and in the non SSE2 branch but this would further complicate the code for a small and uncertain gain.

The code is tested both on a GPU (a GTX970 but I actually used sm50 not sm52) and a CPU (intel core 7) both on existing textures with a voronoi node as well as with nodes with new functionality, but only on Ubuntu (15.04)

                                                      - diff -------------------------

voronoi.diff

This minor functional patch expands the functionality of the Voronoi textture input node in Cycles on two fronts: - it adds a second output socket "F2" which provides the distance to the second nearest neighbour - it adds a drop down selection to the node with a choice of distance metrics. Addition of the F2 node makes it possible for texture designers to obtain the F2 - F1 (aka Voronoi crackle) pattern by chaining it to a subtract node. The distance metrics added allow for a greater variety of patterns. I have implemented the Manhattan, Chebychev and Distance metrics (besides the default Distance squared) Care has been taken to keep the node fully backward compatible with the existing Voronoi node: the default distance metric is "Distance Squared" an the old 'Fac' output socket is retained although it might have been slightly more logical to rename it to F1 but this would break existing noodles. It is a deliberate choice to add an F2 socket and not a F2F1 socket as this opens up more possibilities for the end user (and reduces the computational overhead by a single subtract although adding a subtract node in a noodle might actually be more expensive). Also I have left out the Minkowsky metrics as there are less commonly used and would clutter the node interface with a bunch of extra parameters. We could always introduce that later if there would be a huge demand for it. As indicated in the comments in svm_voronoi.h, there is some room for performance improvement in the code, both in the SSE2 branch and in the non SSE2 branch but this would further complicate the code for a small and uncertain gain. The code is tested both on a GPU (a GTX970 but I actually used sm50 not sm52) and a CPU (intel core 7) both on existing textures with a voronoi node as well as with nodes with new functionality, but only on Ubuntu (15.04) - diff ------------------------- [voronoi.diff](https://archive.blender.org/developer/F224323/voronoi.diff)
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @MichelAnders

Added subscriber: @MichelAnders
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

@MichelAnders, thanks for the patch. Could you upload it to our differential review tool?

@MichelAnders, thanks for the patch. Could you upload it to our [differential ](https://developer.blender.org/differential/) review tool?
Author
Member

Added subscriber: @julian-8

Added subscriber: @julian-8
Author
Member

@julian-8 Eisel: sure, it's on https://developer.blender.org/differential/diff/4860/

I referenced this task in the comments but did nt assign reviewers (I am not sure I am supposed to do that anyway, so I hope someone is interested :-)

@julian-8 Eisel: sure, it's on https://developer.blender.org/differential/diff/4860/ I referenced this task in the comments but did nt assign reviewers (I am not sure I am supposed to do that anyway, so I hope someone is interested :-)
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Julian Eisel self-assigned this 2015-08-14 20:22:35 +02:00
Member

Thanks, added reviewers. It doesn't seem like we need a diff and a patch task for this, so closing task.

Thanks, added reviewers. It doesn't seem like we need a diff and a patch task for this, so closing task.

Added subscriber: @BartekMoniewski

Added subscriber: @BartekMoniewski
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
4 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#45797
No description provided.