- Voro
- Authoring
Material
Material is the authored surface of the Geometry area. A Material node holds native surface parameters and, optionally, a short source with a look() function. Link it to a Geometry through the Geometry’s Material parameter on its Look page. Realtime Trace and Path Trace then call your function for direct light on every hit of that object. Both draw authored looks in a normal install.
Start from a preset
Section titled “Start from a preset”Material Preset fills in a starting point. Native uses the native parameters with no look. Toon and Glossy are short authored looks: flat bands of light with a rim, and a diffuse base with a sharp highlight. Below them come looks such as Leather, Brushed Steel, Comic Print and Pocket Galaxy. These ship with Voro as examples, and they may change between versions. Custom is your own source.
Write a look
Section titled “Write a look”Place Material from the Geometry view of the Voro menu. The docked DAT is named material_source. The default source is a lit diffuse look with one control:
//@param float Gain 0.8 0.0 2.0 "Gain"vec3 look(Frag f, vec3 wi) { return f.albedo * Gain * max(dot(f.N, wi), 0.0);}look(Frag f, vec3 wi) returns the response to light arriving from direction wi. At Gain 1 this look reads the same as a native Material with the same Base Color.
The look answers direct light only. Light the surface bounces onto the rest of the scene follows the Material’s native parameters, so set Base Color and roughness close to what the look draws.
An optional emit(Frag f) adds light on top of the lit look. The surface keeps its lit side and its shadow side. A source with emit() and no look() is a pure emitter.
Controls
Section titled “Controls”Every //@param line becomes a control on the Material node. Types are float, int, toggle, color, vec2 and vec3, up to 24 floats in total. Turning a control, exporting a CHOP to it or driving it with an expression changes the value live. The text does not recompile. A control keeps its identity through reordering because it follows the name in the source.
Reload
Section titled “Reload”Press Reload after editing the text. The renderer that draws the material compiles it. A bad edit keeps the last valid image, reports the error, and waits for a corrected source instead of retrying every frame.
Surface Renderer does not run looks. It draws the object with its neutral grey material and warns.
Objects without a linked Material use a grey native material. A new Material starts from that same look.
Save it
Section titled “Save it”To add a look to Material Preset on every Material, save it as voro_custom/materials/<name>.glsl in Documents/Voro or beside your project. It shows up above Custom the next time the menu refreshes.
Save as Custom Module writes main.glsl and module.json into a folder under voro_custom, and the module appears in the Custom column of the Geometry view. See Custom modules.
Going further
Section titled “Going further”The fields a look can read, the helper functions, outlines and the full look language are in the Lab’s renderer guide, lab/AUTHORING_GUIDE/MATERIALS_AND_RENDERERS.md in the Voro package.
The reference page is Material. The scene it lives in is described in First scene.