mdl_bake_function_call
Bakes any MDL function call that returns a color or structure with a color field into an image representing the output of that function.
arguments
- "baker_gpu_id" : Uint32 (default: 0)
The device ID of the GPU to be used for baking. Ignored if baker_resource is set to cpu.
- "baker_resolution" : Uint32<2> (default: Uint32<2>(
- x: 1024
- y: 1024
The resolution for the baked image.
- "baker_resource" : String (default: "gpu_with_cpu_fallback")
The compute resource used by the baker.
Possible Values:
- cpu
- gpu
- gpu_with_cpu_fallback
- "baker_samples" : Uint32 (default: 1)
Total number of samples per pixel when baking.
- "datauri" : Boolean (default: false)
If true, use datauri format for the encoded image. Otherwise just the direct base64 encoded image is returned. Ignored if output_type is not set to base64.
- "field_name" : String (default: null)
If the function returns a structure, the name of the field in the structure to use. If provided RealityServer will automatically create an intermediate accessor function to extract the field.
- "filename" : String (default: null)
The filename to use when saving images to disk when the output_type is set to disk. Ignored if the output_type is not set to disk.
- "format" : String (default: "mig")
The image format to use for baked image. Ignored if output_type is not set to binary, base64 or disk.
- "function_name" : String
The name of the MDL function call to perform the baking on.
- "output_element_name" : String (default: null)
The name of the Texture or Image database element into which the output image will be placed when the output_type is set to either image or texture. Ingored if the output_type is not image or texture.
- "output_type" : String (default: "binary")
The type of output to create from the baking process. The value of this parameter will affect the return type of the command. If using the disk type then the filename parameter must be set. If using the image or texture type then the output_element_name parameter must be set. Binary, base64 and disk output types also support the format and quality parameters.
Possible Values:
- binary
- base64
- canvas
- image
- texture
- disk
- "pixel_type" : String (default: "Rgb_fp")
The pixel type to use for baked image.
- "quality" : String (default: "100")
The quality setting for the image format used for baked image. Ignored if output_type is not set to binary, base64 or disk.
return value
BinaryBy default a Binary containing an encoded image is returned. The return type and method of storing the baked image data is controlled with the output_type parameter. When using types which store scene elements a string or array of strings will be returned with the name of the element or elements that were created.