Page MenuHome

BROKEN [WIP]: Minimal Viable Product: Proposed Voronoi Texture enhancements
Needs ReviewPublic

Authored by Loren Osborn (linux_dr) on Mar 27 2019, 8:20 PM.


Group Reviewers

This is my first baby-step contributing to Blender. I have several enhancements I'd like to make to the Voronoi texture, and this is simply a proof-of-concept/ first step:

"Fac" is a linear value, but it really represents the magnitude of an "Offset" vector. My first task (as I tried to do in this patch) is to expose the offset vector, in addition to the scalar "Fac".

The Offset output I created currently is just returning (0,0,0) instead of the intended offset. I'm sure I made a newbie mistake, but I just don't see it. Can you help me figure out while the value of Offset isn't populating?

I will attach a sample .blend file to the post that links to this diff.

Thank you,


Diff Detail

rB Blender
osbornl_exposeVoronoiVectors_CLEAN (branched from master)
Build Status
Buildable 3284
Build 3284: arc lint + arc unit

Event Timeline

patch doesn't apply cleanly, a few errors i can fix, but this many is pushing it, try resubmitting your patch with arcanist using arc diff --update D4602

  • Added Voronoi vector output [builds but untested]
  • BROKEN: renamed new broken Voronoi output to Offset

bzztploink reported that the diff I posted was broken. Does this fix it?

Applies cleanly now, thanks!

Not sure if this is all of them, but at-least these are the ones i remember fixing.

OpenGL(eeve+viewport)NoTypos in your shadersRun the blender_debug_gpu.cmd batchfile in your blender folder, it will log all errors to a text file.
Cycles SVMYes?Only did a quick test, seemed okNA
Cycles OSLNoParameter name mismatchWindow->Toggle console would have told you about it, blender_debug.cmd would have worked as well

outVector needs to be Offset




exponent needs to be e


e needs to be exponent


outVector doesn't exist, probably pOut?


Looks like there's a little algorithmic corruption that happened here. It's not a simple variable rename. Let me untangle it.

@Clément Foucault (fclem), I see that you touched this code recently. I would value any advice you have to offer.



@Clément Foucault (fclem), this is one particular piece of code I wanted to ask you about. I know you just changed this to use a vec4 and swizzlers. If this is a real efficiency gain, that’s great, we should use that. (I can’t even run this on my hardware to test it now). If the performance difference isn’t noticeable, I think my changes here may be more readable. What do you think?

Working proof of concept before any significant changes:

  • Added Voronoi vector output [builds but untested]
  • BROKEN: renamed new broken Voronoi output to Offset
  • Fixed the issues identified by bzztploink