SLG SDL - LuxRender Wiki
Luxrender GPL Physically Based Renderer

SLG SDL

Personal tools

From LuxRender Wiki

Jump to: navigation, search

Contents

SLG Scene Description Language

SmallLuxGPU scene is usually defined by 3 type of files:

  • a file with .cfg extension (e.g. render.cfg);
  • a file with .scn extension (e.g. luxball.scn);
  • one or more files with .ply extension (e.g. table.ply).

The .cfg includes the definition of rendering parameters. It includes also the reference to the definition of scene.file (e.g. scene.file = scenes/luxball/luxball.scn). The .scn includes the definition of scene materials, objects, light sources, etc. Objects are defined by the reference on an external .ply with the definition of triangles mesh. Check http://en.wikipedia.org/wiki/PLY_(file_format) for more details about the .ply file format.

.cfg file

Property name Description Default value
film.alphachannel.enable If the value is set to 1, enable alpha channel in the saved image 0
image.width Image width resolution. 640
image.height Image height resolution. 480
image.filename It defines the file name of the image to save. image.png
opencl.platform.index Select the OpenCL platform to use (0=first platform available, 1=second, etc.). 0
opencl.devices.select Enable/Disable each OpenCL device. For instance, "010" will enable only the second of the 3 devices available.
renderengine.type It defines the kind of render engine used. SLG2 support only mode "4" (i.e. 100% OpenCL path tracer). 4
scene.file Name of the scene file. scenes/luxball/luxball.scn
scene.epsilon It defines the value used a epsilon for the rendering. It can be used to fix numerical precision problems for scene "too" large or "too" small. 0.0001
batch.halttime Enable batch mode and stop the rendering after the fixed amount of time (in seconds).
batch.haltspp Enable batch mode and stop the rendering after the fixed amount of rendered sample per pixel.
batch.periodicsave It defines how often to save the image while doing a batch rendering. 0
screen.refresh.interval It defines how often to refresh the screen (in msec). 100

Render engine type 4 (i.e. 100% OpenCL path tracer)

Property name Description Default value
opencl.task.count It defines the number of thread run on the OpenCL device. More you use and less overhead there is but also more memory is required. 65536
path.maxdepth The maximum length of a path. 5
path.maxdiffusebounce The maximum number of bounces over diffuse surface in a path. 5
path.russianroulette.depth The path depth at which Russian Roulette starts to be used. 3
path.russianroulette.cap The minimum probability to cut a path with Russian Roulette. 0.125

Sampler definition

Property name Description Default value
path.sampler.type It defines the type of sampler used for the rendering. Supported values are: INLINED_RANDOM, RANDOM, STRATIFIED, METROPOLIS. INLINED_RANDOM

INLINED_RANDOM

This sampler has not additional properties.

RANDOM

This sampler has not additional properties.

STRATIFIED

Property name Description Default value
path.sampler.xsamples It defines the sample count along x axis. 3
path.sampler.ysamples It defines the sample count along y axis. 3

METROPOLIS

Property name Description Default value
path.sampler.largesteprate It defines the amount of Metropolis large mutations compared to small. 0.4
path.sampler.maxconsecutivereject It defines the maximum number of consecutive mutation rejection. 512
path.sampler.imagemutationrate It defines the maximum distance over the image plane for a small mutation (for instance 0.1 is equivalent to a 10% of the image width/height). 0.1

Filter definition

You must disable Film filtering (i.e. "film.filter.type = 0") when using OpenCL filtering or you will end with 2 filters applied.

Property name Description Default value
path.filter.type It defines the type of filter used for the rendering. Supported values are: NONE, BOX, GAUSSIAN, MITCHELL. NONE
path.filter.width.x It defines the width of the filter. Must be between 0.0 and 1.5. 1.5
path.filter.height.y It defines the height of the filter. Must be between 0.0 and 1.5. 1.5

NONE

This sampler has not additional properties.

BOX

This sampler has not additional properties.

GAUSSIAN

Property name Description Default value
path.filter.alpha Gaussian rate of falloff. Lower values give blurrier images. 2.0

MITCHELL

Property name Description Default value
path.filter.B B parameter for the mitchell filter 1.0 / 3.0
path.filter.C C parameter for the mitchell filter 1.0 / 3.0

.scn file

Camera definition

Property name Description Default value
scene.camera.lookat It defines the position of the camera and the target where the camera is looking at. 10.0 0.0 0.0 0.0 0.0 0.0
scene.camera.up It defines the up camera vector. 0.0 0.0 1.0
scene.camera.fieldofview It defines the camera field of view. 45.0
scene.camera.lensradius It defines the camera lens radius (i.e. used for depth of field). 0.0
scene.camera.focaldistance It defines the distance of the camera focus (i.e. used for depth of field). 10.0

Light source definition

SunLight definition

Property name Description Default value
scene.sunlight.dir It defines the sun direction. 0.0 0.0 1.0
scene.sunlight.turbidity Turbidity can go from 1.0 to 30+. 2-6 are most useful for clear days. 2.2
scene.sunlight.relsize It scales the size of the sun disk in the sky. If > 5.0, the disk will be directly visible. 1.0
scene.sunlight.gain It defines light gain. 1.0 1.0 1.0

SkyLight definition

Property name Description Default value
scene.skylight.dir It defines the sun direction. 0.0 0.0 1.0
scene.skylight.turbidity Turbidity can go from 1.0 to 30+. 2-6 are most useful for clear days. 2.2
scene.skylight.gain It defines light gain. 1.0 1.0 1.0

Material definition

The definition of a material is done in the .scn file with the following syntax:

scene.materials.<material type>.<material name> = <material parameters>

where <material type> is one of the following types:

  • matte
  • light
  • mirror
  • mattemirror
  • glass
  • metal
  • mattemetal
  • archglass
  • alloy

Matte

A Lambertian material.

Parameters: <R> <G> <B>
Examples: scene.materials.matte.shell = 0.0 0.0 0.75

Light

The material for area light sources.

Parameters: <Gain R> <Gain G> <Gain B>
Examples: scene.materials.light.whitelight = 40.0 40.0 40.0

Mirror

A perfect mirror material.

Parameters: <Reflected R> <Reflected G> <Reflected B> <1 => Enable, 0 => Disable specular reflections>
Examples: scene.materials.mirror.shell = 0.75 0.75 0.75 1

MatteMirror

A mix material between matte and mirror.

Parameters: <R> <G> <B> <Reflected R> <Reflected G> <Reflected B> <1 => Enable, 0 => Disable specular reflections>
Examples: scene.materials.mattemirror.shell = 0.0 0.0 0.75 0.05 0.05 0.05 1

Glass

A glass material.

Parameters: <Reflected R> <Reflected G> <Reflected B> <Transmitted R> <Transmitted G> <Transmitted B> <outside Index of Refraction> <inside Index of Refraction> <1 => Enable, 0 => Disable specular reflections> <1 => Enable, 0 => Disable specular transmissions>
Examples: scene.materials.glass.shell = 0.69 0.78 1.0 0.69 0.78 1.0 1.0 1.45 1 0

Metal

A glossy material.

Parameters: <Reflected R> <Reflected G> <Reflected B> <Exponent> <1 => Enable, 0 => Disable specular reflections>
Examples: scene.materials.metal.shell = 1.0 1.0 1.0 10.0 1.0


MatteMetal

A mix between matte and metal.

Parameters: <R> <G> <B> <Reflected R> <Reflected G> <Reflected B> <Exponent> <1 => Enable, 0 => Disable specular reflections>
Examples: scene.materials.mattemetal.shell = 0.69 0.78 1.0 0.4 0.4 0.4 10.0 1.0

ArchGlass

An architectural glass material.

Parameters: <Reflected R> <Reflected G> <Reflected B> <Transmitted R> <Transmitted G> <Transmitted B> <1 => Enable, 0 => Disable specular reflections> <1 => Enable, 0 => Disable specular transmissions>
Examples: scene.materials.archglass.shell = 0.69 0.78 1.0 0.69 0.78 1.0 1 0

Alloy

A glossy material with the amount of reflection changing according the view angle.

Parameters: <R> <G> <B> <Reflected R> <Reflected G> <Reflected B> <Exponent> <Schlick term> <1 => Enable, 0 => Disable specular reflections>
Examples: scene.materials.alloy.mat_alloy = .5 .5 .5 .5 .5 .5 999999 0.1 1

Object definition

The definition of an object is done in the .scn file with the following syntax:

scene.objects.<material name>.<object name> = <.ply file name>

The telnet interface (alias LiveMode)

SLG can be controlled in real-time with a telnet connection. First, you have to run SLG with the "-T" option. It is then possible to connect to SLG with any Telnet client at default port (i.e. 18081). The list of supported commands are:

  • exit - close the connection
  • get <property name> - return the value of a (supported) property
  • echocmd.off
  • echocmd.on
  • help - this help
  • help.get - print the list of get supported properties
  • help.set - print the list of set supported properties
  • image.reset - reset the rendering image (requires render.stop)
  • image.save - save the rendering image
  • material.list - print the list of materials
  • object.list - print the list of objects
  • render.start - start the rendering
  • render.stop - stop the rendering
  • set <property name> = <values> - set the value of a (supported) property

Use commands "help.get" and "help.set" for more details about the "set" and "get" commands.