[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.7 Message Passing and Information

float textureinfo ( string texturename, fieldname; output uniform type variable )
Returns information about a particular texture, environment or shadow map. fieldname specifies the name of the information as listed in the table below. If fieldname is known, and variable is of the correct type, textureinfo() will return 1.0. In case of failure, 0.0 is returned.

EXAMPLE
 
/* mapres[0] will contain map resolution in x,
   mapres[1] will contain map resolution in y */

uniform float mapres[2];
textureinfo( "grid.tdl", "resolution", mapres );

/* Get current to camera matrix used to create the shadow map */

uniform matrix Nl;
if( textureinfo( "main-spot.tdl", "viewingmatrix", Nl )!= 1.0 )
{
    Nl = 1;
}

Field Type Description
"resolution" uniform float[2] Returns texture map resolution;
"type" uniform string Returns type of texture map. Can be one of the following: "texture", "shadow" or "environment";
"channels" uniform float Returns the total number of channels in the map;
"viewingmatrix" uniform matrix Returns a matrix representing the transform from "current" space to "camera" space in which the map was created;
"projectionmatrix" uniform matrix Returns a matrix representing the transform from "current" space to map's raster space in which x varies from -1 to 1 and y from 1 to -1 (x increases from left to right and y increases from top to bottom).

textureinfo() possible field names.

float atmosphere ( string paramname; output type variable )
float displacement ( string paramname; output type variable )
float lightsource ( string paramname; output type variable )
float surface ( string paramname; output type variable )
Functions to access a parameter in one of the shaders attached to the geometric primitive being shaded. The operation will succeed if the shader exists, the parameter is present and the type is compatible, in which case 1.0 is returned. In case of failure, 0.0 is returned and variable is unchanged. Note that assigning a varying shader parameter to an uniform variable will fail. Also, lightsource() is only available inside an illuminance() block and refers to the light source being examined.

float attribute ( string dataname; output type varaible )
Returns the value of the data that is part of the primitive's attribute state. The operation will succeed if dataname is known and the type is correct, in which case 1.0 will be returned. In case of failure, 0.0 is returned and variable is unchanged. The supported data names are listed in the table below.

Name Type
"ShadingRate" uniform float
"Sides" uniform float
"Matte" uniform float
"GeometricApproximation:motionfactor" uniform float
"displacementbound:sphere" uniform float
"displacementbound:coordinatesystem" uniform string
"identifer:name" uniform string

Data fields known to attribute().

float option ( string dataname; output type varaible )
Returns the data that is part of the renderer's global option state. The operation will succeed if dataname is known and the type is correct, in which case 1.0 will be returned. In case of failure, 0.0 is returned and variable is unchanged. The supported data names are listed in the table below.

Name Type Description
"Format" uniform float[3] = [ x res, y res, aspect ratio ];
"FrameAspectRatio" uniform float Frame aspect ratio;
"CropWindow" uniform float[4] Crop window coordinates; as specified by RiCropWindow;
"DepthOfField" uniform float[3] = [ fstop, focal length, focal distance ]; as specified by RiDepthOfField;
"Shutter" uniform float[2] = [ shutter open, shutter close ]; as specified by RiShutter;
"Clipping" uniform float[2] = [near, far]; as specified by RiClipping.

Data fields known to option().

float rendererinfo ( string dataname; output type varaible )
Returns information about the renderer. The operation will succeed if dataname is known and the type is correct, in which case 1.0 will be returned. In case of failure, 0.0 is returned and variable is unchanged. The supported data names are listed in the table below.

Name Type Description
"renderer" uniform string = "3Delight";
"version" uniform float[4] = [Major, Minor, release, 0] (eg [1,0,6,0] );
"versionstring" uniform string version expressed as a string, (e.g., "1.0.6.0").

data fields known to rendererinfo().

float raylevel ( ) **
Returns ray tracer recursion level. 0 is returned for camera rays.

float isshadowray ( ) **
Returns 1.0 if the shader is being run to evalute the opacity of an object.

float isindirectray ( ) **
Returns 1.0 if the shader is being run to evalute indirect illumination.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Aghiles Kheffache on July, 31 2003 using texi2html
3Delight 1.0.0. Copyright 2000-2003 The 3Delight Team. All Rights Reserved.