Shader Writing and Integration
Since the miOptions data structure, and the methods
for accessing frame buffers
have changed, all shaders that use the geometry shader interface
must at least be recompiled. All output shaders need to be
modified and recompiled.
- New modes for mi_query were added:
miQ_INST_FINALGATHER
miQ_INST_PLACEHOLDER_ITEM
miQ_OBJ_FINALGATHER
miQ_SCENE_ROOT_GROUP
miQ_TEXTURE_DIM
- Here is the preliminary list of new shader and integration
interface functions:
mi_api_colorprofile_begin
mi_api_colorprofile_end
mi_api_colorprofile_space
mi_api_colorprofile_white
mi_api_data_callback
mi_api_object_placeholder_callback
mi_api_output_colorprofile
mi_api_primlist_approx
mi_api_primlist_begin
mi_api_primlist_border
mi_api_primlist_dimensions
mi_api_primlist_end
mi_api_primlist_topology
mi_api_texture_callback_def
mi_call_contour_material
mi_colorprofile_ciexyz_id
mi_colorprofile_ciexyz_to_internal
mi_colorprofile_ciexyz_to_render
mi_colorprofile_internal_to_ciexyz
mi_colorprofile_internal_to_render
mi_colorprofile_internalspace_id
mi_colorprofile_render_to_ciexyz
mi_colorprofile_render_to_internal
mi_colorprofile_renderspace_id
mi_continue_shadow_seg
mi_disp_fbmap
mi_disp_fbunmap
mi_mem_set_flush_failure_cb()
mi_msg_pipe_mode_enabled()
mi_output_image_close
mi_output_image_open
mi_reflection_dir_anisglossy_x
mi_reflection_dir_diffuse_x
mi_reflection_dir_glossy_x
mi_texture_interpolate
mi_transmission_dir_anisglossy_x
mi_transmission_dir_diffuse_x
mi_transmission_dir_glossy_x
- The image pointer has been removed from the options.
Output shaders must call mi_output_image_open and
mi_output_image_close for frame
buffer access.
- The fields image_types, write_image and
interp_image have been removed from the options. Frame
buffers are now specified in a database array of type
miFb_info, which is field images_info in the
options.
- The callback installed by the
mi_disp_stream_cb_begin integration function receives a
pointer of type miRc_mapfb instead of a tag array referring to
miImg_image elements. A frame buffer can be accessed
from the callback by using mi_disp_fbmap and
mi_disp_fbunmap.
- The mi_query
mode miRCQ_IMAGE has been removed. A new mode
miRCQ_FB has been introduced that allows access to
frame buffers.
mi_rc_run_query returns a pointer of type miRc_mapfb for
this mode, which can be passed to mi_disp_fbmap and
mi_disp_fbunmap for frame buffer access.
- Incompatible changes to the miInstance and
miObject data structures have been made. The
trace field has been removed, reflection,
refraction, it transparency and finalgather
fields have been added. The shadow field is no longer
treated as a boolean, it is interpreted as a bitmap which
controls casting and receiving separately.
- state->face is initialized with zero
instead of using the value defined in the global options,
allowing mental ray to distinguish between face flags set in
the options, in the object or instance or overridden by the
shader.
- Some obsolete fields in the miGeoBox data
structure have been removed.
-
For integrators, a new approximation style miAPPROX_STYLE_FINE_CONT_DISP has
been added to the integration API. It enables the continuous displacement of
unshared vertices for displaced polygons.
- The implementation of the mi_noise_... utility functions for
shaders has been improved. Note that this change may have a large effect on
existing setups using noise.
- Integrators must now call mi_api_texture_file_size() with the value
miIMG_TYPE_ANY instead of 0 as the fourth argument in order to keep the old behaviour.
This change is caused by added controls for light map creation.
- The function mi_api_object_placeholder_callback
has been added as an alternative to mi_api_object_callback.
- For integrators, a macro miBOX_BORDER_MATERIAL() has been added
to facilitate access to the materials at borders.
- The mi_rc_run_query mode miRCQ_NEEDS_PREPROC has been added.
Copyright © 1986-2007 by
mental images GmbH