Skip to content

Commit

Permalink
Merge pull request #1099 from t3kt/0.35
Browse files Browse the repository at this point in the history
0.35
  • Loading branch information
t3kt authored Jun 22, 2023
2 parents 33bcc88 + d2a19bc commit bc40800
Show file tree
Hide file tree
Showing 221 changed files with 2,089 additions and 514 deletions.
38 changes: 38 additions & 0 deletions devel/prototypes/cubeModulo.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// @Param1 {"default":1, "normMin":0, "normMax":2}

ReturnT thismap(CoordT p, ContextT ctx) {

float cell = 0.;
vec3 axes = vec3(0.);

if (p.y > abs(p.x) && p.y > abs(p.z)) {
// top
cell = 0.;
// no change to p
} else if (-p.y > abs(p.x) && -p.y > abs(p.z)) {
// bottom
cell = 1.;
pR(p.yz, radians(180.));
} else if (-p.x > abs(p.y) && -p.x > abs(p.z)) {
// left
cell = 2.;
pR(p.xy, radians(90.));
pR(p.xz, radians(180.));
} else if (p.x > abs(p.y) && p.x > abs(p.z)) {
// right
cell = 3.;
pR(p.xy, radians(-90.));
} else if (p.z > 0. && p.z > p.x && p.z > p.y) {
// back
cell = 4.;
pR(p.yz, radians(90.));
pR(p.xz, radians(90.));
} else if (p.z < 0. && p.z < p.x && p.z < p.y) {
// front
cell = 5.;
pR(p.yz, radians(270.));
} else {
return createNonHitSdf();
}
return inputOp1(p, ctx);
}
Binary file added devel/prototypes/cubeModulo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added devel/prototypes/cubeModulo.tox
Binary file not shown.
Binary file added devel/prototypes/rectFrame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added devel/prototypes/rectFrame.tox
Binary file not shown.
26 changes: 26 additions & 0 deletions devel/prototypes/rectFrame_2d.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// @Size {"default":1, "style":"XY", "normMin":0, "normMax":2}
// @Thickness {"default": 0.1, "normMax": 0.5}

ReturnT thismap(CoordT p, ContextT ctx) {
vec2 sz = THIS_Size;
float th = THIS_Thickness;
float d;

if (false) {
vec2 dO2 = abs(p)-sz+vec2(th);
float dO = length(max(dO2, 0.)) + min(max(dO2.x, dO2.y), 0.);

vec2 dI2 = abs(p)-sz;
float dI = length(max(dI2, 0.)) + min(max(dI2.x, dI2.y), 0.);

d = max(-dO, dI);
// d = dO;
} else {
p = abs(p) - sz;
vec2 q = abs(p+th)-th;
d = min(
length(max(vec2(p.x, q.y),0.))+min(max(p.x, q.y), 0.),
length(max(vec2(q.x, p.y),0.))+min(max(q.x, p.y), 0.));
}
return createSdf(d);
}
18 changes: 18 additions & 0 deletions devel/prototypes/rectFrame_3d.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// @Size {"default":1, "style":"XYZ", "normMin":0, "normMax":2}
// @Thickness {"default": 0.1, "normMax": 0.5}

ReturnT thismap(CoordT p, ContextT ctx) {
vec3 sz = THIS_Size;
float th = THIS_Thickness;
float d;

vec2 p1 = abs(p.xy) - sz.xy;
vec2 q = abs(p1+th)-th;
d = min(
length(max(vec2(p1.x, q.y),0.))+min(max(p1.x, q.y), 0.),
length(max(vec2(q.x, p1.y),0.))+min(max(q.x, p1.y), 0.));
d = max(d,
abs(p.z) - sz.z
);
return createSdf(d);
}
2 changes: 1 addition & 1 deletion docs/_data/toolkit.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
toolkitVersion: '0.34'
toolkitVersion: '0.35'
1 change: 1 addition & 0 deletions docs/_reference/operators/combine/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ cat:
allowing for fast switching.
- name: triPlanarCombine
status: beta
summary: Combines three 2D fields based on vectors like surface normals.
summary: 'Operators that take two or more inputs and combine them into a single
output.'
Expand Down
14 changes: 14 additions & 0 deletions docs/_reference/operators/combine/triPlanarCombine.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ op:
required: true
returnTypes:
- vec4
summary: Alternative way to provide the coordinates used by the fields rather
than just using the position in space. Each input field gets two of the axes
of the coordinates provided (e.g. the XY field gets the x and y).
- contextTypes:
- Context
- MaterialContext
Expand All @@ -37,6 +40,9 @@ op:
required: true
returnTypes:
- vec4
summary: Field that provides the surface normals used to adjust the influence
of each plane. Typically this should be a `normalField` or a `variableReference`
that accesses a surface normal within a material.
- contextTypes:
- Context
- MaterialContext
Expand Down Expand Up @@ -88,6 +94,9 @@ op:
name: Scale
- label: Use Normals
name: Usenormals
summary: Modifies the amount of each field that's used based on how directly the
surface normals are facing that plane. For example, the XY field is used most
on parts that are facing forwards or backwards.
- label: Blend Mode
menuOptions:
- label: Add Axes
Expand All @@ -97,6 +106,7 @@ op:
- label: Average Axes
name: avg
name: Blendmode
summary: How the values from each field are combined.
- label: Return Type
menuOptions:
- label: Auto
Expand All @@ -107,5 +117,9 @@ op:
name: vec4
name: Returntype
status: beta
summary: Combines three 2D fields based on vectors like surface normals.

---


Combines three 2D fields based on vectors like surface normals.
6 changes: 6 additions & 0 deletions docs/_reference/operators/convert/vectorToFloat.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ op:
name: val
- label: Luminance
name: luma
- label: Sum(XY)
name: sumxy
- label: Sum(XYZ)
name: sumxyz
- label: Sum(XYZW)
name: sumxyzw
name: Usepart
summary: Which part of the vector to use for the float field.
summary: Converts a vector value field to a float field using one part of the vector.
Expand Down
94 changes: 76 additions & 18 deletions docs/_reference/operators/field/colorRampField.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,53 @@ op:
returnTypes:
- float
- vec4
- contextTypes:
- Context
- MaterialContext
- CameraContext
- LightContext
- RayContext
- ParticleContext
coordTypes:
- float
- vec2
- vec3
- vec4
label: Point 1 Field
name: point1Field
returnTypes:
- float
- vec4
- contextTypes:
- Context
- MaterialContext
- CameraContext
- LightContext
- RayContext
- ParticleContext
coordTypes:
- float
- vec2
- vec3
- vec4
label: Point 2 Field
name: point2Field
returnTypes:
- float
- vec4
- contextTypes:
- Context
- MaterialContext
- CameraContext
- LightContext
- RayContext
- ParticleContext
coordTypes:
- float
label: Easing Function
name: easingFunc
returnTypes:
- float
keywords:
- color
- gradient
Expand All @@ -35,17 +82,13 @@ op:
parameters:
- label: Enable
name: Enable
- label: Coord Type
- label: Coordinate Mode
menuOptions:
- label: Auto
name: auto
- label: 1D
name: float
- label: 2D
name: vec2
- label: 3D
name: vec3
name: Coordtype
- label: Axis
name: axis
- label: Endpoints
name: points
name: Coordmode
- label: Axis
menuOptions:
- label: X
Expand All @@ -57,16 +100,12 @@ op:
- label: Distance From Origin
name: dist
name: Axis
- label: Color 1
name: Color1
- label: Alpha 1
name: Alpha1
- label: Color 2
name: Color2
- label: Alpha 2
name: Alpha2
- label: Coordinate Range
name: Range
- label: Point 1
name: Point1
- label: Point 2
name: Point2
- label: Extend Mode
menuOptions:
- label: Hold
Expand All @@ -78,6 +117,25 @@ op:
- label: Mirror
name: mirror
name: Extendmode
- label: Color 1
name: Color1
- label: Alpha 1
name: Alpha1
- label: Color 2
name: Color2
- label: Alpha 2
name: Alpha2
- label: Coord Type
menuOptions:
- label: Auto
name: auto
- label: 1D
name: float
- label: 2D
name: vec2
- label: 3D
name: vec3
name: Coordtype
summary: A vector field that maps an input field to values from a range of colors.
thumb: assets/images/reference/operators/field/colorRampField_thumb.png

Expand Down
15 changes: 13 additions & 2 deletions docs/_reference/operators/field/rampField.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ op:
- vec4
label: Point 1 Field
name: point1Field
required: true
returnTypes:
- float
- vec4
Expand All @@ -59,10 +58,22 @@ op:
- vec4
label: Point 2 Field
name: point2Field
required: true
returnTypes:
- float
- vec4
- contextTypes:
- Context
- MaterialContext
- CameraContext
- LightContext
- RayContext
- ParticleContext
coordTypes:
- float
label: Easing Function
name: easingFunc
returnTypes:
- float
name: rampField
opType: raytk.operators.field.rampField
parameters:
Expand Down
13 changes: 13 additions & 0 deletions docs/_reference/operators/field/stepField.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ op:
returnTypes:
- float
- vec4
- contextTypes:
- Context
- MaterialContext
- CameraContext
- LightContext
- RayContext
- ParticleContext
coordTypes:
- float
label: Blend Function
name: blendFunction
returnTypes:
- float
name: stepField
opType: raytk.operators.field.stepField
parameters:
Expand Down
6 changes: 4 additions & 2 deletions docs/_reference/operators/filter/adjustColor.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ op:
required: true
returnTypes:
- vec4
- Sdf
- contextTypes:
- Context
- MaterialContext
Expand Down Expand Up @@ -114,12 +115,13 @@ op:
name: Hueoffset
- label: Gamma
name: Gamma
summary: Adjust properties of color values.
summary: Adjust properties of color values, either directly on a field, or on the
assigned surface color of an Sdf result.
thumb: assets/images/reference/operators/filter/adjustColor_thumb.png

---


Adjust properties of color values.
Adjust properties of color values, either directly on a field, or on the assigned surface color of an Sdf result.

This is similar to Level TOP and HSV Adjust TOP.
3 changes: 2 additions & 1 deletion docs/_reference/operators/filter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ cat:
- hue
- saturation
name: adjustColor
summary: Adjust properties of color values.
summary: Adjust properties of color values, either directly on a field, or on
the assigned surface color of an Sdf result.
- keywords:
- color
- material
Expand Down
5 changes: 5 additions & 0 deletions docs/_reference/operators/filter/spiralZoom.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ op:
that if this is not a whole integer, there will be a break in the spiral.
summary: Transforms space using a logarithmic spiral.
thumb: assets/images/reference/operators/filter/spiralZoom_thumb.png
variables:
- label: logdist
name: logdist
- label: dist
name: dist

---

Expand Down
8 changes: 8 additions & 0 deletions docs/_reference/operators/light/axisLight.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ redirect_from:
op:
category: light
inputs:
- contextTypes:
- LightContext
coordTypes:
- vec3
label: Position Field
name: positionField
returnTypes:
- vec4
- contextTypes:
- LightContext
coordTypes:
Expand Down
Loading

0 comments on commit bc40800

Please sign in to comment.