diff --git a/devel/analysis/analysis.tox b/devel/analysis/analysis.tox
index 1dd9001e6..0fffaffc7 100644
Binary files a/devel/analysis/analysis.tox and b/devel/analysis/analysis.tox differ
diff --git a/devel/build/buildExt.py b/devel/build/buildExt.py
index 127ec2900..e428ec731 100644
--- a/devel/build/buildExt.py
+++ b/devel/build/buildExt.py
@@ -186,7 +186,10 @@ def finalizeRootPars(self, comp: 'COMP'):
comp.par.externaltox = ''
comp.par.enablecloning = False
comp.par.savebackup = True
- comp.par.reloadtoxonstart = True
+ if comp.par['reloadtoxonstart'] is not None:
+ comp.par.reloadtoxonstart = True
+ else:
+ comp.par.enableexternaltox = True
comp.par.reloadcustom = True
comp.par.reloadbuiltin = True
focusFirstCustomParameterPage(comp)
diff --git a/devel/components/misc/misc.tox b/devel/components/misc/misc.tox
index 11ad1924a..ff8a765b1 100644
Binary files a/devel/components/misc/misc.tox and b/devel/components/misc/misc.tox differ
diff --git a/devel/devel.tox b/devel/devel.tox
index 521ef3b32..807c7c21f 100644
Binary files a/devel/devel.tox and b/devel/devel.tox differ
diff --git a/devel/dirtyMonitor/dirtyMonitor.tox b/devel/dirtyMonitor/dirtyMonitor.tox
new file mode 100644
index 000000000..42cd1713c
Binary files /dev/null and b/devel/dirtyMonitor/dirtyMonitor.tox differ
diff --git a/devel/dirtyMonitor/opFindCallbacks.py b/devel/dirtyMonitor/opFindCallbacks.py
new file mode 100644
index 000000000..888004c64
--- /dev/null
+++ b/devel/dirtyMonitor/opFindCallbacks.py
@@ -0,0 +1,49 @@
+# me - this DAT
+# dat - the DAT that is querying
+# curOp - the OP being queried
+# row - the table row index
+
+# Uncomment following two functions to add custom columns
+
+def onInitGetColumnNames(dat):
+ return [
+ 'tox',
+ 'dirty'
+ ]
+
+def onFindOPGetValues(dat, curOp, row):
+ return [
+ curOp.par['externaltox'],
+ curOp.dirty,
+ ]
+
+
+# Return True / False to include / exclude an operator in the table
+
+def onFindOPGetInclude(dat, curOp, row):
+ return bool(curOp.par['externaltox']) and not curOp.par['clone']
+
+
+# Provide an extensive dictionary of what was matched for each operator.
+# Multiple matching tags, parameters and cells will be included.
+# For each match, a corresponding key is included in the dictionary:
+#
+# results:
+#
+# 'name': curOp.name
+# 'type': curOp.OPType
+# 'path': curOp.path
+# 'parent' : curOp.parent()
+# 'comment': curOp.comment
+# 'tags' : [list of strings] or empty list
+# 'text' : [list of Cells] or empty list
+# 'par': dictionary of matching parameter attributes.
+# example entries:
+# tx : { 'name': True, 'value':True , 'expression':True } # Parameter tx matched on name, value, expression
+# ty : { 'value' : True } # Parameter ty matched on value
+#
+
+def onOPFound(dat, curOp, row, results):
+ return
+
+
\ No newline at end of file
diff --git a/devel/splashScreen/splashScreen.tox b/devel/splashScreen/splashScreen.tox
index aa705e9a1..301a1cfbc 100644
Binary files a/devel/splashScreen/splashScreen.tox and b/devel/splashScreen/splashScreen.tox differ
diff --git a/devel/tester/tester.py b/devel/tester/tester.py
index bdc40fb5d..8666b032a 100644
--- a/devel/tester/tester.py
+++ b/devel/tester/tester.py
@@ -220,19 +220,22 @@ def cancelTestRun(self):
self.log('Canceling test run...')
ipar.uiState.Running = False
- def runQueuedTests(self):
+ def runQueuedTests(self, continueAfter=True):
queue = self._testQueue
if queue.numRows < 1:
raise Exception('No tests queued!')
self.clearResults()
self.log(f'Running {queue.numRows} queued tests...')
ipar.uiState.Running = True
- self._runNextTest(continueAfter=True)
+ self._runNextTest(continueAfter=continueAfter)
def runAllTests(self):
self.reloadTestQueue()
self.runQueuedTests()
+ def runFirstQueuedTest(self):
+ self.runQueuedTests(continueAfter=False)
+
def _runNextTest(self, continueAfter=True):
queue = self._testQueue
if queue.numRows < 1:
diff --git a/devel/tester/tester.tox b/devel/tester/tester.tox
index 8c894732a..5fbfd837c 100644
Binary files a/devel/tester/tester.tox and b/devel/tester/tester.tox differ
diff --git a/devel/toolkitEditor/createRopDialog/createRopDialog.tox b/devel/toolkitEditor/createRopDialog/createRopDialog.tox
index 20a243644..09415813c 100644
Binary files a/devel/toolkitEditor/createRopDialog/createRopDialog.tox and b/devel/toolkitEditor/createRopDialog/createRopDialog.tox differ
diff --git a/devel/toolkitEditor/mainMenu/mainMenu.tox b/devel/toolkitEditor/mainMenu/mainMenu.tox
index f5a2dda19..a6a55573d 100644
Binary files a/devel/toolkitEditor/mainMenu/mainMenu.tox and b/devel/toolkitEditor/mainMenu/mainMenu.tox differ
diff --git a/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/inputEditor.py b/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/inputEditor.py
deleted file mode 100644
index 7ac5617f4..000000000
--- a/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/inputEditor.py
+++ /dev/null
@@ -1,83 +0,0 @@
-from typing import List, Optional
-from raytkUtil import InputInfo
-
-# noinspection PyUnreachableCode
-if False:
- # noinspection PyUnresolvedReferences
- from _stubs import *
- from _typeAliases import *
-
- class _StatePar:
- Inputhandler: 'OPParamT'
-
- ipar.state = _StatePar()
-
-class InputEditor:
- def __init__(self, ownerComp: 'COMP'):
- self.ownerComp = ownerComp
-
- @property
- def _stubHandler(self) -> 'COMP':
- return self.ownerComp.op('stubHandler')
-
- @property
- def _handlerComp(self) -> 'Optional[COMP]':
- return ipar.state.Inputhandler.eval()
-
- @property
- def _inputInfo(self) -> 'Optional[InputInfo]':
- comp = self._handlerComp
- if comp:
- return InputInfo(comp)
-
- @property
- def hasHandler(self):
- return bool(self._handlerComp)
-
- @property
- def inputRequiredPar(self) -> 'BoolParamT':
- return (self._handlerComp or self._stubHandler).par.Required
-
- def Attach(self, handler: 'COMP'):
- ipar.state.Inputhandler = handler
- info = self._inputInfo
- pass
-
- def Detach(self):
- ipar.state.Inputhandler = ''
- pass
-
- @property
- def allCoordTypes(self):
- return TypeTableHelper(self.ownerComp.op('typeTable')).coordTypes()
-
- @property
- def allContextTypes(self):
- return TypeTableHelper(self.ownerComp.op('typeTable')).contextTypes()
-
- @property
- def allReturnTypes(self):
- return TypeTableHelper(self.ownerComp.op('typeTable')).returnTypes()
-
-class TypeTableHelper:
- def __init__(self, table: 'DAT'):
- self.table = table
-
- def _getTypeNames(self, filterColumn: str) -> 'List[str]':
- return [
- self.table[row, 'name'].val
- for row in range(1, self.table.numRows)
- if self.table[row, filterColumn] == '1'
- ]
-
- def isTypeAvailableForCategory(self, typeName: str, filterColumn: str):
- return self.table[typeName, filterColumn] == '1'
-
- def coordTypes(self):
- return self._getTypeNames('isCoordType')
-
- def contextTypes(self):
- return self._getTypeNames('isContextType')
-
- def returnTypes(self):
- return self._getTypeNames('isReturnType')
diff --git a/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/inputEditor.tox b/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/inputEditor.tox
deleted file mode 100644
index 40f279450..000000000
Binary files a/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/inputEditor.tox and /dev/null differ
diff --git a/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/typeSpecEditor.py b/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/typeSpecEditor.py
deleted file mode 100644
index 0d2f72e1d..000000000
--- a/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/typeSpecEditor.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# noinspection PyUnreachableCode
-if False:
- # noinspection PyUnresolvedReferences
- from _stubs import *
-
-class TypeSpecEditor:
- def __init__(self, ownerComp: 'COMP'):
- self.ownerComp = ownerComp
diff --git a/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/typeSpecEditor.tox b/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/typeSpecEditor.tox
deleted file mode 100644
index 84b3e718f..000000000
Binary files a/devel/toolkitEditor/ropEditor/inputsPanel/inputEditor/typeSpecEditor.tox and /dev/null differ
diff --git a/devel/toolkitEditor/ropEditor/inputsPanel/inputsPanel.tox b/devel/toolkitEditor/ropEditor/inputsPanel/inputsPanel.tox
index bafc0c87e..1cf582833 100644
Binary files a/devel/toolkitEditor/ropEditor/inputsPanel/inputsPanel.tox and b/devel/toolkitEditor/ropEditor/inputsPanel/inputsPanel.tox differ
diff --git a/devel/toolkitEditor/ropEditor/ropEditor.tox b/devel/toolkitEditor/ropEditor/ropEditor.tox
index 7fd965684..b3bef48f0 100644
Binary files a/devel/toolkitEditor/ropEditor/ropEditor.tox and b/devel/toolkitEditor/ropEditor/ropEditor.tox differ
diff --git a/devel/toolkitEditor/ropEditor/specPanel/specPanel.tox b/devel/toolkitEditor/ropEditor/specPanel/specPanel.tox
index 14efb9b41..08b44a786 100644
Binary files a/devel/toolkitEditor/ropEditor/specPanel/specPanel.tox and b/devel/toolkitEditor/ropEditor/specPanel/specPanel.tox differ
diff --git a/devel/toolkitEditor/testEditor/testEditor.tox b/devel/toolkitEditor/testEditor/testEditor.tox
index 579517877..ed2e4cd5e 100644
Binary files a/devel/toolkitEditor/testEditor/testEditor.tox and b/devel/toolkitEditor/testEditor/testEditor.tox differ
diff --git a/devel/toolkitEditor/toolkitManager/toolkitManager.tox b/devel/toolkitEditor/toolkitManager/toolkitManager.tox
index 26de571c3..a8214d467 100644
Binary files a/devel/toolkitEditor/toolkitManager/toolkitManager.tox and b/devel/toolkitEditor/toolkitManager/toolkitManager.tox differ
diff --git a/devel/toolkitEditor/ui/ui.tox b/devel/toolkitEditor/ui/ui.tox
index 24fd4a909..ced031968 100644
Binary files a/devel/toolkitEditor/ui/ui.tox and b/devel/toolkitEditor/ui/ui.tox differ
diff --git a/devel/tools/tools.tox b/devel/tools/tools.tox
index 5dafa1aac..035a60f23 100644
Binary files a/devel/tools/tools.tox and b/devel/tools/tools.tox differ
diff --git a/devel/workArea/workArea.tox b/devel/workArea/workArea.tox
index 0118d5886..c006cff91 100644
Binary files a/devel/workArea/workArea.tox and b/devel/workArea/workArea.tox differ
diff --git a/docs/_data/toolkit.yaml b/docs/_data/toolkit.yaml
index 218c83cc8..e7c3a96b1 100644
--- a/docs/_data/toolkit.yaml
+++ b/docs/_data/toolkit.yaml
@@ -1 +1 @@
-toolkitVersion: '0.36'
+toolkitVersion: '0.37'
diff --git a/docs/_reference/operators/convert/extrude.md b/docs/_reference/operators/convert/extrude.md
index 25aad80ed..e4c062760 100644
--- a/docs/_reference/operators/convert/extrude.md
+++ b/docs/_reference/operators/convert/extrude.md
@@ -32,6 +32,7 @@ op:
- RayContext
- ParticleContext
coordTypes:
+ - vec2
- vec3
label: Height Field
name: height_definition_in
@@ -45,6 +46,7 @@ op:
- RayContext
- ParticleContext
coordTypes:
+ - vec2
- vec3
label: Offset Field
name: offset_definition_in
diff --git a/docs/_reference/operators/field/bandField.md b/docs/_reference/operators/field/bandField.md
index bc565fae8..705868b7c 100644
--- a/docs/_reference/operators/field/bandField.md
+++ b/docs/_reference/operators/field/bandField.md
@@ -142,6 +142,8 @@ op:
the first parameter will be used.
- label: Enable
name: Enable
+ - label: Reverse
+ name: Reverse
- label: Enable Repeat
name: Enablerepeat
- label: Repeat Size
diff --git a/docs/_reference/operators/field/positionField.md b/docs/_reference/operators/field/positionField.md
index 3b1433565..605e5fcb0 100644
--- a/docs/_reference/operators/field/positionField.md
+++ b/docs/_reference/operators/field/positionField.md
@@ -46,6 +46,10 @@ op:
name: local
- label: Global Position
name: global
+ - label: Pixel UV Coordinate
+ name: pixeluv
+ - label: Pixel Coordinate
+ name: pixelcoord
name: Positiontype
shortcuts:
- pos
diff --git a/docs/_reference/operators/filter/applyTransform.md b/docs/_reference/operators/filter/applyTransform.md
new file mode 100644
index 000000000..cb81c67e2
--- /dev/null
+++ b/docs/_reference/operators/filter/applyTransform.md
@@ -0,0 +1,71 @@
+---
+layout: operator
+title: applyTransform
+parent: Filter Operators
+grand_parent: Operators
+permalink: /reference/operators/filter/applyTransform
+redirect_from:
+ - /reference/opType/raytk.operators.filter.applyTransform/
+op:
+ category: filter
+ inputs:
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ - vec2
+ - vec3
+ - vec4
+ label: definition_in
+ name: definition_in
+ required: true
+ returnTypes:
+ - float
+ - vec4
+ - Sdf
+ - Ray
+ - Light
+ - Particle
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ - vec2
+ - vec3
+ - vec4
+ label: Transform 1
+ name: transform
+ required: true
+ returnTypes:
+ - vec4
+ name: applyTransform
+ opType: raytk.operators.filter.applyTransform
+ parameters:
+ - label: Enable
+ name: Enable
+ - label: Apply To
+ menuOptions:
+ - label: Coordinates
+ name: coords
+ - label: SDF UV
+ name: sdfuv
+ - label: SDF Secondary UV
+ name: sdfuv2
+ - label: UV In Material
+ name: matuv
+ - label: Field Values
+ name: value
+ name: Target
+ status: beta
+
+---
diff --git a/docs/_reference/operators/filter/circularRepeat.md b/docs/_reference/operators/filter/circularRepeat.md
index 715cbe805..c222482eb 100644
--- a/docs/_reference/operators/filter/circularRepeat.md
+++ b/docs/_reference/operators/filter/circularRepeat.md
@@ -23,12 +23,7 @@ op:
name: definition_in
required: true
returnTypes:
- - float
- - vec4
- Sdf
- - Ray
- - Light
- - Particle
name: circularRepeat
opType: raytk.operators.filter.circularRepeat
parameters:
diff --git a/docs/_reference/operators/filter/index.md b/docs/_reference/operators/filter/index.md
index 28796d158..9344b9720 100644
--- a/docs/_reference/operators/filter/index.md
+++ b/docs/_reference/operators/filter/index.md
@@ -27,6 +27,8 @@ cat:
name: adjustColor
summary: Adjust properties of color values, either directly on a field, or on
the assigned surface color of an Sdf result.
+ - name: applyTransform
+ status: beta
- name: assignAttribute
status: beta
- keywords:
@@ -135,6 +137,8 @@ cat:
- name: mirrorQuadrant
summary: Mirror coordinates across two axes.
- name: mobiusTransform
+ - name: modifyDistance
+ status: beta
- keywords:
- bumpmap
- material
@@ -215,6 +219,8 @@ cat:
- name: rangeTransform
summary: Applies a transform based on a range of settings, mapped with either
the iteration value or a field input.
+ - name: rectangleRepeat
+ status: beta
- keywords:
- flip
- mirror
@@ -296,7 +302,9 @@ cat:
shortcuts:
- tfm
summary: Transform the coordinates of the input, with rotation, scaling, and translation.
- - name: transformSequence
+ - keywords:
+ - apply
+ name: transformSequence
status: beta
- keywords:
- move
diff --git a/docs/_reference/operators/filter/modifyDistance.md b/docs/_reference/operators/filter/modifyDistance.md
new file mode 100644
index 000000000..1c5b2e84f
--- /dev/null
+++ b/docs/_reference/operators/filter/modifyDistance.md
@@ -0,0 +1,76 @@
+---
+layout: operator
+title: modifyDistance
+parent: Filter Operators
+grand_parent: Operators
+permalink: /reference/operators/filter/modifyDistance
+redirect_from:
+ - /reference/opType/raytk.operators.filter.modifyDistance/
+op:
+ category: filter
+ inputs:
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ - vec2
+ - vec3
+ - vec4
+ label: SDF
+ name: sdf_definition_in
+ required: true
+ returnTypes:
+ - float
+ - vec4
+ - Sdf
+ - Ray
+ - Light
+ - Particle
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ - vec2
+ - vec3
+ - vec4
+ label: Value Field
+ name: valueField
+ required: true
+ returnTypes:
+ - float
+ - Sdf
+ name: modifyDistance
+ opType: raytk.operators.filter.modifyDistance
+ parameters:
+ - label: Enable
+ name: Enable
+ - label: Mode
+ menuOptions:
+ - label: Add
+ name: add
+ - label: Multiply
+ name: mul
+ - label: Replace
+ name: replace
+ name: Mode
+ - label: Mix
+ name: Mix
+ summary: Mix between the original distance and the original distance.
+ status: beta
+ variables:
+ - label: sdf
+ name: sdf
+ - label: dist
+ name: dist
+
+---
diff --git a/docs/_reference/operators/filter/rectangleRepeat.md b/docs/_reference/operators/filter/rectangleRepeat.md
new file mode 100644
index 000000000..b949d8f5d
--- /dev/null
+++ b/docs/_reference/operators/filter/rectangleRepeat.md
@@ -0,0 +1,53 @@
+---
+layout: operator
+title: rectangleRepeat
+parent: Filter Operators
+grand_parent: Operators
+permalink: /reference/operators/filter/rectangleRepeat
+redirect_from:
+ - /reference/opType/raytk.operators.filter.rectangleRepeat/
+op:
+ category: filter
+ inputs:
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - vec2
+ - vec3
+ label: definition_in
+ name: definition_in
+ required: true
+ returnTypes:
+ - float
+ - vec4
+ - Sdf
+ - Ray
+ - Light
+ - Particle
+ name: rectangleRepeat
+ opType: raytk.operators.filter.rectangleRepeat
+ parameters:
+ - label: Enable
+ name: Enable
+ - label: Plane
+ menuOptions:
+ - label: XY
+ name: xy
+ - label: YZ
+ name: yz
+ - label: ZX
+ name: zx
+ name: Plane
+ - label: Grid Size
+ name: Gridsize
+ - label: Spacing
+ name: Spacing
+ status: beta
+ thumb: assets/images/reference/operators/filter/rectangleRepeat_thumb.png
+
+---
diff --git a/docs/_reference/operators/filter/transformSequence.md b/docs/_reference/operators/filter/transformSequence.md
index 9da5f9db2..600b2f9fc 100644
--- a/docs/_reference/operators/filter/transformSequence.md
+++ b/docs/_reference/operators/filter/transformSequence.md
@@ -127,6 +127,8 @@ op:
name: transform6
returnTypes:
- vec4
+ keywords:
+ - apply
name: transformSequence
opType: raytk.operators.filter.transformSequence
parameters:
diff --git a/docs/_reference/operators/function/almostIdentityFn.md b/docs/_reference/operators/function/almostIdentityFn.md
index 2519f3c29..aaff6df6b 100644
--- a/docs/_reference/operators/function/almostIdentityFn.md
+++ b/docs/_reference/operators/function/almostIdentityFn.md
@@ -13,6 +13,33 @@ op:
This is based on Inigo Quilez''s [article](https://iquilezles.org/www/articles/functions/functions.htm).'
+ inputs:
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ label: Threshold Field
+ name: thresholdField
+ returnTypes:
+ - float
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ label: Base Value Field
+ name: baseValueField
+ returnTypes:
+ - float
name: almostIdentityFn
opType: raytk.operators.function.almostIdentityFn
parameters:
diff --git a/docs/_reference/operators/function/cubicPulseFn.md b/docs/_reference/operators/function/cubicPulseFn.md
index fa3cf4489..48a4c3639 100644
--- a/docs/_reference/operators/function/cubicPulseFn.md
+++ b/docs/_reference/operators/function/cubicPulseFn.md
@@ -8,6 +8,33 @@ redirect_from:
- /reference/opType/raytk.operators.function.cubicPulseFn/
op:
category: function
+ inputs:
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ label: Width Field
+ name: widthField
+ returnTypes:
+ - float
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ label: Phase Field
+ name: phaseField
+ returnTypes:
+ - float
name: cubicPulseFn
opType: raytk.operators.function.cubicPulseFn
parameters:
diff --git a/docs/_reference/operators/function/easeFn.md b/docs/_reference/operators/function/easeFn.md
index 707113ff1..bb3b3f974 100644
--- a/docs/_reference/operators/function/easeFn.md
+++ b/docs/_reference/operators/function/easeFn.md
@@ -8,6 +8,20 @@ redirect_from:
- /reference/opType/raytk.operators.function.easeFn/
op:
category: function
+ inputs:
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ label: Exponent Field
+ name: exponentField
+ returnTypes:
+ - float
name: easeFn
opType: raytk.operators.function.easeFn
parameters:
diff --git a/docs/_reference/operators/function/flipFn.md b/docs/_reference/operators/function/flipFn.md
index b5e67e508..a8db2ef8a 100644
--- a/docs/_reference/operators/function/flipFn.md
+++ b/docs/_reference/operators/function/flipFn.md
@@ -53,6 +53,14 @@ op:
upside down.
label: Flip Negative Domain
name: flipnegdomain
+ - description: Flips the x axis in the 0..1 range so that what used to be x=0
+ is now x=1 and what used to be x=1 is now x=0.
+ label: Flip 0-1 Domain
+ name: flipdomain01
+ - description: Flips the y (value) axis in the 0..1 range so that what used to
+ be y=0 is now y=1 and what used to be y=1 is now y=0.
+ label: Flip 0-1 Range
+ name: fliprange01
name: Fliptype
summary: The type of flipping to apply.
- label: Return Type
diff --git a/docs/_reference/operators/function/gainFn.md b/docs/_reference/operators/function/gainFn.md
index 2fc3a1c3a..9ab2ead1f 100644
--- a/docs/_reference/operators/function/gainFn.md
+++ b/docs/_reference/operators/function/gainFn.md
@@ -13,6 +13,20 @@ op:
Based on Inigo Quilez''s [article](https://iquilezles.org/www/articles/functions/functions.htm).'
+ inputs:
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ label: Exponent Field
+ name: exponentField
+ returnTypes:
+ - float
name: gainFn
opType: raytk.operators.function.gainFn
parameters:
diff --git a/docs/_reference/operators/function/parabolaFn.md b/docs/_reference/operators/function/parabolaFn.md
index 817cdf070..28c05f45b 100644
--- a/docs/_reference/operators/function/parabolaFn.md
+++ b/docs/_reference/operators/function/parabolaFn.md
@@ -8,6 +8,20 @@ redirect_from:
- /reference/opType/raytk.operators.function.parabolaFn/
op:
category: function
+ inputs:
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - float
+ label: Exponent Field
+ name: exponentField
+ returnTypes:
+ - float
name: parabolaFn
opType: raytk.operators.function.parabolaFn
parameters:
diff --git a/docs/_reference/operators/output/fieldRender.md b/docs/_reference/operators/output/fieldRender.md
index 5ba27c13e..dc45b6174 100644
--- a/docs/_reference/operators/output/fieldRender.md
+++ b/docs/_reference/operators/output/fieldRender.md
@@ -66,10 +66,6 @@ op:
name: rgba16fixed
- label: 11-bit float (RGB), Positive Values Only
name: rgba11float
- - label: 16-bit float (RGB)
- name: rgb16float
- - label: 32-bit float (RGB)
- name: rgb32float
- label: 8-bit fixed (Mono)
name: mono8fixed
- label: 16-bit fixed (Mono)
diff --git a/docs/_reference/operators/output/pointMapRender.md b/docs/_reference/operators/output/pointMapRender.md
index 8b81942f6..aadca3bf3 100644
--- a/docs/_reference/operators/output/pointMapRender.md
+++ b/docs/_reference/operators/output/pointMapRender.md
@@ -101,10 +101,6 @@ op:
name: rgba16fixed
- label: 11-bit float (RGB), Positive Values Only
name: rgba11float
- - label: 16-bit float (RGB)
- name: rgb16float
- - label: 32-bit float (RGB)
- name: rgb32float
- label: 8-bit fixed (Mono)
name: mono8fixed
- label: 16-bit fixed (Mono)
diff --git a/docs/_reference/operators/sdf/prismSdf.md b/docs/_reference/operators/sdf/prismSdf.md
index b5aabbf04..87a9964c3 100644
--- a/docs/_reference/operators/sdf/prismSdf.md
+++ b/docs/_reference/operators/sdf/prismSdf.md
@@ -63,6 +63,19 @@ op:
name: sidesField
returnTypes:
- float
+ - contextTypes:
+ - Context
+ - MaterialContext
+ - CameraContext
+ - LightContext
+ - RayContext
+ - ParticleContext
+ coordTypes:
+ - vec3
+ label: Rounding Field
+ name: roundingField
+ returnTypes:
+ - float
keywords:
- column
- cylinder
@@ -110,6 +123,8 @@ op:
name: Axis
- label: Sides
name: Sides
+ - label: Rounding
+ name: Rounding
- label: Infinite Height
name: Infiniteheight
- label: Hollow
diff --git a/docs/assets/images/reference/operators/filter/rectangleRepeat_thumb.png b/docs/assets/images/reference/operators/filter/rectangleRepeat_thumb.png
new file mode 100644
index 000000000..3546f7b27
Binary files /dev/null and b/docs/assets/images/reference/operators/filter/rectangleRepeat_thumb.png differ
diff --git a/docs/release-notes.md b/docs/release-notes.md
index e56bbb5e9..75e463471 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -1,5 +1,43 @@
# Release Notes
+## v0.37
+
+### Highlights
+
+* Compatibility with TD 2023 experimental builds
+* New applyTransform op makes it easier to transform field values, uv coordinates, etc
+* Stability improvements and bug fixes
+
+### Details
+
+* Improvements / additions
+ * New OPs
+ * applyTransform - to apply a transform filter to field values, uv coordinates, etc (#1019)
+ * modifyDistance - use a field to modify the distance values from an SDF (#1139)
+ * rectangleRepeat - repeat space in tiles arranged on the sides of a rectangle (#1126)
+ * New OP features
+ * almostIdentityFn - threshold, base value field inputs (#1124)
+ * bandField - reverse parameter
+ * cubicPulseFn - phase, width field inputs (#1124)
+ * easeFn - exponent field input (#1124)
+ * extrude - 2D height / offset field inputs (#1134)
+ * flipFn - flip 0..1 modes as well as positive/negative (#1127)
+ * gainFn = exponent field input (#1124)
+ * parabolaFn - exponent field input (#1124)
+ * positionField - pixel uv and pixel coordinate modes
+ * prismSdf - rounding (#1130)
+ * Editor tools
+* Fixes
+ * Fix widget compatibility issues with TD 2023 experimental builds
+ * Fix angle handling in magnet (#1138)
+ * Fix return type limiting in circularRepeat
+* Changes (potentially breaking)
+* Infrastructure / internals
+ * Stop syncing files within clones in devel source
+ * Use the new input list parameter instead of dynamically wiring up texture inputs in renderers
+ * Move op-specific code out of shared libraries to improve compile speeds
+
+
## v0.36
### Highlights
diff --git a/raytk-build.toe b/raytk-build.toe
index 9da6dc9bb..0aa1153d1 100644
Binary files a/raytk-build.toe and b/raytk-build.toe differ
diff --git a/raytk-development.toe b/raytk-development.toe
index b9ce84d75..c230a451f 100644
Binary files a/raytk-development.toe and b/raytk-development.toe differ
diff --git a/raytk-test.toe b/raytk-test.toe
index 0a7f536fb..aa969cfbd 100644
Binary files a/raytk-test.toe and b/raytk-test.toe differ
diff --git a/src/components/aggregateCodeGenerator/aggregateCodeGenerator.tox b/src/components/aggregateCodeGenerator/aggregateCodeGenerator.tox
index 83e28c259..eeb5e24a6 100644
Binary files a/src/components/aggregateCodeGenerator/aggregateCodeGenerator.tox and b/src/components/aggregateCodeGenerator/aggregateCodeGenerator.tox differ
diff --git a/src/components/bufferInspector/bufferInspector.tox b/src/components/bufferInspector/bufferInspector.tox
index 5f7bee813..a21cef12b 100644
Binary files a/src/components/bufferInspector/bufferInspector.tox and b/src/components/bufferInspector/bufferInspector.tox differ
diff --git a/src/components/combiner/combiner.tox b/src/components/combiner/combiner.tox
index a5b1e9ac1..08962e1f9 100644
Binary files a/src/components/combiner/combiner.tox and b/src/components/combiner/combiner.tox differ
diff --git a/src/components/compDefinition/compDefinition.tox b/src/components/compDefinition/compDefinition.tox
index 51c505ca7..f1d8c6b69 100644
Binary files a/src/components/compDefinition/compDefinition.tox and b/src/components/compDefinition/compDefinition.tox differ
diff --git a/src/components/datEditorPanel/datEditorPanel.tox b/src/components/datEditorPanel/datEditorPanel.tox
index c7371e199..b9cef2b0d 100644
Binary files a/src/components/datEditorPanel/datEditorPanel.tox and b/src/components/datEditorPanel/datEditorPanel.tox differ
diff --git a/src/components/inputHandler/inputHandler.tox b/src/components/inputHandler/inputHandler.tox
index 101b1d86c..f06cd063b 100644
Binary files a/src/components/inputHandler/inputHandler.tox and b/src/components/inputHandler/inputHandler.tox differ
diff --git a/src/components/multiInputHandler/multiInputHandler.tox b/src/components/multiInputHandler/multiInputHandler.tox
index c3adb7280..761108c6a 100644
Binary files a/src/components/multiInputHandler/multiInputHandler.tox and b/src/components/multiInputHandler/multiInputHandler.tox differ
diff --git a/src/components/opDefinition/opDefinition.tox b/src/components/opDefinition/opDefinition.tox
index 2bbd5ac56..649012f5d 100644
Binary files a/src/components/opDefinition/opDefinition.tox and b/src/components/opDefinition/opDefinition.tox differ
diff --git a/src/components/opElement/opElement.tox b/src/components/opElement/opElement.tox
index d061ab35f..f07e10028 100644
Binary files a/src/components/opElement/opElement.tox and b/src/components/opElement/opElement.tox differ
diff --git a/src/components/opImage/opImage.tox b/src/components/opImage/opImage.tox
index 7cbf4075f..3a422d351 100644
Binary files a/src/components/opImage/opImage.tox and b/src/components/opImage/opImage.tox differ
diff --git a/src/components/outputBufferController/outputBufferController.tox b/src/components/outputBufferController/outputBufferController.tox
index 9f3b6c146..b578df83b 100644
Binary files a/src/components/outputBufferController/outputBufferController.tox and b/src/components/outputBufferController/outputBufferController.tox differ
diff --git a/src/components/outputOpController/onHostParPulse.py b/src/components/outputOpController/onHostParPulse.py
deleted file mode 100644
index 6b846fa18..000000000
--- a/src/components/outputOpController/onHostParPulse.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# noinspection PyUnreachableCode
-if False:
- # noinspection PyUnresolvedReferences
- from _stubs import *
- from .outputOpController import OutputOp
-
- # noinspection PyTypeChecker
- ext.outputOp = OutputOp(COMP())
-
-def onPulse(par):
- ext.outputOp.updateTextureInputs()
diff --git a/src/components/outputOpController/onTextureSourcesChange.py b/src/components/outputOpController/onTextureSourcesChange.py
deleted file mode 100644
index 9a548e2bc..000000000
--- a/src/components/outputOpController/onTextureSourcesChange.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# noinspection PyUnreachableCode
-if False:
- # noinspection PyUnresolvedReferences
- from _stubs import *
- from .outputOpController import OutputOp
-
- # noinspection PyTypeChecker
- ext.outputOp = OutputOp(COMP())
-
-def onTableChange(dat):
- ext.outputOp.updateTextureInputs()
diff --git a/src/components/outputOpController/outputOpController.py b/src/components/outputOpController/outputOpController.py
index adfb7ff63..092529442 100644
--- a/src/components/outputOpController/outputOpController.py
+++ b/src/components/outputOpController/outputOpController.py
@@ -11,8 +11,6 @@ class _Par:
Opdef: 'OPParamT'
Rendertop: 'OPParamT'
Shaderbuilder: 'OPParamT'
- Fixedtexinputs: 'StrParamT'
- Texselectors: 'StrParamT'
class _COMP(COMP):
par: _Par
@@ -31,7 +29,6 @@ def _renderTop(self) -> 'Optional[glslmultiTOP]':
return self.ownerComp.par.Rendertop.eval()
def onInit(self):
- self.updateTextureInputs()
self.resetInfoParams()
self.updateConstantParams()
@@ -43,22 +40,6 @@ def resetInfoParams(self):
if par.page == 'Info' and not par.readOnly and not par:
par.val = par.default
- def updateTextureInputs(self):
- renderTop = self._renderTop()
- if not renderTop:
- return
- inputs = self.ownerComp.par.Fixedtexinputs.evalOPs() # type: List[TOP]
- host = self._host()
- host.clearScriptErrors(error='texerr*')
- texSources = self.ownerComp.op('textureSources') # type: DAT
- selectors = self.ownerComp.par.Texselectors.evalOPs() # type: List[TOP]
- for i in range(texSources.numRows):
- if i >= len(selectors):
- host.addScriptError(f'texerr: Too many texture sources (failed on #{i})')
- return
- inputs.append(selectors[i])
- renderTop.setInputs(inputs)
-
def updateConstantParams(self):
renderTop = self._renderTop()
if not renderTop:
@@ -70,6 +51,6 @@ def updateConstantParams(self):
for i in range(1, table.numRows):
if table[i, 'uniformType'] == 'constant':
count += 1
- sequence = renderTop.par.constname0.sequence # type: Sequence
+ sequence = renderTop.par.const0name.sequence # type: Sequence
if count > sequence.numBlocks:
sequence.numBlocks = count
diff --git a/src/components/outputOpController/outputOpController.tox b/src/components/outputOpController/outputOpController.tox
index 23347f34a..a223f02fe 100644
Binary files a/src/components/outputOpController/outputOpController.tox and b/src/components/outputOpController/outputOpController.tox differ
diff --git a/src/components/parMenuUpdater/parMenuUpdater.tox b/src/components/parMenuUpdater/parMenuUpdater.tox
index 815ef984a..cf1ccc208 100644
Binary files a/src/components/parMenuUpdater/parMenuUpdater.tox and b/src/components/parMenuUpdater/parMenuUpdater.tox differ
diff --git a/src/components/shaderBuilder/shaderBuilder.tox b/src/components/shaderBuilder/shaderBuilder.tox
index c29fb5f7f..36a8b76ac 100644
Binary files a/src/components/shaderBuilder/shaderBuilder.tox and b/src/components/shaderBuilder/shaderBuilder.tox differ
diff --git a/src/components/shaderBuilder/shaderBuilderConfig.tox b/src/components/shaderBuilder/shaderBuilderConfig.tox
index 8e45d2671..e6098e6b7 100644
Binary files a/src/components/shaderBuilder/shaderBuilderConfig.tox and b/src/components/shaderBuilder/shaderBuilderConfig.tox differ
diff --git a/src/components/shaderLibraries/shaderLibraries.tox b/src/components/shaderLibraries/shaderLibraries.tox
index ce06faf93..443f720d0 100644
Binary files a/src/components/shaderLibraries/shaderLibraries.tox and b/src/components/shaderLibraries/shaderLibraries.tox differ
diff --git a/src/components/timeProvider/timeProvider.tox b/src/components/timeProvider/timeProvider.tox
index 270a0af61..8573cdbd8 100644
Binary files a/src/components/timeProvider/timeProvider.tox and b/src/components/timeProvider/timeProvider.tox differ
diff --git a/src/components/transformCodeGenerator/transformCodeGenerator.tox b/src/components/transformCodeGenerator/transformCodeGenerator.tox
index 064c0696a..60bd5443b 100644
Binary files a/src/components/transformCodeGenerator/transformCodeGenerator.tox and b/src/components/transformCodeGenerator/transformCodeGenerator.tox differ
diff --git a/src/components/transformTarget/transformTarget.tox b/src/components/transformTarget/transformTarget.tox
index 637828f73..06c90c85b 100644
Binary files a/src/components/transformTarget/transformTarget.tox and b/src/components/transformTarget/transformTarget.tox differ
diff --git a/src/components/uniformExportGenerator/uniformExportGenerator.tox b/src/components/uniformExportGenerator/uniformExportGenerator.tox
index 1dd61b3aa..5e0b0bc9e 100644
Binary files a/src/components/uniformExportGenerator/uniformExportGenerator.tox and b/src/components/uniformExportGenerator/uniformExportGenerator.tox differ
diff --git a/src/components/waveFunction/waveFunction.tox b/src/components/waveFunction/waveFunction.tox
index 1f637f680..703128cee 100644
Binary files a/src/components/waveFunction/waveFunction.tox and b/src/components/waveFunction/waveFunction.tox differ
diff --git a/src/lib/raytkTools.py b/src/lib/raytkTools.py
index 43e3d6c71..7e2d728c3 100644
--- a/src/lib/raytkTools.py
+++ b/src/lib/raytkTools.py
@@ -188,8 +188,12 @@ def saveROP(self, rop: 'COMP', incrementVersion=False):
focusFirstCustomParameterPage(rop)
tox = info.toxFile
rop.par.savebackup = False
- rop.par.reloadtoxonstart.expr = ''
- rop.par.reloadtoxonstart.val = True
+ if rop.par['reloadtoxonstart'] is not None:
+ rop.par.reloadtoxonstart.expr = ''
+ rop.par.reloadtoxonstart.val = True
+ else:
+ rop.par.enableexternaltox.expr = ''
+ rop.par.enableexternaltox.val = True
rop.par.reloadcustom.expr = ''
rop.par.reloadcustom.val = True
rop.par.reloadbuiltin.expr = ''
diff --git a/src/lib/raytkUtil.py b/src/lib/raytkUtil.py
index 59000a664..b5af02e29 100644
--- a/src/lib/raytkUtil.py
+++ b/src/lib/raytkUtil.py
@@ -708,11 +708,30 @@ def isOn(self, o: 'OP'):
opDef = ROPInfo(o).opDef
return super().isOn(o) or super().isOn(opDef)
+def _getRelPathBehavior(o: 'OP'):
+ p = o.par['relpath']
+ if p == 'project':
+ return 'project'
+ if p == 'externaltox':
+ return 'externaltox'
+ po = o.parent()
+ if not po:
+ return 'project'
+ return _getRelPathBehavior(po)
+
+def _resolveFilePath(o: 'OP', file: str):
+ if not file:
+ return ''
+ rule = _getRelPathBehavior(o)
+ if rule == 'externaltox':
+ return o.parent().fileFolder + '/' + file
+ return file
+
def _updateFileSyncPars(o: 'Union[OP, DAT]', state: bool):
if o.isDAT:
filePar = o.par['file']
if filePar and state:
- o.save(filePar.eval())
+ o.save(_resolveFilePath(o, filePar.eval()))
if o.par['defaultreadencoding'] is not None:
o.par.defaultreadencoding = 'utf8'
par = o.par['syncfile']
@@ -996,8 +1015,12 @@ def detachTox(comp: 'COMP'):
return
if not comp.par.externaltox and comp.par.externaltox.mode == ParMode.CONSTANT:
return
- comp.par.reloadtoxonstart.expr = ''
- comp.par.reloadtoxonstart.val = False
+ if comp.par['reloadtoxonstart'] is not None:
+ comp.par.reloadtoxonstart.expr = ''
+ comp.par.reloadtoxonstart.val = False
+ else:
+ comp.par.enableexternaltox.expr = ''
+ comp.par.enableexternaltox.val = False
comp.par.externaltox.expr = ''
comp.par.externaltox.val = ''
diff --git a/src/lib/shader/geodesic.glsl b/src/lib/shader/geodesic.glsl
index 604ee829a..f7b3d4e61 100644
--- a/src/lib/shader/geodesic.glsl
+++ b/src/lib/shader/geodesic.glsl
@@ -1,5 +1,13 @@
// https://www.shadertoy.com/view/4tG3zW
+// Normal for the perpendicular bisector plane of two points
+vec3 bisector(vec3 a, vec3 b) {
+ return normalize(cross(
+ mix(a, b, .5),
+ cross(a, b)
+ ));
+}
+
vec3 geo_nc,geo_pab,geo_pbc,geo_pca;
void geo_init() {//setup folding planes and vertex
const int Type=5;
diff --git a/src/lib/shader/glslNoise.glsl b/src/lib/shader/glslNoise.glsl
index a749ed31f..3f7f1e107 100644
--- a/src/lib/shader/glslNoise.glsl
+++ b/src/lib/shader/glslNoise.glsl
@@ -451,14 +451,15 @@ vec4 noi_grad4(float j, vec4 ip)
float snoise(vec4 v)
{
// (sqrt(5) - 1)/4 = F4, used once below
- const float F4 = 0.309016994374947451;
+ // for some reason `F4` as a symbol is causing problems in some test cases?!?!
+ const float F4_asdf = 0.309016994374947451;
const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4
0.276393202250021, // 2 * G4
0.414589803375032, // 3 * G4
-0.447213595499958); // -1 + 4 * G4
// First corner
- vec4 i = floor(v + dot(v, vec4(F4)) );
+ vec4 i = floor(v + dot(v, vec4(F4_asdf)) );
vec4 x0 = v - i + dot(i, C.xxxx);
// Other corners
diff --git a/src/lib/shader/hg_sdf.glsl b/src/lib/shader/hg_sdf.glsl
index aad01f161..dd1df70d5 100644
--- a/src/lib/shader/hg_sdf.glsl
+++ b/src/lib/shader/hg_sdf.glsl
@@ -25,25 +25,6 @@ vec2 sgn(vec2 v) {
return vec2((v.x<0)?-1:1, (v.y<0)?-1:1);
}
-#if 0
-float square (float x) {
- return x*x;
-}
-
-vec2 square (vec2 x) {
- return x*x;
-}
-
-vec3 square (vec3 x) {
- return x*x;
-}
-
-float lengthSqr(vec3 x) {
- return dot(x, x);
-}
-#endif
-
-
// Maximum/minumum elements of a vector
float vmax(vec2 v) {
return max(v.x, v.y);
@@ -69,12 +50,6 @@ float vmin(vec4 v) {
return min(min(v.x, v.y), min(v.z, v.w));
}
-#if 0
-float fSphere(vec3 p, float r) {
- return length(p) - r;
-}
-#endif
-
// Plane with normal n (n is normalized) at some distance from the origin
float fPlane(vec3 p, vec3 n, float distanceFromOrigin) {
return dot(p, n) + distanceFromOrigin;
@@ -107,22 +82,6 @@ float fCorner (vec2 p) {
return length(max(p, vec2(0))) + vmax(min(p, vec2(0)));
}
-#if 0
-// Blobby ball object. You've probably seen it somewhere. This is not a correct distance bound, beware.
-float fBlob(vec3 p) {
- p = abs(p);
- if (p.x < max(p.y, p.z)) p = p.yzx;
- if (p.x < max(p.y, p.z)) p = p.yzx;
- float b = max(max(max(
- dot(p, normalize(vec3(1, 1, 1))),
- dot(p.xz, normalize(vec2(PHI+1, 1)))),
- dot(p.yx, normalize(vec2(1, PHI)))),
- dot(p.xz, normalize(vec2(1, PHI))));
- float l = length(p);
- return l - 1.5 - 0.2 * (1.5 / 2)* cos(min(sqrt(1.01 - b / l)*(PI / 0.25), PI));
-}
-#endif
-
// Cylinder standing upright on the xz plane
float fCylinder(vec3 p, float r, float height) {
float d = length(p.xz) - r;
@@ -147,19 +106,6 @@ float fCapsule(vec3 p, vec3 a, vec3 b, float r) {
return fLineSegment(p, a, b) - r;
}
-// Torus in the XZ-plane
-float fTorus(vec3 p, float smallRadius, float largeRadius) {
- return length(vec2(length(p.xz) - largeRadius, p.y)) - smallRadius;
-}
-
-#if 0
-// A circle line. Can also be used to make a torus by subtracting the smaller radius of the torus.
-float fCircle(vec3 p, float r) {
- float l = length(p.xz) - r;
- return length(vec2(p.y, l));
-}
-#endif
-
// A circular disc with no thickness (i.e. a cylinder with no height).
// Subtract some value to make a flat disc with rounded edge.
float fDisc(vec3 p, float r) {
@@ -167,42 +113,6 @@ float fDisc(vec3 p, float r) {
return l < 0 ? abs(p.y) : length(vec2(p.y, l));
}
- #if 0
-// Hexagonal prism, circumcircle variant
-float fHexagonCircumcircle(vec3 p, vec2 h) {
- vec3 q = abs(p);
- return max(q.y - h.y, max(q.x*sqrt(3)*0.5 + q.z*0.5, q.z) - h.x);
- //this is mathematically equivalent to this line, but less efficient:
- //return max(q.y - h.y, max(dot(vec2(cos(PI/3), sin(PI/3)), q.zx), q.z) - h.x);
-}
-
-// Hexagonal prism, incircle variant
-float fHexagonIncircle(vec3 p, vec2 h) {
- return fHexagonCircumcircle(p, vec2(h.x*sqrt(3)*0.5, h.y));
-}
-#endif
-
-// Cone with correct distances to tip and base circle. Y is up, 0 is in the middle of the base.
-float fCone(vec3 p, float radius, float height) {
- vec2 q = vec2(length(p.xz), p.y);
- vec2 tip = q - vec2(0, height);
- vec2 mantleDir = normalize(vec2(height, radius));
- float mantle = dot(tip, mantleDir);
- float d = max(mantle, -q.y);
- float projected = dot(tip, vec2(mantleDir.y, -mantleDir.x));
-
- // distance to tip
- if ((q.y > height) && (projected < 0)) {
- d = max(d, length(tip));
- }
-
- // distance to base ring
- if ((q.x > radius) && (projected > length(vec2(height, radius)))) {
- d = max(d, length(q - vec2(radius, 0)));
- }
- return d;
-}
-
// Rotate around a coordinate axis (i.e. in a plane perpendicular to that axis) by angle .
// Read like this: R(p.xz, a) rotates "x towards z".
// This is fast if is a compile-time constant and slower (but still practical) if not.
@@ -300,13 +210,6 @@ vec2 pModGrid2(inout vec2 p, vec2 size) {
return floor(c/2);
}
-// Repeat in three dimensions
-vec3 pMod3(inout vec3 p, vec3 size) {
- vec3 c = floor((p + size*0.5)/size);
- p = mod(p + size*0.5, size) - size*0.5;
- return c;
-}
-
// Mirror at an axis-aligned plane which is at a specified distance from the origin.
float pMirror (inout float p, float dist) {
float s = sgn(p);
@@ -365,107 +268,3 @@ float fOpIntersectionRound(float a, float b, float r) {
float fOpDifferenceRound (float a, float b, float r) {
return fOpIntersectionRound(a, -b, r);
}
-
-#if 0
-// The "Columns" flavour makes n-1 circular columns at a 45 degree angle:
-float fOpUnionColumns(float a, float b, float r, float n) {
- if ((a < r) && (b < r)) {
- vec2 p = vec2(a, b);
- float columnradius = r*sqrt(2)/((n-1)*2+sqrt(2));
- pR45(p);
- p.x -= sqrt(2)/2*r;
- p.x += columnradius*sqrt(2);
- if (mod(n,2) == 1) {
- p.y += columnradius;
- }
- // At this point, we have turned 45 degrees and moved at a point on the
- // diagonal that we want to place the columns on.
- // Now, repeat the domain along this direction and place a circle.
- pMod1(p.y, columnradius*2);
- float result = length(p) - columnradius;
- result = min(result, p.x);
- result = min(result, a);
- return min(result, b);
- } else {
- return min(a, b);
- }
-}
-
-float fOpDifferenceColumns(float a, float b, float r, float n) {
- a = -a;
- float m = min(a, b);
- //avoid the expensive computation where not needed (produces discontinuity though)
- if ((a < r) && (b < r)) {
- vec2 p = vec2(a, b);
- float columnradius = r*sqrt(2)/n/2.0;
- columnradius = r*sqrt(2)/((n-1)*2+sqrt(2));
-
- pR45(p);
- p.y += columnradius;
- p.x -= sqrt(2)/2*r;
- p.x += -columnradius*sqrt(2)/2;
-
- if (mod(n,2) == 1) {
- p.y += columnradius;
- }
- pMod1(p.y,columnradius*2);
-
- float result = -length(p) + columnradius;
- result = max(result, p.x);
- result = min(result, a);
- return -min(result, b);
- } else {
- return -m;
- }
-}
-
-float fOpIntersectionColumns(float a, float b, float r, float n) {
- return fOpDifferenceColumns(a,-b,r, n);
-}
-
-// The "Stairs" flavour produces n-1 steps of a staircase:
-// much less stupid version by paniq
-float fOpUnionStairs(float a, float b, float r, float n) {
- float s = r/n;
- float u = b-r;
- return min(min(a,b), 0.5 * (u + a + abs ((mod (u - a + s, 2 * s)) - s)));
-}
-
-// We can just call Union since stairs are symmetric.
-float fOpIntersectionStairs(float a, float b, float r, float n) {
- return -fOpUnionStairs(-a, -b, r, n);
-}
-
-float fOpDifferenceStairs(float a, float b, float r, float n) {
- return -fOpUnionStairs(-a, b, r, n);
-}
-
-// Similar to fOpUnionRound, but more lipschitz-y at acute angles
-// (and less so at 90 degrees). Useful when fudging around too much
-// by MediaMolecule, from Alex Evans' siggraph slides
-float fOpUnionSoft(float a, float b, float r) {
- float e = max(r - abs(a - b), 0);
- return min(a, b) - e*e*0.25/r;
-}
-#endif
-
-// produces a cylindical pipe that runs along the intersection.
-// No objects remain, only the pipe. This is not a boolean operator.
-float fOpPipe(float a, float b, float r) {
- return length(vec2(a, b)) - r;
-}
-
-// first object gets a v-shaped engraving where it intersect the second
-float fOpEngrave(float a, float b, float r) {
- return max(a, (a + r - abs(b))*sqrt(0.5));
-}
-
-// first object gets a capenter-style groove cut out
-float fOpGroove(float a, float b, float ra, float rb) {
- return max(a, min(a + ra, rb - abs(b)));
-}
-
-// first object gets a capenter-style tongue attached
-float fOpTongue(float a, float b, float ra, float rb) {
- return min(a, max(a - ra, abs(b) - rb));
-}
diff --git a/src/lib/shader/raytkCommon.glsl b/src/lib/shader/raytkCommon.glsl
index 0be3a4b0d..62ab080d5 100644
--- a/src/lib/shader/raytkCommon.glsl
+++ b/src/lib/shader/raytkCommon.glsl
@@ -97,15 +97,6 @@ mat4 lookAtViewMatrix(vec3 eye, vec3 center, vec3 up) {
vec4(0.0, 0.0, 0.0, 1)
);
}
-// https://github.com/glslify/glsl-look-at/
-mat3 calcLookAtMatrix(vec3 origin, vec3 target, float roll) {
- vec3 rr = vec3(sin(roll), cos(roll), 0.0);
- vec3 ww = normalize(target - origin);
- vec3 uu = normalize(cross(ww, rr));
- vec3 vv = normalize(cross(uu, ww));
-
- return mat3(uu, vv, ww);
-}
float ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }
@@ -129,31 +120,6 @@ vec4 qsqr(in vec4 a)// square a quaterion
2.0*a.x*a.w);
}
-vec3 boxFold(vec3 p, float r) {
- return clamp(p.xyz, -r, r) * 2.0 - p;
-}
-
-vec3 mengerFold(vec3 p) {
- float a = min(p.x - p.y, 0.0);
- p.x -= a;
- p.y += a;
- a = min(p.x - p.z, 0.0);
- p.x -= a;
- p.z += a;
- a = min(p.y - p.z, 0.0);
- p.y -= a;
- p.z += a;
- return p;
-}
-
-// Normal for the perpendicular bisector plane of two points
-vec3 bisector(vec3 a, vec3 b) {
- return normalize(cross(
- mix(a, b, .5),
- cross(a, b)
- ));
-}
-
float smin(float a, float b, float k){
float f = clamp(0.5 + 0.5 * ((a - b) / k), 0., 1.);
return (1. - f) * a + f * b - f * (1. - f) * k;
@@ -163,30 +129,6 @@ float smax(float a, float b, float k) {
return -smin(-a, -b, k);
}
-float smin2(float a, float b, float r) {
- vec2 u = max(vec2(r - a,r - b), vec2(0));
- return max(r, min (a, b)) - length(u);
-}
-
-float smax2(float a, float b, float r) {
- vec2 u = max(vec2(r + a,r + b), vec2(0));
- return min(-r, max (a, b)) + length(u);
-}
-
-float smin3(float a, float b, float k){
- return min(
- smin(a, b, k),
- smin2(a, b, k)
- );
-}
-
-float smax3(float a, float b, float k){
- return max(
- smax(a, b, k),
- smax2(a, b, k)
- );
-}
-
float dot2( in vec2 v ) { return dot(v,v); }
float dot2( in vec3 v ) { return dot(v,v); }
@@ -331,23 +273,6 @@ vec3 fillToVec3(vec4 p) { return p.xyz; }
vec4 fillToVec4(float p) { return vec4(p); }
vec4 fillToVec4(vec4 p) { return p; }
-float extractOrUseAsX(float p) { return p; }
-float extractOrUseAsX(vec2 p) { return p.x; }
-float extractOrUseAsX(vec3 p) { return p.x; }
-float extractOrUseAsX(vec4 p) { return p.x; }
-
-float extractOrUseAsY(float p) { return p; }
-float extractOrUseAsY(vec4 p) { return p.y; }
-
-float extractOrUseAsZ(float p) { return p; }
-float extractOrUseAsZ(vec4 p) { return p.z; }
-
-float extractOrUseAsW(float p) { return p; }
-float extractOrUseAsW(vec4 p) { return p.w; }
-
-void setFromFloat(inout float x, float val) { x = val; }
-void setFromFloat(inout Sdf x, float val) { x.x = val; }
-
void swap(inout Sdf a, inout Sdf b) {
Sdf tmp = a;
a = b;
@@ -377,10 +302,14 @@ float getAxis(float p, int axis) {
}
float getAxis(vec2 p, int axis) {
- return (axis >= 0 && axis <= 2) ? p[axis] : 0.;
+ return (axis >= 0 && axis <= 1) ? p[axis] : 0.;
}
float getAxis(vec3 p, int axis) {
+ return (axis >= 0 && axis <= 2) ? p[axis] : 0.;
+}
+
+float getAxis(vec4 p, int axis) {
return (axis >= 0 && axis <= 3) ? p[axis] : 0.;
}
@@ -468,56 +397,12 @@ vec3 stereographic(vec4 p4) {
return k*p4.xyz;
}
-// https://www.shadertoy.com/view/3djBDh
-//the following functions assume that p is inside the cube of radius 1 centered at the origin
-//closest vertex of the cube to p
-vec3 nearestVertex(vec3 p) {
- return max(sign(p), vec3(0))*2.-1.;
-}
-//closest face of the cube to p
-vec3 nearestFace(vec3 p) {
- vec3 ap = abs(p);
- if (ap.x>=max(ap.z, ap.y)) return vec3(sign(p.x), 0., 0.);
- if (ap.y>=max(ap.z, ap.x)) return vec3(0., sign(p.y), 0.);
- if (ap.z>=max(ap.x, ap.y)) return vec3(0., 0., sign(p.z));
- return vec3(0);
-}
-//closest edge of the cube to p
-vec3 nearestEdge(vec3 p) {
- vec3 mask = vec3(1)-abs(nearestFace(p));
- vec3 v = nearestVertex(p);
- vec3 a = v*mask.zxy, b = v*mask.yzx;
- return distance(p, a) p2.y) return vec2((p.x < 0.) ? -1. : 1., 0.);
- else return vec2(0., (p.y < 0.) ? -1. : 1.);
-}
-
// https://lygia.xyz/math/pow5
float pow5(const in float x) {
float x2 = x * x;
return x2 * x2 * x;
}
-vec2 pow5(const in vec2 x) {
- vec2 x2 = x * x;
- return x2 * x2 * x;
-}
-
-vec3 pow5(const in vec3 x) {
- vec3 x2 = x * x;
- return x2 * x2 * x;
-}
-
-vec4 pow5(const in vec4 x) {
- vec4 x2 = x * x;
- return x2 * x2 * x;
-}
-
// https://github.com/CesiumGS/cesium/blob/master/Source/Shaders/Builtin/Functions/
float czm_luminance(vec3 rgb)
{
diff --git a/src/lib/shader/raytkCore.glsl b/src/lib/shader/raytkCore.glsl
index 009acb08d..3cf1d21ef 100644
--- a/src/lib/shader/raytkCore.glsl
+++ b/src/lib/shader/raytkCore.glsl
@@ -539,14 +539,3 @@ bool isDistanceOnlyStage() {
_raytkStage == RAYTK_STAGE_SUBSURFACE;
}
-void captureIterationFromMaterial(inout vec4 store, in Context ctx) {
- if (_raytkStage == RAYTK_STAGE_PRIMARY) {
- store = ctx.iteration;
- }
-}
-
-void restoreIterationFromMaterial(inout MaterialContext matCtx, in vec4 store) {
- if (_raytkStage == RAYTK_STAGE_MATERIAL) {
- matCtx.context.iteration = store;
- }
-}
diff --git a/src/lib/shader/raytkMaterial.glsl b/src/lib/shader/raytkMaterial.glsl
index 0ef265b4f..404afa674 100644
--- a/src/lib/shader/raytkMaterial.glsl
+++ b/src/lib/shader/raytkMaterial.glsl
@@ -69,3 +69,14 @@ float schlick(const in float f0, const in float f90, const in float VoH) {
return f0 + (f90 - f0) * pow5(1.0 - VoH);
}
+void captureIterationFromMaterial(inout vec4 store, in Context ctx) {
+ if (_raytkStage == RAYTK_STAGE_PRIMARY) {
+ store = ctx.iteration;
+ }
+}
+
+void restoreIterationFromMaterial(inout MaterialContext matCtx, in vec4 store) {
+ if (_raytkStage == RAYTK_STAGE_MATERIAL) {
+ matCtx.context.iteration = store;
+ }
+}
diff --git a/src/lib/shader/raytkSdf.glsl b/src/lib/shader/raytkSdf.glsl
index b68f88b03..f0b843b92 100644
--- a/src/lib/shader/raytkSdf.glsl
+++ b/src/lib/shader/raytkSdf.glsl
@@ -12,74 +12,6 @@ float sdTetrahedron(vec3 p) {
-1.)/sqrt(3.0);
}
-float sdOctahedron( vec3 p, float s)
-{
- p = abs(p);
- float m = p.x+p.y+p.z-s;
- vec3 q;
- if( 3.0*p.x < m ) q = p.xyz;
- else if( 3.0*p.y < m ) q = p.yzx;
- else if( 3.0*p.z < m ) q = p.zxy;
- else return m*0.57735027;
-
- float k = clamp(0.5*(q.z-q.y+s),0.0,s);
- return length(vec3(q.x,q.y-s+k,q.z-k));
-}
-
-float sdOctahedronBound( vec3 p, float s)
-{
- p = abs(p);
- return (p.x+p.y+p.z-s)*0.57735027;
-}
-
-float sdCappedTorus(in vec3 p, in vec2 sc, in float ra, in float rb)
-{
- p.x = abs(p.x);
- float k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy, sc) : length(p.xy);
- return sqrt(dot(p, p) + ra*ra - 2.0*ra*k) - rb;
-}
-
-float fCone(vec3 p, float radius, float height, vec3 direction, float offset) {
- p -= direction * offset;
- p = reflect(p, normalize(mix(vec3(0,1,0), -direction, .5)));
- //p -= vec3(0,height,0);
- return fCone(p, radius, height);
-}
-
-float sdCappedCone(vec3 p, float h, float r1, float r2)
-{
- vec2 q = vec2( length(p.xz), p.y );
- vec2 k1 = vec2(r2,h);
- vec2 k2 = vec2(r2-r1,2.0*h);
- vec2 ca = vec2(q.x-min(q.x,(q.y<0.0)?r1:r2), abs(q.y)-h);
- vec2 cb = q - k1 + k2*clamp( dot(k1-q,k2)/dot2(k2), 0.0, 1.0 );
- float s = (cb.x<0.0 && ca.y<0.0) ? -1.0 : 1.0;
- return s*sqrt( min(dot2(ca),dot2(cb)) );
-}
-
-// IQ https://www.shadertoy.com/view/Xds3zN
-float sdRoundCone( in vec3 p, in float r1, float r2, float h )
-{
- vec2 q = vec2( length(p.xz), p.y );
-
- float b = (r1-r2)/h;
- float a = sqrt(1.0-b*b);
- float k = dot(q,vec2(-b,a));
-
- if( k < 0.0 ) return length(q) - r1;
- if( k > a*h ) return length(q-vec2(0.0,h)) - r2;
-
- return dot(q, vec2(a,b) ) - r1;
-}
-
-float sdRoundedBox( in vec2 p, in vec2 b, in vec4 r )
-{
- r.xy = (p.x>0.0)?r.xy : r.zw;
- r.x = (p.y>0.0)?r.x : r.y;
- vec2 q = abs(p)-b+r.x;
- return min(max(q.x,q.y),0.0) + length(max(q,0.0)) - r.x;
-}
-
float fCapsule(vec2 p, vec2 a, vec2 b) {
vec2 pa = p - a;
vec2 ba = b - a;
diff --git a/src/operators/combine/edgeCombine.tox b/src/operators/combine/edgeCombine.tox
index 89d41ace9..a3d6fe7e4 100644
Binary files a/src/operators/combine/edgeCombine.tox and b/src/operators/combine/edgeCombine.tox differ
diff --git a/src/operators/combine/edgeCombine.yaml b/src/operators/combine/edgeCombine.yaml
index ad2a21a0a..ceadb201f 100644
--- a/src/operators/combine/edgeCombine.yaml
+++ b/src/operators/combine/edgeCombine.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.combine.edgeCombine
- opVersion: '8'
+ opVersion: '9'
opStatus: default
opDef: !def
enable: true
@@ -16,6 +16,8 @@ opDef: !def
file: src/operators/combine/edgeCombine.glsl
name: function
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('edgeCombine_lib')
generatedMacroTables: multiInputHandler_macros
help: !text
file: src/operators/combine/edgeCombine.md
diff --git a/src/operators/combine/edgeCombine_lib.glsl b/src/operators/combine/edgeCombine_lib.glsl
new file mode 100644
index 000000000..c2d7500d9
--- /dev/null
+++ b/src/operators/combine/edgeCombine_lib.glsl
@@ -0,0 +1,23 @@
+// from hg_sdf
+
+// produces a cylindical pipe that runs along the intersection.
+// No objects remain, only the pipe. This is not a boolean operator.
+float fOpPipe(float a, float b, float r) {
+ return length(vec2(a, b)) - r;
+}
+
+// first object gets a v-shaped engraving where it intersect the second
+float fOpEngrave(float a, float b, float r) {
+ return max(a, (a + r - abs(b))*sqrt(0.5));
+}
+
+// first object gets a capenter-style groove cut out
+float fOpGroove(float a, float b, float ra, float rb) {
+ return max(a, min(a + ra, rb - abs(b)));
+}
+
+// first object gets a capenter-style tongue attached
+float fOpTongue(float a, float b, float ra, float rb) {
+ return min(a, max(a - ra, abs(b) - rb));
+}
+
diff --git a/src/operators/combine/mergeFields.tox b/src/operators/combine/mergeFields.tox
index 9eeaa85a0..edde526d5 100644
Binary files a/src/operators/combine/mergeFields.tox and b/src/operators/combine/mergeFields.tox differ
diff --git a/src/operators/combine/mergeFields.yaml b/src/operators/combine/mergeFields.yaml
index 89d429dc7..e604ee372 100644
--- a/src/operators/combine/mergeFields.yaml
+++ b/src/operators/combine/mergeFields.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.combine.mergeFields
- opVersion: '9'
+ opVersion: '10'
opStatus: default
opDef: !def
enable: !expr
@@ -17,6 +17,8 @@ opDef: !def
file: src/operators/combine/mergeFields.glsl
name: function
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('mergeFields_lib')
macroTable: !table
file: src/operators/combine/mergeFields_macros.txt
name: macro_exprs
diff --git a/src/operators/combine/mergeFields_lib.glsl b/src/operators/combine/mergeFields_lib.glsl
new file mode 100644
index 000000000..0e2ddb0bb
--- /dev/null
+++ b/src/operators/combine/mergeFields_lib.glsl
@@ -0,0 +1,11 @@
+float extractOrUseAsX(float p) { return p; }
+float extractOrUseAsX(vec4 p) { return p.x; }
+
+float extractOrUseAsY(float p) { return p; }
+float extractOrUseAsY(vec4 p) { return p.y; }
+
+float extractOrUseAsZ(float p) { return p; }
+float extractOrUseAsZ(vec4 p) { return p.z; }
+
+float extractOrUseAsW(float p) { return p; }
+float extractOrUseAsW(vec4 p) { return p.w; }
\ No newline at end of file
diff --git a/src/operators/convert/extrude.glsl b/src/operators/convert/extrude.glsl
index 482043ece..666b3bffd 100644
--- a/src/operators/convert/extrude.glsl
+++ b/src/operators/convert/extrude.glsl
@@ -19,15 +19,19 @@ ReturnT thismap(CoordT p, ContextT ctx) {
#endif
res = inputOp_crossSection(planePos, ctx);
} else {
- #ifdef THIS_HAS_INPUT_heightField
- float h = inputOp_heightField(p, ctx);
- #else
+ #if !defined(THIS_HAS_INPUT_heightField)
float h = THIS_Height;
- #endif
- #ifdef THIS_HAS_INPUT_offsetField
- float o = inputOp_offsetField(p, ctx);
+ #elif defined(inputOp_heightField_COORD_TYPE_vec2)
+ float h = inputOp_heightField(planePos, ctx);
#else
+ float h = inputOp_heightField(p, ctx);
+ #endif
+ #if !defined(THIS_HAS_INPUT_offsetField)
float o = THIS_Offset;
+ #elif defined(inputOp_offsetField_COORD_TYPE_vec2)
+ float o = inputOp_offsetField(planePos, ctx);
+ #else
+ float o = inputOp_offsetField(p, ctx);
#endif
float ratio = map01(axisPos - o, -h/2., h/2.);
if (THIS_Iterationtype == THISTYPE_Iterationtype_ratio) {
diff --git a/src/operators/convert/extrude.tox b/src/operators/convert/extrude.tox
index 337be0610..1b1509622 100644
Binary files a/src/operators/convert/extrude.tox and b/src/operators/convert/extrude.tox differ
diff --git a/src/operators/convert/extrude.yaml b/src/operators/convert/extrude.yaml
index df534453c..c4cca4344 100644
--- a/src/operators/convert/extrude.yaml
+++ b/src/operators/convert/extrude.yaml
@@ -1,30 +1,8 @@
!rop
meta: !meta
opType: raytk.operators.convert.extrude
- opVersion: '21'
+ opVersion: '22'
opStatus: default
-opDef: !def
- enable: true
- typeSpec: !ropTypes
- coordType: !coordT
- Coordtypevec3: true
- contextType: !contextT
- Allcontexttype: true
- returnType: !returnT
- Returntypesdf: true
- function: processedFunction
- lockParams: Uvmode
- paramGroupTable: eval_params
- variableTable: !table
- file: src/operators/convert/extrude_variables.txt
- name: variable_exprs
- evaluate: true
- evalOpts: !evalOpts
- excludeFirstRow: true
- help: !text
- file: src/operators/convert/extrude.md
- name: help
- shortcuts: ext
paramPages:
- !page
name: Filter
@@ -87,6 +65,28 @@ paramPages:
menuLabels:
- None
- Ratio
+opDef: !def
+ enable: true
+ typeSpec: !ropTypes
+ coordType: !coordT
+ Coordtypevec3: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypesdf: true
+ function: processedFunction
+ lockParams: Uvmode
+ paramGroupTable: eval_params
+ variableTable: !table
+ file: src/operators/convert/extrude_variables.txt
+ name: variable_exprs
+ evaluate: true
+ evalOpts: !evalOpts
+ excludeFirstRow: true
+ help: !text
+ file: src/operators/convert/extrude.md
+ name: help
+ shortcuts: ext
inputs:
- !input
Localalias: crossSection
@@ -103,6 +103,7 @@ inputs:
Localalias: heightField
Variables: axispos
coordType: !coordT
+ Coordtypevec2: true
Coordtypevec3: true
contextType: !contextT
Allcontexttype: true
@@ -113,6 +114,7 @@ inputs:
Variables: axispos
Variableinputs: heightField
coordType: !coordT
+ Coordtypevec2: true
Coordtypevec3: true
contextType: !contextT
Allcontexttype: true
diff --git a/src/operators/field/bandField.glsl b/src/operators/field/bandField.glsl
index 795ebfb7a..e9e5ee83e 100644
--- a/src/operators/field/bandField.glsl
+++ b/src/operators/field/bandField.glsl
@@ -37,5 +37,8 @@ ReturnT thismap(CoordT p, ContextT ctx) {
} else {
amt = step(w, q);
}
+ if (IS_TRUE(THIS_Reverse)) {
+ amt = 1.0 - amt;
+ }
return mix(inVal, outVal, amt);
}
\ No newline at end of file
diff --git a/src/operators/field/bandField.tox b/src/operators/field/bandField.tox
index 626b9a019..d8c07af63 100644
Binary files a/src/operators/field/bandField.tox and b/src/operators/field/bandField.tox differ
diff --git a/src/operators/field/bandField.yaml b/src/operators/field/bandField.yaml
index 6afc744e6..406024b4f 100644
--- a/src/operators/field/bandField.yaml
+++ b/src/operators/field/bandField.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.field.bandField
- opVersion: '13'
+ opVersion: '14'
opStatus: default
opDef: !def
enable: !expr
diff --git a/src/operators/field/bandField_params.txt b/src/operators/field/bandField_params.txt
index 6b8bc3782..098137b99 100644
--- a/src/operators/field/bandField_params.txt
+++ b/src/operators/field/bandField_params.txt
@@ -2,4 +2,4 @@ names source handling readOnlyHandling conversion enable
Width Blending Center Repeatsize Repeatshift param runtime macro 1
Insidevalue[rgba] param runtime macro op('insideValue_definition').numRows < 2
Outsidevalue[rgba] param runtime macro op('insideValue_definition').numRows < 2
-Axis Enableblending Enablerepeat param constant 1
+Axis Enableblending Enablerepeat Reverse param constant 1
diff --git a/src/operators/field/hsvColorField.glsl b/src/operators/field/hsvColorField.glsl
index f62c6b460..95e143a91 100644
--- a/src/operators/field/hsvColorField.glsl
+++ b/src/operators/field/hsvColorField.glsl
@@ -3,7 +3,7 @@ ReturnT thismap(CoordT p, ContextT ctx) {
#ifdef THIS_HAS_INPUT_hueField
hsv.x += inputOp_hueField(p, ctx);
#else
- hsv.x += extractOrUseAsX(p);
+ hsv.x += adaptAsFloat(p);
#endif
#ifdef THIS_HAS_INPUT_saturationField
hsv.y *= inputOp_saturationField(p, ctx);
diff --git a/src/operators/field/positionField.glsl b/src/operators/field/positionField.glsl
index be2800495..566b7ba15 100644
--- a/src/operators/field/positionField.glsl
+++ b/src/operators/field/positionField.glsl
@@ -1,5 +1,5 @@
ReturnT thismap(CoordT p, ContextT ctx) {
- vec3 p0;
+ vec4 p0;
POSITION_TYPE_BODY();
ReturnT res;
#ifdef THIS_RETURN_TYPE_float
diff --git a/src/operators/field/positionField.tox b/src/operators/field/positionField.tox
index a8fc3ac95..34901871a 100644
Binary files a/src/operators/field/positionField.tox and b/src/operators/field/positionField.tox differ
diff --git a/src/operators/field/positionField.yaml b/src/operators/field/positionField.yaml
index d08e268fb..00dba574d 100644
--- a/src/operators/field/positionField.yaml
+++ b/src/operators/field/positionField.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.field.positionField
- opVersion: '17'
+ opVersion: '19'
opStatus: default
opDef: !def
enable: true
diff --git a/src/operators/field/positionField_positionTypes.txt b/src/operators/field/positionField_positionTypes.txt
index d87ab5a3f..76fc6d811 100644
--- a/src/operators/field/positionField_positionTypes.txt
+++ b/src/operators/field/positionField_positionTypes.txt
@@ -1,3 +1,5 @@
name label code
-local Local Position p0 = adaptAsVec3(p);
-global Global Position p0 = adaptAsVec3(ctx.globalPos);
+local Local Position p0 = adaptAsVec4(p);
+global Global Position p0 = adaptAsVec4(ctx.globalPos);
+pixeluv Pixel UV Coordinate p0 = adaptAsVec4(vUV);
+pixelcoord Pixel Coordinate p0 = adaptAsVec4(vUV.st * uTDOutputInfo.res.zw);
diff --git a/src/operators/filter/applyTransform.glsl b/src/operators/filter/applyTransform.glsl
new file mode 100644
index 000000000..91681f6ca
--- /dev/null
+++ b/src/operators/filter/applyTransform.glsl
@@ -0,0 +1,12 @@
+void THIS_transform(inout vec4 q, CoordT p, inout ContextT ctx) {
+ if (IS_FALSE(THIS_Enable)) return;
+ q = adaptAsVec4(inputOp_transform(THIS_asCoordT(q), ctx));
+}
+
+ReturnT thismap(CoordT p, ContextT ctx) {
+ if (IS_FALSE(THIS_Enable)) { return inputOp1(p, ctx); }
+ vec4 q;
+ ReturnT res;
+ APPLY_TO_TARGET();
+ return res;
+}
\ No newline at end of file
diff --git a/src/operators/filter/applyTransform.tox b/src/operators/filter/applyTransform.tox
new file mode 100644
index 000000000..ed81b302c
Binary files /dev/null and b/src/operators/filter/applyTransform.tox differ
diff --git a/src/operators/filter/applyTransform.yaml b/src/operators/filter/applyTransform.yaml
new file mode 100644
index 000000000..09336609d
--- /dev/null
+++ b/src/operators/filter/applyTransform.yaml
@@ -0,0 +1,57 @@
+!rop
+meta: !meta
+ opType: raytk.operators.filter.applyTransform
+ opVersion: '0'
+ opStatus: beta
+opDef: !def
+ enable: !expr
+ expr: op('..').par.Enable
+ useRuntimeBypass: true
+ typeSpec: !ropTypes
+ coordType: !coordT
+ Allcoordtype: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Allreturntype: true
+ function: !text
+ file: src/operators/filter/applyTransform.glsl
+ name: function
+ displayCategory: Transform
+inputs:
+- !input
+ Variables: '*'
+ Variableinputs: '*'
+ Required: true
+ coordType: !coordT
+ Allcoordtype: true
+ contextType: !contextT
+ Allcontexttype: !expr
+ expr: op('targetInfo')[1, 'contextType'] == '*'
+ Contexttypematerialcontext: !expr
+ expr: op('targetInfo')[1, 'contextType'] == 'MaterialContext'
+ returnType: !returnT
+ Allreturntype: !expr
+ expr: op('targetInfo')[1, 'returnType'] == '*'
+ Returntypesdf: !expr
+ expr: op('targetInfo')[1, 'returnType'] == 'Sdf'
+ Returntypevec4: !expr
+ expr: op('targetInfo')[1, 'returnType'] == 'vec4'
+- !input
+ Localalias: transform
+ Variables: '*'
+ Required: true
+ coordType: !coordT
+ Allcoordtype: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypevec4: true
+elements:
+- !opElement
+ name: transformTarget
+ elementType: transformTarget
+ params:
+ Targetparam: Target
+ Applyfunction: THIS_transform
+ Bodycodeplaceholder: APPLY_TO_TARGET();
diff --git a/src/operators/filter/circularRepeat.tox b/src/operators/filter/circularRepeat.tox
index f756672db..cbb457dd2 100644
Binary files a/src/operators/filter/circularRepeat.tox and b/src/operators/filter/circularRepeat.tox differ
diff --git a/src/operators/filter/circularRepeat.yaml b/src/operators/filter/circularRepeat.yaml
index 73c9e0fcf..b053b437e 100644
--- a/src/operators/filter/circularRepeat.yaml
+++ b/src/operators/filter/circularRepeat.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.filter.circularRepeat
- opVersion: '4'
+ opVersion: '5'
opStatus: beta
opDef: !def
enable: !expr
@@ -41,4 +41,4 @@ inputs:
contextType: !contextT
Allcontexttype: true
returnType: !returnT
- Allreturntype: true
+ Returntypesdf: true
diff --git a/src/operators/filter/fold.tox b/src/operators/filter/fold.tox
index ba0c5d51a..9643d2cbc 100644
Binary files a/src/operators/filter/fold.tox and b/src/operators/filter/fold.tox differ
diff --git a/src/operators/filter/fold.yaml b/src/operators/filter/fold.yaml
index 3af1eef15..e5fa727fd 100644
--- a/src/operators/filter/fold.yaml
+++ b/src/operators/filter/fold.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.filter.fold
- opVersion: '12'
+ opVersion: '13'
opStatus: default
paramPages:
- !page
@@ -49,6 +49,8 @@ opDef: !def
function: !text
file: src/operators/filter/fold.glsl
name: function
+ libraryNames: !expr
+ expr: op('fold_lib')
generatedMacroTables: expr_macros
displayCategory: Transform
inputs:
diff --git a/src/operators/filter/fold_lib.glsl b/src/operators/filter/fold_lib.glsl
new file mode 100644
index 000000000..b59ae7004
--- /dev/null
+++ b/src/operators/filter/fold_lib.glsl
@@ -0,0 +1,16 @@
+vec3 boxFold(vec3 p, float r) {
+ return clamp(p.xyz, -r, r) * 2.0 - p;
+}
+
+vec3 mengerFold(vec3 p) {
+ float a = min(p.x - p.y, 0.0);
+ p.x -= a;
+ p.y += a;
+ a = min(p.x - p.z, 0.0);
+ p.x -= a;
+ p.z += a;
+ a = min(p.y - p.z, 0.0);
+ p.y -= a;
+ p.z += a;
+ return p;
+}
\ No newline at end of file
diff --git a/src/operators/filter/index.tox b/src/operators/filter/index.tox
index 1ec189cb5..dd0f5b39e 100644
Binary files a/src/operators/filter/index.tox and b/src/operators/filter/index.tox differ
diff --git a/src/operators/filter/lookAtRotate.tox b/src/operators/filter/lookAtRotate.tox
index 911791823..c7e33d2e2 100644
Binary files a/src/operators/filter/lookAtRotate.tox and b/src/operators/filter/lookAtRotate.tox differ
diff --git a/src/operators/filter/lookAtRotate.yaml b/src/operators/filter/lookAtRotate.yaml
index 2352a344b..d27e4def7 100644
--- a/src/operators/filter/lookAtRotate.yaml
+++ b/src/operators/filter/lookAtRotate.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.filter.lookAtRotate
- opVersion: '3'
+ opVersion: '4'
opStatus: beta
opDef: !def
enable: !expr
@@ -18,6 +18,8 @@ opDef: !def
file: src/operators/filter/lookAtRotate.glsl
name: function
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('lookAtRotate_lib')
displayCategory: Transform
inputs:
- !input
diff --git a/src/operators/filter/lookAtRotate_lib.glsl b/src/operators/filter/lookAtRotate_lib.glsl
new file mode 100644
index 000000000..d5583a455
--- /dev/null
+++ b/src/operators/filter/lookAtRotate_lib.glsl
@@ -0,0 +1,9 @@
+// https://github.com/glslify/glsl-look-at/
+mat3 calcLookAtMatrix(vec3 origin, vec3 target, float roll) {
+ vec3 rr = vec3(sin(roll), cos(roll), 0.0);
+ vec3 ww = normalize(target - origin);
+ vec3 uu = normalize(cross(ww, rr));
+ vec3 vv = normalize(cross(uu, ww));
+
+ return mat3(uu, vv, ww);
+}
diff --git a/src/operators/filter/magnet.tox b/src/operators/filter/magnet.tox
index 4dabda6ab..3097ed109 100644
Binary files a/src/operators/filter/magnet.tox and b/src/operators/filter/magnet.tox differ
diff --git a/src/operators/filter/magnet.yaml b/src/operators/filter/magnet.yaml
index 7da088eca..7c16844bb 100644
--- a/src/operators/filter/magnet.yaml
+++ b/src/operators/filter/magnet.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.filter.magnet
- opVersion: '13'
+ opVersion: '14'
opStatus: default
opDef: !def
enable: !expr
diff --git a/src/operators/filter/magnet_params.txt b/src/operators/filter/magnet_params.txt
index 1a6b33bfe..6614fd5d4 100644
--- a/src/operators/filter/magnet_params.txt
+++ b/src/operators/filter/magnet_params.txt
@@ -1,2 +1,3 @@
names source handling readOnlyHandling conversion enable
-Center[xyz] Translate[xyz] Scale[xyz] Rotate[xyz] Amount Radius Fade param runtime macro 1
+Center[xyz] Translate[xyz] Scale[xyz] Amount Radius Fade param runtime macro 1
+Rotate[xyz] param runtime macro angle 1
diff --git a/src/operators/filter/modifyDistance.glsl b/src/operators/filter/modifyDistance.glsl
new file mode 100644
index 000000000..f6c3ed48b
--- /dev/null
+++ b/src/operators/filter/modifyDistance.glsl
@@ -0,0 +1,17 @@
+ReturnT thismap(CoordT p, ContextT ctx) {
+ Sdf res = inputOp1(p, ctx);
+ if (IS_FALSE(THIS_Enable)) {
+ return res;
+ }
+ #ifdef THIS_EXPOSE_sdf
+ THIS_sdf = res;
+ #endif
+ float d = res.x;
+ #ifdef THIS_EXPOSE_dist
+ THIS_dist = d;
+ #endif
+ float val = adaptAsFloat(inputOp_value(p, ctx));
+ BODY();
+ res.x = mix(res.x, d, THIS_Mix);
+ return res;
+}
\ No newline at end of file
diff --git a/src/operators/filter/modifyDistance.tox b/src/operators/filter/modifyDistance.tox
new file mode 100644
index 000000000..c5f23bfe9
Binary files /dev/null and b/src/operators/filter/modifyDistance.tox differ
diff --git a/src/operators/filter/modifyDistance.yaml b/src/operators/filter/modifyDistance.yaml
new file mode 100644
index 000000000..f10f47bd2
--- /dev/null
+++ b/src/operators/filter/modifyDistance.yaml
@@ -0,0 +1,64 @@
+!rop
+meta: !meta
+ opType: raytk.operators.filter.modifyDistance
+ opVersion: '1'
+ opStatus: beta
+opDef: !def
+ enable: !expr
+ expr: op('..').par.Enable
+ useRuntimeBypass: true
+ typeSpec: !ropTypes
+ coordType: !coordT
+ Allcoordtype: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypesdf: true
+ function: !text
+ file: src/operators/filter/modifyDistance.glsl
+ name: function
+ paramGroupTable: eval_params
+ variableTable: !table
+ file: src/operators/filter/modifyDistance_variables.txt
+ name: variable_exprs
+ evaluate: true
+ evalOpts: !evalOpts
+ excludeFirstRow: true
+ cols: enable
+ displayCategory: Surface Attributes
+inputs:
+- !input
+ Required: true
+ coordType: !coordT
+ Allcoordtype: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Allreturntype: true
+- !input
+ Localalias: value
+ Variableinputs: '*'
+ Required: true
+ coordType: !coordT
+ Allcoordtype: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypesdf: true
+ Returntypefloat: true
+elements:
+- !opElement
+ name: codeSwitcher_Mode
+ elementType: codeSwitcher
+ params:
+ Elementroot: ''
+ Table: !table
+ file: src/operators/filter/modifyDistance_modes.txt
+ name: modes
+ Param: Mode
+ Autoupdateparams: true
+ Manageparamstates: false
+ Alwaysincludeallparams: false
+ Switchmode: autoconst
+ Indexexpr: ''
+ Placeholder: BODY();
diff --git a/src/operators/filter/modifyDistance_modes.txt b/src/operators/filter/modifyDistance_modes.txt
new file mode 100644
index 000000000..dfdcb547a
--- /dev/null
+++ b/src/operators/filter/modifyDistance_modes.txt
@@ -0,0 +1,4 @@
+name label code
+add Add d += val
+mul Multiply d *= val
+replace Replace d = val
diff --git a/src/operators/filter/modifyDistance_params.txt b/src/operators/filter/modifyDistance_params.txt
new file mode 100644
index 000000000..15ad88c9d
--- /dev/null
+++ b/src/operators/filter/modifyDistance_params.txt
@@ -0,0 +1,2 @@
+names source handling readOnlyHandling conversion enable
+Mix param runtime macro 1
diff --git a/src/operators/filter/modifyDistance_variables.txt b/src/operators/filter/modifyDistance_variables.txt
new file mode 100644
index 000000000..b259f71da
--- /dev/null
+++ b/src/operators/filter/modifyDistance_variables.txt
@@ -0,0 +1,3 @@
+name label dataType enable macros
+sdf SDF Surface Sdf 1
+dist SDF Distance float 1
diff --git a/src/operators/filter/onion.glsl b/src/operators/filter/onion.glsl
index 282fbb775..5ed150f3d 100644
--- a/src/operators/filter/onion.glsl
+++ b/src/operators/filter/onion.glsl
@@ -16,8 +16,12 @@ ReturnT thismap(CoordT p, ContextT ctx) {
for (int i = 0; i < n; i++) {
val = abs(val) - th / float(i + 1);
}
- SIDE_BODY();
- setFromFloat(res, val);
+ SIDE_BODY();
+ #if defined(THIS_RETURN_TYPE_Sdf)
+ res.x = val;
+ #elif defined(THIS_RETURN_TYPE_float)
+ res = val;
+ #endif
}
return res;
}
\ No newline at end of file
diff --git a/src/operators/filter/onion.tox b/src/operators/filter/onion.tox
index 0e8fb9e51..3853ec2ea 100644
Binary files a/src/operators/filter/onion.tox and b/src/operators/filter/onion.tox differ
diff --git a/src/operators/filter/onion.yaml b/src/operators/filter/onion.yaml
index ff9753fba..0c43a3be0 100644
--- a/src/operators/filter/onion.yaml
+++ b/src/operators/filter/onion.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.filter.onion
- opVersion: '17'
+ opVersion: '18'
opStatus: default
paramPages:
- !page
diff --git a/src/operators/filter/rectangleRepeat.glsl b/src/operators/filter/rectangleRepeat.glsl
new file mode 100644
index 000000000..2b40e5538
--- /dev/null
+++ b/src/operators/filter/rectangleRepeat.glsl
@@ -0,0 +1,38 @@
+// Rectangle Repetitions by iq
+// https://www.shadertoy.com/view/ctjyWy
+
+ReturnT thismap(CoordT p, ContextT ctx) {
+ if (IS_FALSE(THIS_Enable)) {
+ return inputOp1(p, ctx);
+ }
+ vec2 q;
+ #ifdef THIS_COORD_TYPE_vec2
+ q = p;
+ #else
+ switch (THIS_Plane) {
+ case THISTYPE_Plane_xy: q = p.xy; break;
+ case THISTYPE_Plane_yz: q = p.yz; break;
+ case THISTYPE_Plane_zx: q = p.zx; break;
+ }
+ #endif
+
+ float spacing = THIS_Spacing;
+ ivec2 size = ivec2(THIS_Gridsize);
+
+ q = abs(q/spacing) - (vec2(size)*0.5-0.5);
+ q = (q.xm ) return x;
float a = 2.0*n - m;
float b = 2.0*m - 3.0*n;
diff --git a/src/operators/function/almostIdentityFn.tox b/src/operators/function/almostIdentityFn.tox
index e3805785a..487aff5fb 100644
Binary files a/src/operators/function/almostIdentityFn.tox and b/src/operators/function/almostIdentityFn.tox differ
diff --git a/src/operators/function/almostIdentityFn.yaml b/src/operators/function/almostIdentityFn.yaml
index b7f523a53..4ca0c8616 100644
--- a/src/operators/function/almostIdentityFn.yaml
+++ b/src/operators/function/almostIdentityFn.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.function.almostIdentityFn
- opVersion: '6'
+ opVersion: '7'
opStatus: default
opDef: !def
enable: true
@@ -19,3 +19,20 @@ opDef: !def
help: !text
file: src/operators/function/almostIdentityFn.md
name: help
+inputs:
+- !input
+ Localalias: thresholdField
+ coordType: !coordT
+ Coordtypefloat: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypefloat: true
+- !input
+ Localalias: baseValueField
+ coordType: !coordT
+ Coordtypefloat: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypefloat: true
diff --git a/src/operators/function/almostIdentityFn_params.txt b/src/operators/function/almostIdentityFn_params.txt
index b36054b48..c62a11af7 100644
--- a/src/operators/function/almostIdentityFn_params.txt
+++ b/src/operators/function/almostIdentityFn_params.txt
@@ -1,2 +1,3 @@
names source handling readOnlyHandling conversion enable
-Threshold Basevalue param runtime macro 1
+Threshold param runtime macro op('threshold_definition').numRows < 2
+Basevalue param runtime macro op('baseValue_definition').numRows < 2
diff --git a/src/operators/function/cubicPulseFn.glsl b/src/operators/function/cubicPulseFn.glsl
index 3928f47f3..10eaebd84 100644
--- a/src/operators/function/cubicPulseFn.glsl
+++ b/src/operators/function/cubicPulseFn.glsl
@@ -1,7 +1,15 @@
ReturnT thismap(CoordT p, ContextT ctx) {
float x = p;
+ #ifdef THIS_HAS_INPUT_phaseField
+ float c = inputOp_phaseField(p, ctx);
+ #else
float c = THIS_Phase;
+ #endif
+ #ifdef THIS_HAS_INPUT_widthField
+ float w = inputOp_widthField(p, ctx);
+ #else
float w = THIS_Width;
+ #endif
x = abs(x - c);
if (x>w) return 0.0;
x /= w;
diff --git a/src/operators/function/cubicPulseFn.tox b/src/operators/function/cubicPulseFn.tox
index a6d2504ff..62a59ae9d 100644
Binary files a/src/operators/function/cubicPulseFn.tox and b/src/operators/function/cubicPulseFn.tox differ
diff --git a/src/operators/function/cubicPulseFn.yaml b/src/operators/function/cubicPulseFn.yaml
index de1a3a332..285be57d7 100644
--- a/src/operators/function/cubicPulseFn.yaml
+++ b/src/operators/function/cubicPulseFn.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.function.cubicPulseFn
- opVersion: '3'
+ opVersion: '4'
opStatus: default
opDef: !def
enable: true
@@ -16,3 +16,20 @@ opDef: !def
file: src/operators/function/cubicPulseFn.glsl
name: functionTemplate
paramGroupTable: eval_params
+inputs:
+- !input
+ Localalias: widthField
+ coordType: !coordT
+ Coordtypefloat: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypefloat: true
+- !input
+ Localalias: phaseField
+ coordType: !coordT
+ Coordtypefloat: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypefloat: true
diff --git a/src/operators/function/cubicPulseFn_params.txt b/src/operators/function/cubicPulseFn_params.txt
index 808282828..af9b151d1 100644
--- a/src/operators/function/cubicPulseFn_params.txt
+++ b/src/operators/function/cubicPulseFn_params.txt
@@ -1,2 +1,3 @@
names source handling readOnlyHandling conversion enable
-Width Phase param runtime macro 1
+Width param runtime macro op('width_definition').numRows < 2
+Phase param runtime macro op('phase_definition').numRows < 2
diff --git a/src/operators/function/easeFn.glsl b/src/operators/function/easeFn.glsl
index f1d45ace6..c81af2f08 100644
--- a/src/operators/function/easeFn.glsl
+++ b/src/operators/function/easeFn.glsl
@@ -1,6 +1,11 @@
ReturnT thismap(CoordT p, ContextT ctx) {
float x = p;
+ #ifdef THIS_HAS_INPUT_exponentField
+ float a = inputOp_exponentField(p, ctx);
+ #else
float a = THIS_Exponent;
+ #endif
+
const float epsilon = 0.00001;
const float min_param_a = 0.0 + epsilon;
const float max_param_a = 1.0 - epsilon;
diff --git a/src/operators/function/easeFn.tox b/src/operators/function/easeFn.tox
index 40448fb80..8b99cbb0f 100644
Binary files a/src/operators/function/easeFn.tox and b/src/operators/function/easeFn.tox differ
diff --git a/src/operators/function/easeFn.yaml b/src/operators/function/easeFn.yaml
index 5f53b1813..e60e5e3c5 100644
--- a/src/operators/function/easeFn.yaml
+++ b/src/operators/function/easeFn.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.function.easeFn
- opVersion: '4'
+ opVersion: '5'
opStatus: default
opDef: !def
enable: true
@@ -16,3 +16,12 @@ opDef: !def
file: src/operators/function/easeFn.glsl
name: functionTemplate
paramGroupTable: eval_params
+inputs:
+- !input
+ Localalias: exponentField
+ coordType: !coordT
+ Coordtypefloat: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypefloat: true
diff --git a/src/operators/function/easeFn_params.txt b/src/operators/function/easeFn_params.txt
index ac6a11be1..a0d3e7f39 100644
--- a/src/operators/function/easeFn_params.txt
+++ b/src/operators/function/easeFn_params.txt
@@ -1,2 +1,2 @@
names source handling readOnlyHandling conversion enable
-Exponent param runtime macro 1
+Exponent param runtime macro op('exponent_definition').numRows < 2
diff --git a/src/operators/function/flipFn.md b/src/operators/function/flipFn.md
index 11eb4bbea..0f213e6df 100644
--- a/src/operators/function/flipFn.md
+++ b/src/operators/function/flipFn.md
@@ -8,6 +8,8 @@ Function that flips its input in one of several different modes.
* `fliprange`: Negates the input function's return value, flipping the y axis of a function graph across the x axis.
* `mirrorposdomain`: Mirrors the coordinate so only the positive half is used, reflecting the positive side of a function graph across the y axis replacing the negative side.
* `flipnegdomain`: Mirrors the coordinate so only the positive half is used, but also flips the return value when on the negative side, reflecting the positive side of a function graph across the y axis but then also flipping that side upside down.
+ * `flipdomain01`: Flips the x axis in the 0..1 range so that what used to be x=0 is now x=1 and what used to be x=1 is now x=0.
+ * `fliprange01`: Flips the y (value) axis in the 0..1 range so that what used to be y=0 is now y=1 and what used to be y=1 is now y=0.
* `Returntype`
* `Sdf`
* `float`
diff --git a/src/operators/function/flipFn.tox b/src/operators/function/flipFn.tox
index 6bf23049c..4f996a3a7 100644
Binary files a/src/operators/function/flipFn.tox and b/src/operators/function/flipFn.tox differ
diff --git a/src/operators/function/flipFn.yaml b/src/operators/function/flipFn.yaml
index 8a1339147..0457f16a9 100644
--- a/src/operators/function/flipFn.yaml
+++ b/src/operators/function/flipFn.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.function.flipFn
- opVersion: '9'
+ opVersion: '10'
opStatus: default
opDef: !def
enable: !expr
diff --git a/src/operators/function/flipFn_flipTypes.txt b/src/operators/function/flipFn_flipTypes.txt
index 1d5827df6..69e947b16 100644
--- a/src/operators/function/flipFn_flipTypes.txt
+++ b/src/operators/function/flipFn_flipTypes.txt
@@ -3,3 +3,5 @@ flipdomain Flip Domain res = inputOp1(-p, ctx);
fliprange Flip Range res = -inputOp1(p, ctx);
mirrorposdomain Mirror Positive Domain res = inputOp1(abs(p), ctx);
flipnegdomain Flip Negative Domain res = sign(p) * inputOp1(abs(p), ctx);
+flipdomain01 Flip 0-1 Domain res = inputOp1(1 - p, ctx);
+fliprange01 Flip 0-1 Range res = 1 - inputOp1(p, ctx);
diff --git a/src/operators/function/gainFn.glsl b/src/operators/function/gainFn.glsl
index 8137b8525..54a2167e9 100644
--- a/src/operators/function/gainFn.glsl
+++ b/src/operators/function/gainFn.glsl
@@ -1,5 +1,9 @@
ReturnT thismap(CoordT p, ContextT ctx) {
+ #ifdef THIS_HAS_INPUT_exponentField
+ float k = inputOp_exponentField(p, ctx);
+ #else
float k = THIS_Exponent;
+ #endif
float a = 0.5*pow(2.0*((p<0.5)?p:1.0-p), k);
return (p<0.5)?a:1.0-a;
}
\ No newline at end of file
diff --git a/src/operators/function/gainFn.tox b/src/operators/function/gainFn.tox
index 1b9acfe09..65785b37b 100644
Binary files a/src/operators/function/gainFn.tox and b/src/operators/function/gainFn.tox differ
diff --git a/src/operators/function/gainFn.yaml b/src/operators/function/gainFn.yaml
index fa12a0627..a98169598 100644
--- a/src/operators/function/gainFn.yaml
+++ b/src/operators/function/gainFn.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.function.gainFn
- opVersion: '4'
+ opVersion: '5'
opStatus: default
opDef: !def
enable: true
@@ -19,3 +19,12 @@ opDef: !def
help: !text
file: src/operators/function/gainFn.md
name: help
+inputs:
+- !input
+ Localalias: exponentField
+ coordType: !coordT
+ Coordtypefloat: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypefloat: true
diff --git a/src/operators/function/gainFn_params.txt b/src/operators/function/gainFn_params.txt
index ac6a11be1..a0d3e7f39 100644
--- a/src/operators/function/gainFn_params.txt
+++ b/src/operators/function/gainFn_params.txt
@@ -1,2 +1,2 @@
names source handling readOnlyHandling conversion enable
-Exponent param runtime macro 1
+Exponent param runtime macro op('exponent_definition').numRows < 2
diff --git a/src/operators/function/parabolaFn.glsl b/src/operators/function/parabolaFn.glsl
index 3490ee4a4..35bdeee81 100644
--- a/src/operators/function/parabolaFn.glsl
+++ b/src/operators/function/parabolaFn.glsl
@@ -1,3 +1,8 @@
ReturnT thismap(CoordT p, ContextT ctx) {
- return pow(4.0*p*(1.0-p), THIS_Exponent);
+ #ifdef THIS_HAS_INPUT_exponentField
+ float k = inputOp_exponentField(p, ctx);
+ #else
+ float k = THIS_Exponent;
+ #endif
+ return pow(4.0*p*(1.0-p), k);
}
\ No newline at end of file
diff --git a/src/operators/function/parabolaFn.tox b/src/operators/function/parabolaFn.tox
index f2553ac13..76688844d 100644
Binary files a/src/operators/function/parabolaFn.tox and b/src/operators/function/parabolaFn.tox differ
diff --git a/src/operators/function/parabolaFn.yaml b/src/operators/function/parabolaFn.yaml
index 9acb9f8c3..2cc3a1202 100644
--- a/src/operators/function/parabolaFn.yaml
+++ b/src/operators/function/parabolaFn.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.function.parabolaFn
- opVersion: '3'
+ opVersion: '4'
opStatus: default
opDef: !def
enable: true
@@ -16,3 +16,12 @@ opDef: !def
file: src/operators/function/parabolaFn.glsl
name: functionTemplate
paramGroupTable: eval_params
+inputs:
+- !input
+ Localalias: exponentField
+ coordType: !coordT
+ Coordtypefloat: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypefloat: true
diff --git a/src/operators/function/parabolaFn_params.txt b/src/operators/function/parabolaFn_params.txt
index ac6a11be1..a0d3e7f39 100644
--- a/src/operators/function/parabolaFn_params.txt
+++ b/src/operators/function/parabolaFn_params.txt
@@ -1,2 +1,2 @@
names source handling readOnlyHandling conversion enable
-Exponent param runtime macro 1
+Exponent param runtime macro op('exponent_definition').numRows < 2
diff --git a/src/operators/opChips.txt b/src/operators/opChips.txt
index 89927c9d3..28e990c5e 100644
--- a/src/operators/opChips.txt
+++ b/src/operators/opChips.txt
@@ -1,19 +1,14 @@
name chip
-assignAttribute updated
-boxSdf updated
-fisheyeCamera updated
-getAttribute updated
-isoscelesTriangleSdf2d new
-knife updated
-limitField updated
-modulo1D updated
-modulo2D updated
-modulo3D updated
-modularMat updated
-pausingWaveFn updated
-petalSdf updated
-roundedRectangleSdf2d updated
-texture1dField new
-variableList new
-vesicaSegmentSdf new
-vesicaSegmentSdf2d new
\ No newline at end of file
+applyTransform new
+modifyDistance new
+rectangleRepeat new
+almostIdentityFn updated
+bandField updated
+cubicPulseFn updated
+easeFn updated
+extrude updated
+flipFn updated
+gainFn updated
+parabolaFn updated
+positionField updated
+prismSdf updated
diff --git a/src/operators/output/experimentalRaymarchRender3D.tox b/src/operators/output/experimentalRaymarchRender3D.tox
index b139e2584..78a0bdd0b 100644
Binary files a/src/operators/output/experimentalRaymarchRender3D.tox and b/src/operators/output/experimentalRaymarchRender3D.tox differ
diff --git a/src/operators/output/experimentalRaymarchRender3D.yaml b/src/operators/output/experimentalRaymarchRender3D.yaml
index 7f84b6a8a..8798a9bb1 100644
--- a/src/operators/output/experimentalRaymarchRender3D.yaml
+++ b/src/operators/output/experimentalRaymarchRender3D.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.output.experimentalRaymarchRender3D
- opVersion: '7'
+ opVersion: '9'
opStatus: alpha
opDef: !def
enable: true
diff --git a/src/operators/output/fieldRender.tox b/src/operators/output/fieldRender.tox
index e501ca40a..c09c260f6 100644
Binary files a/src/operators/output/fieldRender.tox and b/src/operators/output/fieldRender.tox differ
diff --git a/src/operators/output/fieldRender.yaml b/src/operators/output/fieldRender.yaml
index bfafbe799..500c6764c 100644
--- a/src/operators/output/fieldRender.yaml
+++ b/src/operators/output/fieldRender.yaml
@@ -1,5 +1,5 @@
!rcomp
meta: !meta
opType: raytk.operators.output.fieldRender
- opVersion: '12'
+ opVersion: '13'
opStatus: beta
diff --git a/src/operators/output/functionGraphRender.tox b/src/operators/output/functionGraphRender.tox
index cc36a3e70..8d1874a00 100644
Binary files a/src/operators/output/functionGraphRender.tox and b/src/operators/output/functionGraphRender.tox differ
diff --git a/src/operators/output/functionGraphRender.yaml b/src/operators/output/functionGraphRender.yaml
index 8540efe2e..80e1d33dc 100644
--- a/src/operators/output/functionGraphRender.yaml
+++ b/src/operators/output/functionGraphRender.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.output.functionGraphRender
- opVersion: '30'
+ opVersion: '32'
opStatus: default
paramPages:
- !page
diff --git a/src/operators/output/pointMapRender.tox b/src/operators/output/pointMapRender.tox
index d6b02732c..4a4d23b22 100644
Binary files a/src/operators/output/pointMapRender.tox and b/src/operators/output/pointMapRender.tox differ
diff --git a/src/operators/output/pointMapRender.yaml b/src/operators/output/pointMapRender.yaml
index 27c4709d3..9ead949b5 100644
--- a/src/operators/output/pointMapRender.yaml
+++ b/src/operators/output/pointMapRender.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.output.pointMapRender
- opVersion: '66'
+ opVersion: '69'
opStatus: default
opDef: !def
enable: true
diff --git a/src/operators/output/pointMapRender_returnTypeReplacements.txt b/src/operators/output/pointMapRender_returnTypeReplacements.txt
new file mode 100644
index 000000000..5bcb3a50e
--- /dev/null
+++ b/src/operators/output/pointMapRender_returnTypeReplacements.txt
@@ -0,0 +1,5 @@
+before after
+float vec4 Sdf Sdf
+float vec4 vec4
+float Sdf Sdf
+vec4 Sdf Sdf
diff --git a/src/operators/output/raymarchRender3D.tox b/src/operators/output/raymarchRender3D.tox
index 96caf8c66..aeca6f2a7 100644
Binary files a/src/operators/output/raymarchRender3D.tox and b/src/operators/output/raymarchRender3D.tox differ
diff --git a/src/operators/output/raymarchRender3D.yaml b/src/operators/output/raymarchRender3D.yaml
index cc5427f1f..c3f61d732 100644
--- a/src/operators/output/raymarchRender3D.yaml
+++ b/src/operators/output/raymarchRender3D.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.output.raymarchRender3D
- opVersion: '132'
+ opVersion: '134'
opStatus: default
opDef: !def
enable: true
diff --git a/src/operators/output/render2D.tox b/src/operators/output/render2D.tox
index 1d63e8375..ed598e0b9 100644
Binary files a/src/operators/output/render2D.tox and b/src/operators/output/render2D.tox differ
diff --git a/src/operators/output/render2D.yaml b/src/operators/output/render2D.yaml
index 02d8c0314..eefa01d87 100644
--- a/src/operators/output/render2D.yaml
+++ b/src/operators/output/render2D.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.output.render2D
- opVersion: '70'
+ opVersion: '72'
opStatus: default
opDef: !def
enable: true
diff --git a/src/operators/post/worldPosMap.tox b/src/operators/post/worldPosMap.tox
index c6345f921..1022c78a6 100644
Binary files a/src/operators/post/worldPosMap.tox and b/src/operators/post/worldPosMap.tox differ
diff --git a/src/operators/post/worldPosMap.yaml b/src/operators/post/worldPosMap.yaml
new file mode 100644
index 000000000..36ebdef37
--- /dev/null
+++ b/src/operators/post/worldPosMap.yaml
@@ -0,0 +1,5 @@
+!rcomp
+meta: !meta
+ opType: raytk.operators.post.worldPosMap
+ opVersion: '2'
+ opStatus: default
diff --git a/src/operators/sdf/archSdf.tox b/src/operators/sdf/archSdf.tox
index 7bdfc0621..f7d6a7a99 100644
Binary files a/src/operators/sdf/archSdf.tox and b/src/operators/sdf/archSdf.tox differ
diff --git a/src/operators/sdf/archSdf.yaml b/src/operators/sdf/archSdf.yaml
index f69d1148e..0d726181c 100644
--- a/src/operators/sdf/archSdf.yaml
+++ b/src/operators/sdf/archSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.archSdf
- opVersion: '7'
+ opVersion: '8'
opStatus: beta
opDef: !def
enable: true
@@ -16,6 +16,8 @@ opDef: !def
file: src/operators/sdf/archSdf.glsl
name: function
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('roundedRectangleSdf2d_lib')
inputs:
- !input
Localalias: heightField
diff --git a/src/operators/sdf/boxSdf.tox b/src/operators/sdf/boxSdf.tox
index 1bafa263a..01ea19208 100644
Binary files a/src/operators/sdf/boxSdf.tox and b/src/operators/sdf/boxSdf.tox differ
diff --git a/src/operators/sdf/boxSdf.yaml b/src/operators/sdf/boxSdf.yaml
index 8b43af9da..f128e1852 100644
--- a/src/operators/sdf/boxSdf.yaml
+++ b/src/operators/sdf/boxSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.boxSdf
- opVersion: '23'
+ opVersion: '24'
opStatus: default
opDef: !def
enable: true
@@ -14,6 +14,8 @@ opDef: !def
Returntypesdf: true
function: function
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('boxSdf_lib')
variableTable: !table
file: src/operators/sdf/boxSdf_variables.txt
name: variable_exprs
diff --git a/src/operators/sdf/boxSdf_lib.glsl b/src/operators/sdf/boxSdf_lib.glsl
new file mode 100644
index 000000000..61727fecd
--- /dev/null
+++ b/src/operators/sdf/boxSdf_lib.glsl
@@ -0,0 +1,28 @@
+// https://www.shadertoy.com/view/3djBDh
+//the following functions assume that p is inside the cube of radius 1 centered at the origin
+//closest vertex of the cube to p
+vec3 nearestVertex(vec3 p) {
+ return max(sign(p), vec3(0))*2.-1.;
+}
+//closest face of the cube to p
+vec3 nearestFace(vec3 p) {
+ vec3 ap = abs(p);
+ if (ap.x>=max(ap.z, ap.y)) return vec3(sign(p.x), 0., 0.);
+ if (ap.y>=max(ap.z, ap.x)) return vec3(0., sign(p.y), 0.);
+ if (ap.z>=max(ap.x, ap.y)) return vec3(0., 0., sign(p.z));
+ return vec3(0);
+}
+//closest edge of the cube to p
+vec3 nearestEdge(vec3 p) {
+ vec3 mask = vec3(1)-abs(nearestFace(p));
+ vec3 v = nearestVertex(p);
+ vec3 a = v*mask.zxy, b = v*mask.yzx;
+ return distance(p, a) p2.y) return vec2((p.x < 0.) ? -1. : 1., 0.);
+ else return vec2(0., (p.y < 0.) ? -1. : 1.);
+}
diff --git a/src/operators/sdf/chamferBoxSdf.tox b/src/operators/sdf/chamferBoxSdf.tox
index 9bf29bf5e..c95c793e5 100644
Binary files a/src/operators/sdf/chamferBoxSdf.tox and b/src/operators/sdf/chamferBoxSdf.tox differ
diff --git a/src/operators/sdf/chamferBoxSdf.yaml b/src/operators/sdf/chamferBoxSdf.yaml
index 319be9859..ef39571dd 100644
--- a/src/operators/sdf/chamferBoxSdf.yaml
+++ b/src/operators/sdf/chamferBoxSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.chamferBoxSdf
- opVersion: '9'
+ opVersion: '10'
opStatus: default
opDef: !def
enable: true
@@ -16,6 +16,8 @@ opDef: !def
file: src/operators/sdf/chamferBoxSdf.glsl
name: function
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('octahedronSdf_lib')
help: !text
file: src/operators/sdf/chamferBoxSdf.md
name: help
diff --git a/src/operators/sdf/coneSdf.tox b/src/operators/sdf/coneSdf.tox
index 3f7d23142..0186c2911 100644
Binary files a/src/operators/sdf/coneSdf.tox and b/src/operators/sdf/coneSdf.tox differ
diff --git a/src/operators/sdf/coneSdf.yaml b/src/operators/sdf/coneSdf.yaml
index 5bdbc6bc6..54c27ec27 100644
--- a/src/operators/sdf/coneSdf.yaml
+++ b/src/operators/sdf/coneSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.coneSdf
- opVersion: '19'
+ opVersion: '20'
opStatus: default
opDef: !def
enable: true
@@ -16,6 +16,8 @@ opDef: !def
file: src/operators/sdf/coneSdf.glsl
name: function
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('coneSdf_lib')
variableTable: !table
file: src/operators/sdf/coneSdf_variables.txt
name: variable_exprs
diff --git a/src/operators/sdf/coneSdf_lib.glsl b/src/operators/sdf/coneSdf_lib.glsl
new file mode 100644
index 000000000..abf473b55
--- /dev/null
+++ b/src/operators/sdf/coneSdf_lib.glsl
@@ -0,0 +1,38 @@
+// Cone with correct distances to tip and base circle. Y is up, 0 is in the middle of the base.
+float fCone(vec3 p, float radius, float height) {
+ vec2 q = vec2(length(p.xz), p.y);
+ vec2 tip = q - vec2(0, height);
+ vec2 mantleDir = normalize(vec2(height, radius));
+ float mantle = dot(tip, mantleDir);
+ float d = max(mantle, -q.y);
+ float projected = dot(tip, vec2(mantleDir.y, -mantleDir.x));
+
+ // distance to tip
+ if ((q.y > height) && (projected < 0)) {
+ d = max(d, length(tip));
+ }
+
+ // distance to base ring
+ if ((q.x > radius) && (projected > length(vec2(height, radius)))) {
+ d = max(d, length(q - vec2(radius, 0)));
+ }
+ return d;
+}
+
+float fCone(vec3 p, float radius, float height, vec3 direction, float offset) {
+ p -= direction * offset;
+ p = reflect(p, normalize(mix(vec3(0,1,0), -direction, .5)));
+ //p -= vec3(0,height,0);
+ return fCone(p, radius, height);
+}
+
+float sdCappedCone(vec3 p, float h, float r1, float r2)
+{
+ vec2 q = vec2( length(p.xz), p.y );
+ vec2 k1 = vec2(r2,h);
+ vec2 k2 = vec2(r2-r1,2.0*h);
+ vec2 ca = vec2(q.x-min(q.x,(q.y<0.0)?r1:r2), abs(q.y)-h);
+ vec2 cb = q - k1 + k2*clamp( dot(k1-q,k2)/dot2(k2), 0.0, 1.0 );
+ float s = (cb.x<0.0 && ca.y<0.0) ? -1.0 : 1.0;
+ return s*sqrt( min(dot2(ca),dot2(cb)) );
+}
diff --git a/src/operators/sdf/geodesicSdf.tox b/src/operators/sdf/geodesicSdf.tox
index fc8d79a53..b9a202972 100644
Binary files a/src/operators/sdf/geodesicSdf.tox and b/src/operators/sdf/geodesicSdf.tox differ
diff --git a/src/operators/sdf/geodesicSdf.yaml b/src/operators/sdf/geodesicSdf.yaml
index 061acef36..20ae22825 100644
--- a/src/operators/sdf/geodesicSdf.yaml
+++ b/src/operators/sdf/geodesicSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.geodesicSdf
- opVersion: '17'
+ opVersion: '19'
opStatus: default
opDef: !def
enable: !expr
@@ -21,7 +21,7 @@ opDef: !def
name: functionTemplate
paramGroupTable: eval_params
libraryNames: !expr
- expr: op('geodesic_lib')
+ expr: op('geodesic_lib'), op('coneSdf_lib')
help: !text
file: src/operators/sdf/geodesicSdf.md
name: help
diff --git a/src/operators/sdf/headSdf.tox b/src/operators/sdf/headSdf.tox
index c83898379..70f88e9a0 100644
Binary files a/src/operators/sdf/headSdf.tox and b/src/operators/sdf/headSdf.tox differ
diff --git a/src/operators/sdf/headSdf.yaml b/src/operators/sdf/headSdf.yaml
index 994e58e77..c4c8e5e3c 100644
--- a/src/operators/sdf/headSdf.yaml
+++ b/src/operators/sdf/headSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.headSdf
- opVersion: '5'
+ opVersion: '6'
opStatus: default
opDef: !def
enable: true
diff --git a/src/operators/sdf/headSdf_tdhooperHead.glsl b/src/operators/sdf/headSdf_tdhooperHead.glsl
index f30661c7f..778d9774b 100644
--- a/src/operators/sdf/headSdf_tdhooperHead.glsl
+++ b/src/operators/sdf/headSdf_tdhooperHead.glsl
@@ -14,6 +14,45 @@ float tdh_ellip(vec2 p, vec2 s) {
return length(p) - r;
}
+// IQ https://www.shadertoy.com/view/Xds3zN
+float tdh_sdRoundCone( in vec3 p, in float r1, float r2, float h )
+{
+ vec2 q = vec2( length(p.xz), p.y );
+
+ float b = (r1-r2)/h;
+ float a = sqrt(1.0-b*b);
+ float k = dot(q,vec2(-b,a));
+
+ if( k < 0.0 ) return length(q) - r1;
+ if( k > a*h ) return length(q-vec2(0.0,h)) - r2;
+
+ return dot(q, vec2(a,b) ) - r1;
+}
+
+float tdh_smin2(float a, float b, float r) {
+ vec2 u = max(vec2(r - a,r - b), vec2(0));
+ return max(r, min (a, b)) - length(u);
+}
+
+float tdh_smax2(float a, float b, float r) {
+ vec2 u = max(vec2(r + a,r + b), vec2(0));
+ return min(-r, max (a, b)) + length(u);
+}
+
+float tdh_smin3(float a, float b, float k){
+ return min(
+ smin(a, b, k),
+ tdh_smin2(a, b, k)
+ );
+}
+
+float tdh_smax3(float a, float b, float k){
+ return max(
+ smax(a, b, k),
+ tdh_smax2(a, b, k)
+ );
+}
+
float tdh_headMain(vec3 p) {
vec3 pa = p;
@@ -129,12 +168,12 @@ float tdh_headMain(vec3 p) {
p = pp;
p += vec3(0,.03,-.45);
pR(p.yz, 3.);
- d = smin(d, sdRoundCone(p, .008, .05, .18), .1);
+ d = smin(d, tdh_sdRoundCone(p, .008, .05, .18), .1);
p = pp;
p += vec3(0,.06,-.47);
pR(p.yz, 2.77);
- d = smin(d, sdRoundCone(p, .005, .04, .225), .05);
+ d = smin(d, tdh_sdRoundCone(p, .005, .04, .225), .05);
// cheek
@@ -242,7 +281,7 @@ float tdh_headMain(vec3 p) {
p += vec3(-.043,.28,-.48);
pR(p.xy, .15);
p.z *= .8;
- nostrils = smin(nostrils, sdRoundCone(p, .042, .0, .12), .02);
+ nostrils = smin(nostrils, tdh_sdRoundCone(p, .042, .0, .12), .02);
d = smin(d, nostrils, .02);
@@ -325,21 +364,21 @@ void tdh_ear(vec3 p, inout float d) {
iear = smin(iear, length(p.zy - vec2(.04,-.09)) - .02, .09);
float ridge = iear;
iear = smin(iear, length(p.zy - vec2(.1,-.03)) - .06, .07);
- ear = smax2(ear, -iear, .04);
+ ear = tdh_smax2(ear, -iear, .04);
earback = smin(earback, iear - .04, .02);
// ridge
p = pe;
pR(p.xz, .2);
ridge = tdh_ellip(p.zy - vec2(.01,-.03), vec2(.045,.055));
- ridge = smin3(ridge, -pRi(p.zy, .2).x - .01, .015);
- ridge = smax3(ridge, -tdh_ellip(p.zy - vec2(-.01,.1), vec2(.12,.08)), .02);
+ ridge = tdh_smin3(ridge, -pRi(p.zy, .2).x - .01, .015);
+ ridge = tdh_smax3(ridge, -tdh_ellip(p.zy - vec2(-.01,.1), vec2(.12,.08)), .02);
float ridger = .01;
ridge = max(-ridge, ridge - ridger);
- ridge = smax2(ridge, abs(p.x) - ridger/2., ridger/2.);
+ ridge = tdh_smax2(ridge, abs(p.x) - ridger/2., ridger/2.);
ear = smin(ear, ridge, .045);
@@ -368,14 +407,14 @@ void tdh_ear(vec3 p, inout float d) {
ear = smin(ear, eedge, .01);
ear = max(ear, earback);
- ear = smax2(ear, outline, .015);
+ ear = tdh_smax2(ear, outline, .015);
d = smin(d, ear, .015);
// targus
p = pp;
p += vec3(-.34,.2,.02);
- d = smin2(d, tdh_ellip(p, vec3(.015,.025,.015)), .035);
+ d = tdh_smin2(d, tdh_ellip(p, vec3(.015,.025,.015)), .035);
p = pp;
p += vec3(-.37,.18,.03);
pR(p.xz, .5);
diff --git a/src/operators/sdf/octahedronSdf.tox b/src/operators/sdf/octahedronSdf.tox
index 80f10ddaa..209b363df 100644
Binary files a/src/operators/sdf/octahedronSdf.tox and b/src/operators/sdf/octahedronSdf.tox differ
diff --git a/src/operators/sdf/octahedronSdf.yaml b/src/operators/sdf/octahedronSdf.yaml
index abdab5f01..c8aba1c8f 100644
--- a/src/operators/sdf/octahedronSdf.yaml
+++ b/src/operators/sdf/octahedronSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.octahedronSdf
- opVersion: '10'
+ opVersion: '11'
opStatus: default
opDef: !def
enable: true
@@ -16,6 +16,8 @@ opDef: !def
file: src/operators/sdf/octahedronSdf.glsl
name: function
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('octahedronSdf_lib')
help: !text
file: src/operators/sdf/octahedronSdf.md
name: help
diff --git a/src/operators/sdf/octahedronSdf_lib.glsl b/src/operators/sdf/octahedronSdf_lib.glsl
new file mode 100644
index 000000000..4be10cf90
--- /dev/null
+++ b/src/operators/sdf/octahedronSdf_lib.glsl
@@ -0,0 +1,19 @@
+float sdOctahedron( vec3 p, float s)
+{
+ p = abs(p);
+ float m = p.x+p.y+p.z-s;
+ vec3 q;
+ if( 3.0*p.x < m ) q = p.xyz;
+ else if( 3.0*p.y < m ) q = p.yzx;
+ else if( 3.0*p.z < m ) q = p.zxy;
+ else return m*0.57735027;
+
+ float k = clamp(0.5*(q.z-q.y+s),0.0,s);
+ return length(vec3(q.x,q.y-s+k,q.z-k));
+}
+
+float sdOctahedronBound( vec3 p, float s)
+{
+ p = abs(p);
+ return (p.x+p.y+p.z-s)*0.57735027;
+}
\ No newline at end of file
diff --git a/src/operators/sdf/prismSdf.glsl b/src/operators/sdf/prismSdf.glsl
index 2f9f442de..eaf28534e 100644
--- a/src/operators/sdf/prismSdf.glsl
+++ b/src/operators/sdf/prismSdf.glsl
@@ -1,6 +1,12 @@
-float THIS_shape(CoordT p, float h, float r, inout float n) {
+float THIS_shape(CoordT p, float h, float r, inout float n, float rnd) {
float d;
BODY();
+ if (rnd != 0.) {
+ // try to avoid strange stuff at ends by making the cylinder "infinite" height
+ // and then cutting it after mixing
+ d = mix(d, fCylinder(p.yzx * vec3(1., 0., 1.), r, 999.), rnd);
+ d = max(d, abs(p.z) - h);
+ }
return d;
}
@@ -44,12 +50,17 @@ ReturnT thismap(CoordT p, ContextT ctx) {
#else
float n = THIS_Sides;
#endif
+ #ifdef THIS_HAS_INPUT_roundingField
+ float rnd = inputOp_roundingField(p, ctx);
+ #else
+ float rnd = THIS_Rounding;
+ #endif
if (IS_TRUE(THIS_Infiniteheight)) {
q.z = 0.;
}
- float d = THIS_shape(q, h, r, n);
+ float d = THIS_shape(q, h, r, n, rnd);
if (IS_TRUE(THIS_Hollow)) {
- d = max(-THIS_shape(q * vec3(1., 1., 0.), 1., r - th, n), d);
+ d = max(-THIS_shape(q * vec3(1., 1., 0.), 1., r - th, n, rnd), d);
}
Sdf res = createSdf(d);
#ifdef RAYTK_USE_UV
diff --git a/src/operators/sdf/prismSdf.tox b/src/operators/sdf/prismSdf.tox
index 21125b53c..c2177f3f4 100644
Binary files a/src/operators/sdf/prismSdf.tox and b/src/operators/sdf/prismSdf.tox differ
diff --git a/src/operators/sdf/prismSdf.yaml b/src/operators/sdf/prismSdf.yaml
index e9e2bac8d..940366f33 100644
--- a/src/operators/sdf/prismSdf.yaml
+++ b/src/operators/sdf/prismSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.prismSdf
- opVersion: '26'
+ opVersion: '27'
opStatus: default
opDef: !def
enable: true
@@ -76,6 +76,16 @@ inputs:
Allcontexttype: true
returnType: !returnT
Returntypefloat: true
+- !input
+ Localalias: roundingField
+ Variables: axispos normangle normoffset
+ Variableinputs: heightField radiusField thicknessField sidesField
+ coordType: !coordT
+ Coordtypevec3: true
+ contextType: !contextT
+ Allcontexttype: true
+ returnType: !returnT
+ Returntypefloat: true
elements:
- !opElement
name: codeSwitcher_Prismtype
diff --git a/src/operators/sdf/prismSdf_params.txt b/src/operators/sdf/prismSdf_params.txt
index 91e82f92f..23a05f321 100644
--- a/src/operators/sdf/prismSdf_params.txt
+++ b/src/operators/sdf/prismSdf_params.txt
@@ -4,4 +4,5 @@ Axis Infiniteheight Hollow param runtime constant 1
Radius param runtime macro op('radius_definition').numRows < 2
Height param runtime macro op('height_definition').numRows < 2
Thickness param runtime macro op('thickness_definition').numRows < 2
+Rounding param runtime macro op('rounding_definition').numRows < 2
Uvmode param constant 1
diff --git a/src/operators/sdf/sphereFbmSdf.glsl b/src/operators/sdf/sphereFbmSdf.glsl
index e1059f659..fdf2c470d 100644
--- a/src/operators/sdf/sphereFbmSdf.glsl
+++ b/src/operators/sdf/sphereFbmSdf.glsl
@@ -1,54 +1,34 @@
-// Sphere FBM by iq
-// https://www.shadertoy.com/view/Ws3XWl
-
-#ifndef SPHERE_FBM_hash
-float SPHERE_FBM_hash(vec3 p)// replace this by something better
-{
- p = 17.0*fract(p*0.3183099+vec3(.11, .17, .13));
- return fract(p.x*p.y*p.z*(p.x+p.y+p.z));
-}
-#endif
-#ifndef SPHERE_FBM_RAD
-#define SPHERE_FBM_RAD(r) ((r)*(r)*G2)
-#endif
-#ifndef SPHERE_FBM_SPH_lattice
-#define SPHERE_FBM_SPH_lattice(i, f, c) length(f-c)-SPHERE_FBM_RAD(SPHERE_FBM_hash(i+c))
-#endif
-#ifndef SPHERE_FBM_SPH_simplex
-#define SPHERE_FBM_SPH_simplex(d, r) length(d)-r*r*G2
-#endif
-
ReturnT thismap(CoordT p, ContextT ctx) {
p -= THIS_Translate;
#if defined(THIS_Noisetype_lattice)
vec3 i = floor(p);
vec3 f = fract(p);
- const float G1 = 0.30;
- const float G2 = 0.75;
+ const float g1 = 0.30;
+ const float g2 = 0.75;
float d = smin(
smin(
smin(
- SPHERE_FBM_SPH_lattice(i, f, vec3(0, 0, 0)),
- SPHERE_FBM_SPH_lattice(i, f, vec3(0, 0, 1)),
- G1),
+ SPHERE_FBM_lattice(i, f, vec3(0, 0, 0), g2),
+ SPHERE_FBM_lattice(i, f, vec3(0, 0, 1), g2),
+ g1),
smin(
- SPHERE_FBM_SPH_lattice(i, f, vec3(0, 1, 0)),
- SPHERE_FBM_SPH_lattice(i, f, vec3(0, 1, 1)),
- G1),
- G1),
+ SPHERE_FBM_lattice(i, f, vec3(0, 1, 0), g2),
+ SPHERE_FBM_lattice(i, f, vec3(0, 1, 1), g2),
+ g1),
+ g1),
smin(
smin(
- SPHERE_FBM_SPH_lattice(i, f, vec3(1, 0, 0)),
- SPHERE_FBM_SPH_lattice(i, f, vec3(1, 0, 1)),
- G1),
+ SPHERE_FBM_lattice(i, f, vec3(1, 0, 0), g2),
+ SPHERE_FBM_lattice(i, f, vec3(1, 0, 1), g2),
+ g1),
smin(
- SPHERE_FBM_SPH_lattice(i, f, vec3(1, 1, 0)),
- SPHERE_FBM_SPH_lattice(i, f, vec3(1, 1, 1)),
- G1),
- G1),
- G1);
+ SPHERE_FBM_lattice(i, f, vec3(1, 1, 0), g2),
+ SPHERE_FBM_lattice(i, f, vec3(1, 1, 1), g2),
+ g1),
+ g1),
+ g1);
#elif defined(THIS_Noisetype_simplex)
const float K1 = 0.333333333;
const float K2 = 0.166666667;
@@ -69,19 +49,19 @@ ReturnT thismap(CoordT p, ContextT ctx) {
float r2 = SPHERE_FBM_hash(i+i2);
float r3 = SPHERE_FBM_hash(i+1.0);
- const float G1 = 0.20;
- const float G2 = 0.50;
+ const float g1 = 0.20;
+ const float g2 = 0.50;
float d = smin(
smin(
- SPHERE_FBM_SPH_simplex(d0, r0),
- SPHERE_FBM_SPH_simplex(d1, r1),
- G1),
+ SPHERE_FBM_simplex(d0, r0, g2),
+ SPHERE_FBM_simplex(d1, r1, g2),
+ g1),
smin(
- SPHERE_FBM_SPH_simplex(d2, r2),
- SPHERE_FBM_SPH_simplex(d3, r3),
- G1),
- G1);
+ SPHERE_FBM_simplex(d2, r2, g2),
+ SPHERE_FBM_simplex(d3, r3, g2),
+ g1),
+ g1);
#else
#error invalidNoiseType
#endif
diff --git a/src/operators/sdf/sphereFbmSdf.tox b/src/operators/sdf/sphereFbmSdf.tox
index 41b2720f7..577ff0747 100644
Binary files a/src/operators/sdf/sphereFbmSdf.tox and b/src/operators/sdf/sphereFbmSdf.tox differ
diff --git a/src/operators/sdf/sphereFbmSdf.yaml b/src/operators/sdf/sphereFbmSdf.yaml
index 4f145a75f..266fb55cd 100644
--- a/src/operators/sdf/sphereFbmSdf.yaml
+++ b/src/operators/sdf/sphereFbmSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.sphereFbmSdf
- opVersion: '2'
+ opVersion: '3'
opStatus: default
opDef: !def
enable: true
@@ -16,3 +16,5 @@ opDef: !def
file: src/operators/sdf/sphereFbmSdf.glsl
name: functionTemplate
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('sphereFbmSdf_lib')
diff --git a/src/operators/sdf/sphereFbmSdf_lib.glsl b/src/operators/sdf/sphereFbmSdf_lib.glsl
new file mode 100644
index 000000000..8729d0b29
--- /dev/null
+++ b/src/operators/sdf/sphereFbmSdf_lib.glsl
@@ -0,0 +1,20 @@
+// Sphere FBM by iq
+// https://www.shadertoy.com/view/Ws3XWl
+
+float SPHERE_FBM_hash(vec3 p)// replace this by something better
+{
+ p = 17.0*fract(p*0.3183099+vec3(.11, .17, .13));
+ return fract(p.x*p.y*p.z*(p.x+p.y+p.z));
+}
+
+float SPHERE_FBM_rad(float r, float g2) {
+ return (r)*(r)*g2;
+}
+
+float SPHERE_FBM_lattice(vec3 i, vec3 f, vec3 c, float g2) {
+ return length(f-c) - SPHERE_FBM_rad(SPHERE_FBM_hash(i+c), g2);
+}
+
+float SPHERE_FBM_simplex(vec3 d, float r, float g2) {
+ return length(d) - r*r*g2;
+}
diff --git a/src/operators/sdf/torusSdf.tox b/src/operators/sdf/torusSdf.tox
index 7124fd7e8..44f36a3b1 100644
Binary files a/src/operators/sdf/torusSdf.tox and b/src/operators/sdf/torusSdf.tox differ
diff --git a/src/operators/sdf/torusSdf.yaml b/src/operators/sdf/torusSdf.yaml
index 60b600e1b..c3ca77da5 100644
--- a/src/operators/sdf/torusSdf.yaml
+++ b/src/operators/sdf/torusSdf.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf.torusSdf
- opVersion: '22'
+ opVersion: '24'
opStatus: default
opDef: !def
enable: true
@@ -17,6 +17,8 @@ opDef: !def
name: functionTemplate
lockParams: Enablecaps
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('torusSdf_lib')
variableTable: !table
file: src/operators/sdf/torusSdf_variables.txt
name: variable_exprs
diff --git a/src/operators/sdf/torusSdf_lib.glsl b/src/operators/sdf/torusSdf_lib.glsl
new file mode 100644
index 000000000..f23e971e6
--- /dev/null
+++ b/src/operators/sdf/torusSdf_lib.glsl
@@ -0,0 +1,11 @@
+// Torus in the XZ-plane
+float fTorus(vec3 p, float smallRadius, float largeRadius) {
+ return length(vec2(length(p.xz) - largeRadius, p.y)) - smallRadius;
+}
+
+float sdCappedTorus(in vec3 p, in vec2 sc, in float ra, in float rb)
+{
+ p.x = abs(p.x);
+ float k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy, sc) : length(p.xy);
+ return sqrt(dot(p, p) + ra*ra - 2.0*ra*k) - rb;
+}
diff --git a/src/operators/sdf2d/roundedRectangleSdf2d.tox b/src/operators/sdf2d/roundedRectangleSdf2d.tox
index b1e33ce3b..9458455b8 100644
Binary files a/src/operators/sdf2d/roundedRectangleSdf2d.tox and b/src/operators/sdf2d/roundedRectangleSdf2d.tox differ
diff --git a/src/operators/sdf2d/roundedRectangleSdf2d.yaml b/src/operators/sdf2d/roundedRectangleSdf2d.yaml
index e7b8f4506..20b642ccb 100644
--- a/src/operators/sdf2d/roundedRectangleSdf2d.yaml
+++ b/src/operators/sdf2d/roundedRectangleSdf2d.yaml
@@ -1,7 +1,7 @@
!rop
meta: !meta
opType: raytk.operators.sdf2d.roundedRectangleSdf2d
- opVersion: '9'
+ opVersion: '10'
opStatus: default
opDef: !def
enable: true
@@ -16,6 +16,8 @@ opDef: !def
file: src/operators/sdf2d/roundedRectangleSdf2d.glsl
name: functionTemplate
paramGroupTable: eval_params
+ libraryNames: !expr
+ expr: op('roundedRectangleSdf2d_lib')
help: !text
file: src/operators/sdf2d/roundedRectangleSdf2d.md
name: help
diff --git a/src/operators/sdf2d/roundedRectangleSdf2d_lib.glsl b/src/operators/sdf2d/roundedRectangleSdf2d_lib.glsl
new file mode 100644
index 000000000..e6f22e4f0
--- /dev/null
+++ b/src/operators/sdf2d/roundedRectangleSdf2d_lib.glsl
@@ -0,0 +1,7 @@
+float sdRoundedBox( in vec2 p, in vec2 b, in vec4 r )
+{
+ r.xy = (p.x>0.0)?r.xy : r.zw;
+ r.x = (p.y>0.0)?r.x : r.y;
+ vec2 q = abs(p)-b+r.x;
+ return min(max(q.x,q.y),0.0) + length(max(q,0.0)) - r.x;
+}
\ No newline at end of file
diff --git a/src/raytk.tox b/src/raytk.tox
index c3bd6fc3a..f13759b1d 100644
Binary files a/src/raytk.tox and b/src/raytk.tox differ
diff --git a/src/tools/editorTools/exposeParamDialog/exposeParamDialog.tox b/src/tools/editorTools/exposeParamDialog/exposeParamDialog.tox
index 1aed6a097..d9ec49c40 100644
Binary files a/src/tools/editorTools/exposeParamDialog/exposeParamDialog.tox and b/src/tools/editorTools/exposeParamDialog/exposeParamDialog.tox differ
diff --git a/src/tools/inspector/BUILD.py b/src/tools/inspector/BUILD.py
index 2b5db3afe..bc9e4aed4 100644
--- a/src/tools/inspector/BUILD.py
+++ b/src/tools/inspector/BUILD.py
@@ -15,7 +15,7 @@
inspector = parent() # type: Union[COMP, Inspector]
inspector.Reset()
-subComps = inspector.findChildren(type=COMP, tags=[RaytkTags.raytkOP.name], maxDepth=1)
+subComps = inspector.findChildren(type=COMP, tags=[RaytkTags.raytkOP.name, RaytkTags.raytkComp.name], maxDepth=1)
subComps += ops(
'fieldVisualizer',
'inspectorCore',
diff --git a/src/tools/inspector/inspector.tox b/src/tools/inspector/inspector.tox
index abdcf3129..95ffb2267 100644
Binary files a/src/tools/inspector/inspector.tox and b/src/tools/inspector/inspector.tox differ
diff --git a/src/tools/inspector/outputBuffersPanel/outputBufferItem/outputBufferItem.tox b/src/tools/inspector/outputBuffersPanel/outputBufferItem/outputBufferItem.tox
index 75ba79459..4431bf0b1 100644
Binary files a/src/tools/inspector/outputBuffersPanel/outputBufferItem/outputBufferItem.tox and b/src/tools/inspector/outputBuffersPanel/outputBufferItem/outputBufferItem.tox differ
diff --git a/src/tools/inspector/outputBuffersPanel/outputBuffersPanel.tox b/src/tools/inspector/outputBuffersPanel/outputBuffersPanel.tox
index b3d24c39b..d14c54dfe 100644
Binary files a/src/tools/inspector/outputBuffersPanel/outputBuffersPanel.tox and b/src/tools/inspector/outputBuffersPanel/outputBuffersPanel.tox differ
diff --git a/src/tools/inspector/shaderPanel/shaderPanel.tox b/src/tools/inspector/shaderPanel/shaderPanel.tox
index 5e6df682a..25bb5cb5a 100644
Binary files a/src/tools/inspector/shaderPanel/shaderPanel.tox and b/src/tools/inspector/shaderPanel/shaderPanel.tox differ
diff --git a/src/tools/libraryInfo/libraryInfo.tox b/src/tools/libraryInfo/libraryInfo.tox
index 33daf43fc..cd93ce92a 100644
Binary files a/src/tools/libraryInfo/libraryInfo.tox and b/src/tools/libraryInfo/libraryInfo.tox differ
diff --git a/src/tools/libraryThumbs/libraryThumbs.tox b/src/tools/libraryThumbs/libraryThumbs.tox
index 4b426898a..595d1d139 100644
Binary files a/src/tools/libraryThumbs/libraryThumbs.tox and b/src/tools/libraryThumbs/libraryThumbs.tox differ
diff --git a/src/tools/palette/palette.py b/src/tools/palette/palette.py
index a81b347ba..e48e2eaa2 100644
--- a/src/tools/palette/palette.py
+++ b/src/tools/palette/palette.py
@@ -100,11 +100,9 @@ def onCloseTimerComplete(self):
def _resetCloseTimer(self):
timer = self._closeTimer
timer.par.initialize.pulse()
- timer.par.active = False
def _startCloseTimer(self):
timer = self._closeTimer
- timer.par.active = True
timer.par.start.pulse()
def onPanelInsideChange(self, val: bool):
diff --git a/src/tools/palette/palette.tox b/src/tools/palette/palette.tox
index 9bcbdcef5..eeeb287b3 100644
Binary files a/src/tools/palette/palette.tox and b/src/tools/palette/palette.tox differ
diff --git a/tests/testCases/operators/camera/basicCamera_test.tox b/tests/testCases/operators/camera/basicCamera_test.tox
index 45ce9100a..f7da4087e 100644
Binary files a/tests/testCases/operators/camera/basicCamera_test.tox and b/tests/testCases/operators/camera/basicCamera_test.tox differ
diff --git a/tests/testCases/operators/camera/cameraRemap_test.png b/tests/testCases/operators/camera/cameraRemap_test.png
index 69e12111a..84f45dbf8 100644
Binary files a/tests/testCases/operators/camera/cameraRemap_test.png and b/tests/testCases/operators/camera/cameraRemap_test.png differ
diff --git a/tests/testCases/operators/camera/cameraRemap_test.tox b/tests/testCases/operators/camera/cameraRemap_test.tox
index c0e21aa42..9e8fe256c 100644
Binary files a/tests/testCases/operators/camera/cameraRemap_test.tox and b/tests/testCases/operators/camera/cameraRemap_test.tox differ
diff --git a/tests/testCases/operators/camera/fieldCamera_test.png b/tests/testCases/operators/camera/fieldCamera_test.png
index fc8e42b02..09a822e63 100644
Binary files a/tests/testCases/operators/camera/fieldCamera_test.png and b/tests/testCases/operators/camera/fieldCamera_test.png differ
diff --git a/tests/testCases/operators/camera/fieldCamera_test.tox b/tests/testCases/operators/camera/fieldCamera_test.tox
index a1a2c7071..ea5e9d622 100644
Binary files a/tests/testCases/operators/camera/fieldCamera_test.tox and b/tests/testCases/operators/camera/fieldCamera_test.tox differ
diff --git a/tests/testCases/operators/camera/fisheyeCamera_test.png b/tests/testCases/operators/camera/fisheyeCamera_test.png
index c0e9c626e..543f6b6ea 100644
Binary files a/tests/testCases/operators/camera/fisheyeCamera_test.png and b/tests/testCases/operators/camera/fisheyeCamera_test.png differ
diff --git a/tests/testCases/operators/camera/fisheyeCamera_test.tox b/tests/testCases/operators/camera/fisheyeCamera_test.tox
index 9df1be3cc..3bdb8e2d8 100644
Binary files a/tests/testCases/operators/camera/fisheyeCamera_test.tox and b/tests/testCases/operators/camera/fisheyeCamera_test.tox differ
diff --git a/tests/testCases/operators/camera/linkedCamera_test.tox b/tests/testCases/operators/camera/linkedCamera_test.tox
index c63856e9b..f7e8df1a2 100644
Binary files a/tests/testCases/operators/camera/linkedCamera_test.tox and b/tests/testCases/operators/camera/linkedCamera_test.tox differ
diff --git a/tests/testCases/operators/camera/lookAtCamera_test.tox b/tests/testCases/operators/camera/lookAtCamera_test.tox
index 2abfe46d3..abca4d7b6 100644
Binary files a/tests/testCases/operators/camera/lookAtCamera_test.tox and b/tests/testCases/operators/camera/lookAtCamera_test.tox differ
diff --git a/tests/testCases/operators/camera/orthoCamera_test.tox b/tests/testCases/operators/camera/orthoCamera_test.tox
index 77b6fcf4b..a8da9dadf 100644
Binary files a/tests/testCases/operators/camera/orthoCamera_test.tox and b/tests/testCases/operators/camera/orthoCamera_test.tox differ
diff --git a/tests/testCases/operators/camera/splitCamera_test.png b/tests/testCases/operators/camera/splitCamera_test.png
index e8d218adc..777b49b70 100644
Binary files a/tests/testCases/operators/camera/splitCamera_test.png and b/tests/testCases/operators/camera/splitCamera_test.png differ
diff --git a/tests/testCases/operators/combine/addFields_test.png b/tests/testCases/operators/combine/addFields_test.png
index e3101aade..6c62782fa 100644
Binary files a/tests/testCases/operators/combine/addFields_test.png and b/tests/testCases/operators/combine/addFields_test.png differ
diff --git a/tests/testCases/operators/combine/addFields_test.tox b/tests/testCases/operators/combine/addFields_test.tox
index 773e454a6..f02b9dbdd 100644
Binary files a/tests/testCases/operators/combine/addFields_test.tox and b/tests/testCases/operators/combine/addFields_test.tox differ
diff --git a/tests/testCases/operators/combine/arrange_modes_test.png b/tests/testCases/operators/combine/arrange_modes_test.png
index 407e15ca6..a84a412be 100644
Binary files a/tests/testCases/operators/combine/arrange_modes_test.png and b/tests/testCases/operators/combine/arrange_modes_test.png differ
diff --git a/tests/testCases/operators/combine/arrange_modes_test.tox b/tests/testCases/operators/combine/arrange_modes_test.tox
index b5ecaaae2..3b7698b17 100644
Binary files a/tests/testCases/operators/combine/arrange_modes_test.tox and b/tests/testCases/operators/combine/arrange_modes_test.tox differ
diff --git a/tests/testCases/operators/combine/arrange_test.png b/tests/testCases/operators/combine/arrange_test.png
index 6541473be..b8ce08c57 100644
Binary files a/tests/testCases/operators/combine/arrange_test.png and b/tests/testCases/operators/combine/arrange_test.png differ
diff --git a/tests/testCases/operators/combine/arrange_test.tox b/tests/testCases/operators/combine/arrange_test.tox
index d178e4718..932b851f6 100644
Binary files a/tests/testCases/operators/combine/arrange_test.tox and b/tests/testCases/operators/combine/arrange_test.tox differ
diff --git a/tests/testCases/operators/combine/edgeCombine_test.tox b/tests/testCases/operators/combine/edgeCombine_test.tox
index 1602d520a..9f87ea82f 100644
Binary files a/tests/testCases/operators/combine/edgeCombine_test.tox and b/tests/testCases/operators/combine/edgeCombine_test.tox differ
diff --git a/tests/testCases/operators/combine/mergeFields_test.tox b/tests/testCases/operators/combine/mergeFields_test.tox
index 3e76b50f4..1f6d7fbb9 100644
Binary files a/tests/testCases/operators/combine/mergeFields_test.tox and b/tests/testCases/operators/combine/mergeFields_test.tox differ
diff --git a/tests/testCases/operators/convert/extrude_field_test.png b/tests/testCases/operators/convert/extrude_field_test.png
index 60375cb27..6c429e252 100644
Binary files a/tests/testCases/operators/convert/extrude_field_test.png and b/tests/testCases/operators/convert/extrude_field_test.png differ
diff --git a/tests/testCases/operators/convert/extrude_field_test.tox b/tests/testCases/operators/convert/extrude_field_test.tox
index de2bbad07..a037900ce 100644
Binary files a/tests/testCases/operators/convert/extrude_field_test.tox and b/tests/testCases/operators/convert/extrude_field_test.tox differ
diff --git a/tests/testCases/operators/convert/extrude_test.tox b/tests/testCases/operators/convert/extrude_test.tox
index 152c41520..d92d3b845 100644
Binary files a/tests/testCases/operators/convert/extrude_test.tox and b/tests/testCases/operators/convert/extrude_test.tox differ
diff --git a/tests/testCases/operators/field/bandField_test.png b/tests/testCases/operators/field/bandField_test.png
index d5219ecdd..8d274c63b 100644
Binary files a/tests/testCases/operators/field/bandField_test.png and b/tests/testCases/operators/field/bandField_test.png differ
diff --git a/tests/testCases/operators/field/bandField_test.tox b/tests/testCases/operators/field/bandField_test.tox
index ecd1f7f04..50d00af58 100644
Binary files a/tests/testCases/operators/field/bandField_test.tox and b/tests/testCases/operators/field/bandField_test.tox differ
diff --git a/tests/testCases/operators/field/chopField_1d_test.png b/tests/testCases/operators/field/chopField_1d_test.png
index 43af003d5..f21d10765 100644
Binary files a/tests/testCases/operators/field/chopField_1d_test.png and b/tests/testCases/operators/field/chopField_1d_test.png differ
diff --git a/tests/testCases/operators/field/chopField_1d_test.tox b/tests/testCases/operators/field/chopField_1d_test.tox
index 2f4579843..adc57ae4c 100644
Binary files a/tests/testCases/operators/field/chopField_1d_test.tox and b/tests/testCases/operators/field/chopField_1d_test.tox differ
diff --git a/tests/testCases/operators/field/chopField_test.png b/tests/testCases/operators/field/chopField_test.png
index d6d020fd7..b965cb1a6 100644
Binary files a/tests/testCases/operators/field/chopField_test.png and b/tests/testCases/operators/field/chopField_test.png differ
diff --git a/tests/testCases/operators/field/chopField_test.tox b/tests/testCases/operators/field/chopField_test.tox
index 3e9f3e6ab..897e0d72e 100644
Binary files a/tests/testCases/operators/field/chopField_test.tox and b/tests/testCases/operators/field/chopField_test.tox differ
diff --git a/tests/testCases/operators/field/curlNoiseField_test.png b/tests/testCases/operators/field/curlNoiseField_test.png
index cecdc2365..f1886227f 100644
Binary files a/tests/testCases/operators/field/curlNoiseField_test.png and b/tests/testCases/operators/field/curlNoiseField_test.png differ
diff --git a/tests/testCases/operators/field/curlNoiseField_test.tox b/tests/testCases/operators/field/curlNoiseField_test.tox
index 80af86c93..20bc5c87e 100644
Binary files a/tests/testCases/operators/field/curlNoiseField_test.tox and b/tests/testCases/operators/field/curlNoiseField_test.tox differ
diff --git a/tests/testCases/operators/field/positionField_test.png b/tests/testCases/operators/field/positionField_test.png
index 9739f9765..3ca0239e0 100644
Binary files a/tests/testCases/operators/field/positionField_test.png and b/tests/testCases/operators/field/positionField_test.png differ
diff --git a/tests/testCases/operators/field/positionField_test.tox b/tests/testCases/operators/field/positionField_test.tox
index b6eb98321..7cb798366 100644
Binary files a/tests/testCases/operators/field/positionField_test.tox and b/tests/testCases/operators/field/positionField_test.tox differ
diff --git a/tests/testCases/operators/field/textureField_test.tox b/tests/testCases/operators/field/textureField_test.tox
index 63b6443e1..56125b6f7 100644
Binary files a/tests/testCases/operators/field/textureField_test.tox and b/tests/testCases/operators/field/textureField_test.tox differ
diff --git a/tests/testCases/operators/filter/applyTransform_test.png b/tests/testCases/operators/filter/applyTransform_test.png
new file mode 100644
index 000000000..7973ac3c7
Binary files /dev/null and b/tests/testCases/operators/filter/applyTransform_test.png differ
diff --git a/tests/testCases/operators/filter/applyTransform_test.tox b/tests/testCases/operators/filter/applyTransform_test.tox
new file mode 100644
index 000000000..0328bfa5f
Binary files /dev/null and b/tests/testCases/operators/filter/applyTransform_test.tox differ
diff --git a/tests/testCases/operators/filter/fold_test.tox b/tests/testCases/operators/filter/fold_test.tox
index 5263c0266..915194eb3 100644
Binary files a/tests/testCases/operators/filter/fold_test.tox and b/tests/testCases/operators/filter/fold_test.tox differ
diff --git a/tests/testCases/operators/filter/lookAtRotate_test.tox b/tests/testCases/operators/filter/lookAtRotate_test.tox
index d260fc4f1..1c90eff71 100644
Binary files a/tests/testCases/operators/filter/lookAtRotate_test.tox and b/tests/testCases/operators/filter/lookAtRotate_test.tox differ
diff --git a/tests/testCases/operators/filter/magnet_test.png b/tests/testCases/operators/filter/magnet_test.png
index d5d3250c2..9cb0d550b 100644
Binary files a/tests/testCases/operators/filter/magnet_test.png and b/tests/testCases/operators/filter/magnet_test.png differ
diff --git a/tests/testCases/operators/filter/magnet_test.tox b/tests/testCases/operators/filter/magnet_test.tox
index e9766ba72..1b6f79c04 100644
Binary files a/tests/testCases/operators/filter/magnet_test.tox and b/tests/testCases/operators/filter/magnet_test.tox differ
diff --git a/tests/testCases/operators/filter/modifyDistance_test.png b/tests/testCases/operators/filter/modifyDistance_test.png
new file mode 100644
index 000000000..8d36c5978
Binary files /dev/null and b/tests/testCases/operators/filter/modifyDistance_test.png differ
diff --git a/tests/testCases/operators/filter/modifyDistance_test.tox b/tests/testCases/operators/filter/modifyDistance_test.tox
new file mode 100644
index 000000000..c6a0eaf28
Binary files /dev/null and b/tests/testCases/operators/filter/modifyDistance_test.tox differ
diff --git a/tests/testCases/operators/filter/onion_test.tox b/tests/testCases/operators/filter/onion_test.tox
index 05fee0e28..8574162b1 100644
Binary files a/tests/testCases/operators/filter/onion_test.tox and b/tests/testCases/operators/filter/onion_test.tox differ
diff --git a/tests/testCases/operators/filter/rectangleRepeat_test.png b/tests/testCases/operators/filter/rectangleRepeat_test.png
new file mode 100644
index 000000000..f87339b99
Binary files /dev/null and b/tests/testCases/operators/filter/rectangleRepeat_test.png differ
diff --git a/tests/testCases/operators/filter/rectangleRepeat_test.tox b/tests/testCases/operators/filter/rectangleRepeat_test.tox
new file mode 100644
index 000000000..998dd7837
Binary files /dev/null and b/tests/testCases/operators/filter/rectangleRepeat_test.tox differ
diff --git a/tests/testCases/operators/function/almostIdentityFn_test.png b/tests/testCases/operators/function/almostIdentityFn_test.png
index d40d4b45b..46acbbc34 100644
Binary files a/tests/testCases/operators/function/almostIdentityFn_test.png and b/tests/testCases/operators/function/almostIdentityFn_test.png differ
diff --git a/tests/testCases/operators/function/almostIdentityFn_test.tox b/tests/testCases/operators/function/almostIdentityFn_test.tox
index d5b284da9..1629e6120 100644
Binary files a/tests/testCases/operators/function/almostIdentityFn_test.tox and b/tests/testCases/operators/function/almostIdentityFn_test.tox differ
diff --git a/tests/testCases/operators/function/cubicPulseFn_test.png b/tests/testCases/operators/function/cubicPulseFn_test.png
index ab310e057..51c1ad7af 100644
Binary files a/tests/testCases/operators/function/cubicPulseFn_test.png and b/tests/testCases/operators/function/cubicPulseFn_test.png differ
diff --git a/tests/testCases/operators/function/cubicPulseFn_test.tox b/tests/testCases/operators/function/cubicPulseFn_test.tox
index dbf506278..83347b069 100644
Binary files a/tests/testCases/operators/function/cubicPulseFn_test.tox and b/tests/testCases/operators/function/cubicPulseFn_test.tox differ
diff --git a/tests/testCases/operators/function/easeFn_test.png b/tests/testCases/operators/function/easeFn_test.png
index e229e9055..c67c8f9ea 100644
Binary files a/tests/testCases/operators/function/easeFn_test.png and b/tests/testCases/operators/function/easeFn_test.png differ
diff --git a/tests/testCases/operators/function/easeFn_test.tox b/tests/testCases/operators/function/easeFn_test.tox
index 74a5a625d..d878f04c0 100644
Binary files a/tests/testCases/operators/function/easeFn_test.tox and b/tests/testCases/operators/function/easeFn_test.tox differ
diff --git a/tests/testCases/operators/function/flipFn_test.png b/tests/testCases/operators/function/flipFn_test.png
index 3f3f6960d..002b5edcb 100644
Binary files a/tests/testCases/operators/function/flipFn_test.png and b/tests/testCases/operators/function/flipFn_test.png differ
diff --git a/tests/testCases/operators/function/flipFn_test.tox b/tests/testCases/operators/function/flipFn_test.tox
index f40447ed1..067bcd95f 100644
Binary files a/tests/testCases/operators/function/flipFn_test.tox and b/tests/testCases/operators/function/flipFn_test.tox differ
diff --git a/tests/testCases/operators/function/gainFn_test.png b/tests/testCases/operators/function/gainFn_test.png
index e8bfab19b..455aaa263 100644
Binary files a/tests/testCases/operators/function/gainFn_test.png and b/tests/testCases/operators/function/gainFn_test.png differ
diff --git a/tests/testCases/operators/function/gainFn_test.tox b/tests/testCases/operators/function/gainFn_test.tox
index e65a4a47d..a186ee22f 100644
Binary files a/tests/testCases/operators/function/gainFn_test.tox and b/tests/testCases/operators/function/gainFn_test.tox differ
diff --git a/tests/testCases/operators/function/parabolaFn_test.png b/tests/testCases/operators/function/parabolaFn_test.png
index 0ab24ce67..e34b89c99 100644
Binary files a/tests/testCases/operators/function/parabolaFn_test.png and b/tests/testCases/operators/function/parabolaFn_test.png differ
diff --git a/tests/testCases/operators/function/parabolaFn_test.tox b/tests/testCases/operators/function/parabolaFn_test.tox
index a8d71345e..2c2754613 100644
Binary files a/tests/testCases/operators/function/parabolaFn_test.tox and b/tests/testCases/operators/function/parabolaFn_test.tox differ
diff --git a/tests/testCases/operators/output/raymarchRender3D_renderComposite_test.png b/tests/testCases/operators/output/raymarchRender3D_renderComposite_test.png
index 38296ff6d..14c5c6eb3 100644
Binary files a/tests/testCases/operators/output/raymarchRender3D_renderComposite_test.png and b/tests/testCases/operators/output/raymarchRender3D_renderComposite_test.png differ
diff --git a/tests/testCases/operators/output/raymarchRender3D_renderComposite_test.tox b/tests/testCases/operators/output/raymarchRender3D_renderComposite_test.tox
index 689a5584d..289b2b520 100644
Binary files a/tests/testCases/operators/output/raymarchRender3D_renderComposite_test.tox and b/tests/testCases/operators/output/raymarchRender3D_renderComposite_test.tox differ
diff --git a/tests/testCases/operators/sdf/archSdf_test.tox b/tests/testCases/operators/sdf/archSdf_test.tox
index 08c916ae8..6e304b6ff 100644
Binary files a/tests/testCases/operators/sdf/archSdf_test.tox and b/tests/testCases/operators/sdf/archSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/boxSdf_uv_test.tox b/tests/testCases/operators/sdf/boxSdf_uv_test.tox
index fba872110..96e56f7dc 100644
Binary files a/tests/testCases/operators/sdf/boxSdf_uv_test.tox and b/tests/testCases/operators/sdf/boxSdf_uv_test.tox differ
diff --git a/tests/testCases/operators/sdf/chamferBoxSdf_test.tox b/tests/testCases/operators/sdf/chamferBoxSdf_test.tox
index af300168c..fd47fe352 100644
Binary files a/tests/testCases/operators/sdf/chamferBoxSdf_test.tox and b/tests/testCases/operators/sdf/chamferBoxSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/coneSdf_test.tox b/tests/testCases/operators/sdf/coneSdf_test.tox
index f250caec9..b4dae5c79 100644
Binary files a/tests/testCases/operators/sdf/coneSdf_test.tox and b/tests/testCases/operators/sdf/coneSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/geodesicSdf_test.tox b/tests/testCases/operators/sdf/geodesicSdf_test.tox
index ec72af6c8..ebd3d810d 100644
Binary files a/tests/testCases/operators/sdf/geodesicSdf_test.tox and b/tests/testCases/operators/sdf/geodesicSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/headSdf_test.tox b/tests/testCases/operators/sdf/headSdf_test.tox
index e6b2f47bf..902e99513 100644
Binary files a/tests/testCases/operators/sdf/headSdf_test.tox and b/tests/testCases/operators/sdf/headSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/octahedronSdf_test.tox b/tests/testCases/operators/sdf/octahedronSdf_test.tox
index 50a710095..ea15c879c 100644
Binary files a/tests/testCases/operators/sdf/octahedronSdf_test.tox and b/tests/testCases/operators/sdf/octahedronSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/prismSdf_test.png b/tests/testCases/operators/sdf/prismSdf_test.png
index aa8a74e93..e463d95f4 100644
Binary files a/tests/testCases/operators/sdf/prismSdf_test.png and b/tests/testCases/operators/sdf/prismSdf_test.png differ
diff --git a/tests/testCases/operators/sdf/prismSdf_test.tox b/tests/testCases/operators/sdf/prismSdf_test.tox
index 1cf7b7413..1ecbc53fa 100644
Binary files a/tests/testCases/operators/sdf/prismSdf_test.tox and b/tests/testCases/operators/sdf/prismSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/sphereFbmSdf_test.tox b/tests/testCases/operators/sdf/sphereFbmSdf_test.tox
index 1b9314a58..678a6af75 100644
Binary files a/tests/testCases/operators/sdf/sphereFbmSdf_test.tox and b/tests/testCases/operators/sdf/sphereFbmSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/torusSdf_test.tox b/tests/testCases/operators/sdf/torusSdf_test.tox
index 74f11edd6..22abd3cd6 100644
Binary files a/tests/testCases/operators/sdf/torusSdf_test.tox and b/tests/testCases/operators/sdf/torusSdf_test.tox differ
diff --git a/tests/testCases/operators/sdf/torusSdf_uv_test.tox b/tests/testCases/operators/sdf/torusSdf_uv_test.tox
index 20eb636fb..413e2ffde 100644
Binary files a/tests/testCases/operators/sdf/torusSdf_uv_test.tox and b/tests/testCases/operators/sdf/torusSdf_uv_test.tox differ
diff --git a/tests/testCases/operators/sdf2d/roundedRectangleSdf2d_test.png b/tests/testCases/operators/sdf2d/roundedRectangleSdf2d_test.png
index 7f5a22292..e83d1e405 100644
Binary files a/tests/testCases/operators/sdf2d/roundedRectangleSdf2d_test.png and b/tests/testCases/operators/sdf2d/roundedRectangleSdf2d_test.png differ
diff --git a/tests/testCases/operators/sdf2d/roundedRectangleSdf2d_test.tox b/tests/testCases/operators/sdf2d/roundedRectangleSdf2d_test.tox
index 106a3d1d4..28cea8cf1 100644
Binary files a/tests/testCases/operators/sdf2d/roundedRectangleSdf2d_test.tox and b/tests/testCases/operators/sdf2d/roundedRectangleSdf2d_test.tox differ
diff --git a/version.txt b/version.txt
index 46b9ad419..0a62a629c 100644
--- a/version.txt
+++ b/version.txt
@@ -1,3 +1,3 @@
-toolkitVersion 0.36
+toolkitVersion 0.37
touchDesignerVersion 099
-touchDesignerBuild 2022.33910
+touchDesignerBuild 2023.11170