Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions addons/material_maker/nodes/sphere.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"parameters": {
"cx": 0.5,
"cy": 0.5,
"normalized": false,
"r": 0.5
},
"seed_int": 0,
Expand All @@ -26,7 +27,7 @@
"name": "Sphere",
"outputs": [
{
"f": "sphere($uv, vec2($cx, $cy), $r)",
"f": "sphere($uv, vec2($cx, $cy), $r) / ($normalized ? ($r * 2.0) : 1.0)",
"longdesc": "A heightmap of the specified sphere",
"shortdesc": "Output",
"type": "f"
Expand Down Expand Up @@ -68,9 +69,17 @@
"shortdesc": "Radius",
"step": 0.01,
"type": "float"
},
{
"default": false,
"label": "Normalized",
"name": "normalized",
"shortdesc": "Normalized",
"longdesc": "Normalize output to 0.0 to 1.0 range",
"type": "boolean"
}
],
"shortdesc": "Sphere"
},
"type": "shader"
}
}
7 changes: 5 additions & 2 deletions material_maker/doc/node_3d_sphere.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ selected 3D sphere.
Parameters
++++++++++

The **Sphere** node accepts the *sphere center position* as X and Y coordinates
and its *radius* as parameters.
The **Sphere** node accepts the following parameters:

* the *shere center position* as X and Y coordinates
* the *radius* of the sphere
* whether output is *normalized*

Example images
++++++++++++++
Expand Down