MetaSL specification 1.2.2
14 March 2011

MetaSL lens shader state variables

State variable Data type Description
animation_frame uniform int The current frame number
animation_time float The time of the current sample in seconds, including the time within the shutter interval
aperture uniform float The camera's aperture.
aspect_ratio uniform float The pixel aspect ratio (width divided by height).
camera_offset uniform float2 The camera plane offset in pixels.
direction float3 The ray direction. This vector is unit length and is dependent on origin and position.
dof_focus uniform float The distance from the camera position to the focal plane.
dof_radius uniform float The depth of field radius.
far_clip uniform float The distance to the far clipping plane.
focal_length uniform float The camera's focal length.
image_x_resolution uniform int The width of the image in pixels.
image_y_resolution uniform int The height of the image in pixels.
importance float The effect of the current shader on the final pixel color (ranges from 0 to 1).
near_clip uniform float The distance to the near clipping plane.
origin float3 The ray origin
orthographic uniform bool Set to true if all eye rays are parallel.
raster float2 The raster coordinates for the fragment being rendered, in raster space.
ray_shader String The type of the current shader.
ray_type String The type of the current ray.
shutter_close float The time in seconds of the end of the shutter interval.
shutter_duration uniform float The length of the shutter interval in seconds. This variable is dependent on shutter_open and shutter_close.
shutter_open float The time in seconds of the beginning of the shutter interval.
shutter_position float The normalized position within the shutter interval. This variable will have the value 0.0 at the start of the interval and 1.0 at the end, and is dependent on shutter_open, shutter_close and animation_time.
shutter_time float The point in time within the shutter interval in seconds. The shutter_time will have the value 0.0 at the beginning of the shutter interval. This value is dependent on animation_time and shutter_open.
unit_spectrum_sample Spectrum A sampled spectrum that has value one at all wavelengths given in wavelength_sample and zero elsewhere.
wavelength_base const float[] Array of wavelengths, in increasing order, that are recommended when constructing spectra to achieve best approximation results . Wavelengths are given in nanometers (nm). Each wavelength λ is between the shortest and longest wavelengths considered for spectra, i.e., WAVELENGTH_MIN ≤ λ ≤ WAVELENGTH_MAX.
wavelength_sample float[] Array of wavelengths, in increasing order, that are considered for sampled spectra . Wavelengths are given in nanometers (nm). Each wavelength λ is between the shortest and longest wavelengths considered for spectra, i.e., WAVELENGTH_MIN ≤ λ ≤ WAVELENGTH_MAX.
window_bottom uniform int When rendering a cropped region, this specifies the size of the bottom margin in pixels.
window_left uniform int When rendering a cropped region, this specifies the size of the left margin in pixels.
window_right uniform int When rendering a cropped region, this specifies the size of the right margin in pixels.
window_top uniform int When rendering a cropped region, this specifies the size of the top margin in pixels.
zero_spectrum_sample Spectrum A sampled spectrum that has value zero everywhere.


© 2011 NVIDIA ARC GmbH. All rights reserved.