-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
layout: page | ||
title: Variables | ||
nav_order: 7.1 | ||
--- | ||
|
||
# Variables | ||
|
||
Variables are a way for operators to provide additional information to other operators in the scene. | ||
|
||
For example, the [`modulo1D`](/raytk/reference/operators/filter/modulo1D) operator repeats slices of space along an axis. It offers a variable indicating which slice is being rendered, so that its input can vary settings per-slice. | ||
|
||
Another example is the [`assignColor`](/raytk/reference/operators/filter/assignColor) operator, which adds a color setting to an SDF result. It offers a variable to access the SDF result produced by its first input, so that the "Color Field" input can base the color on something like the SDF's UV coordinates. | ||
|
||
Variables can be created in one of two ways: | ||
|
||
1. Selecting the operator providing the variable, and using the editor tools menu (`alt+shift+r`), with the "Reference Variable" sub-menu. | ||
2. Clicking one of the buttons on the providing operator's "Variables" parameter page. | ||
|
||
Doing this will create a [`variableReference`](/raytk/reference/operators/utility/variableReference) operator, which access the value of the selected variable from the selected operator. This operator produces whatever type of value that variable uses, either in its entirety or just a single field within that value. For example, a vector variable can be accessed to produce either the whole vector, or just the Y part of the vector, depending on the settings on the `variableReference`. | ||
|
||
## Tutorial Video | ||
|
||
<iframe width="560" height="315" src="https://www.youtube.com/embed/eqqOlSEk0YA" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> |