This object defines how the surface of a particular triangle in a model will look and react to lighting. Materials define color, texture, specularity, ambient reflectivity and diffusion. Materials also provide a hook into the PowerPipe mechanism, so you can attach your own rendering nodes on a per-material basis.
Further information is available in the Dynamic Models chapter of the User Guide.
|
RpMaterialCallBack represents the function called from RpGeometryForAllMaterials and RpWorldForAllMaterials for all materials referenced by polygons in a given geometry. This function should return a pointer to the current material to indicate success. The callback may return NULL to terminate further callbacks on the materials.
|
|
RpMaterialAddRef is used to increment the reference count of the specified material. Use this function to indicate that a new object depends on the material's existence. This ensures that the material is not lost when other objects that use this material are destroyed. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpMaterialClone is used to duplicate the specified material. This function creates and initializes a new material and copies the old materials's texture, color, pipeline, and surface properties to the new one. If there are any plug-ins registered with the material then the associated plugin data is also copied to the new material using the registered copy constructor function. The world plugin must be attached before using this function.
|
|
RpMaterialCreate is used to create a new material. New materials have a default color of opaque white (red = green = blue = alpha = 255) and are untextured. Note that the material is created with a reference count of one. Hence, it is the responsiblity of the application to destroy the material if it is no longer required. The world plugin must be attached before using this function.
|
|
RpMaterialDestroy is used to destroy the specified material. Only materials with a reference count of zero are actually removed from the system. Reference counts greater than one indicate that this particular material is still being used by other geometries; in this situation, this function will only decrement the material's reference count. It is the application's responsibility to destroy the material if it is no longer required and it is not referenced by any geometries. This does not apply if the material was acquired by reading a geometry from a binary stream: destroying the geometry will also destroy the material it references. The world plugin must be attached before using this function.
|
|
RpMaterialGetColor is used to retrieve the specified material's color. Material colors are specified as RwUInt8 values in the range 0 to 255 in each color channel. The default material color is opaque white (red = green = blue = alpha = 255). Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpMaterialGetDefaultPipeline retrieves the default pipeline for materials. This is the pipeline which will be used to render objects referencing a given material when that material's pipeline pointer is set to NULL. The generic form of the default material pipeline is detailed in RpMaterialGetGenericPipeline and platform-specific versions in RpMaterialGetDefaultPipeline Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpMaterialGetPipeline retrieves the pipeline for the specified material. This is the pipeline which will be used to render objects referencing the material. If the material's pipeline pointer is set to NULL, the default material pipeline will be used. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpMaterialGetPluginOffset is used to get the offset of a previously registered material plugin. The world plugin must be attached before using this function.
|
|
RpMaterialGetSurfaceProperties is used to retrieve the surface lighting characteristics from the specified material. These surface properties define the ambient, diffuse and specular reflection coefficients for all surfaces within the geometry. The reflection coefficients are shared between all morph targets. Default values for the coefficients are defined as follows: 0.2 for the ambient, 0.6 for the diffuse and 0.6 for the specular. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpMaterialGetTexture is used to retrieve the texture attached to the specified material. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpMaterialRegisterPlugin is used to register a plugin and reserve some space within a material. This must happen after the engine has been initialized but before the engine is opened. The world plugin must be attached before using this function.
|
|
RpMaterialRegisterPluginStream is used to associate a set of binary stream functionality with a previously registered material plugin. The world plugin must be attached before using this function.
|
|
RpMaterialSetColor is used to specify the color of the given material. Material colors are specified as RwUInt8 values in the range 0 to 255 in each color channel. The default material color is opaque white (red = green = blue = alpha = 255). To use material colors the rpGEOMETRYMODULATEMATERIALCOLOR flag needs to be set (see RpGeometryFlag). If a model is exported with material color 255, 255, 255, 255 the rpGEOMETRYMODULATEMATERIALCOLOR flag is not set and the material color will not be used. The rpGEOMETRYMODULATEMATERIALCOLOR flag is set when creating a world. For more information about material colors, refer to the Dynamic Models User Guide chapter.
|
|
|
RpMaterialSetFreeListCreateParams allows the developer to specify how many RpMaterial s to preallocate space for. Call before RwEngineInit.
|
|
RpMaterialSetPipeline determines the pipeline for the specified material. This is the pipeline which will be used to render objects referencing the material. If the material's pipeline pointer is set to NULL, the default material pipeline will be used. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpMaterialSetStreamAlwaysCallBack is used to associate a binary stream callback with a previously registered material plugin. This callback is called for all plugins after stream data reading has completed. The world plugin must be attached before using this function.
|
|
RpMaterialSetStreamRightsCallBack is used to associate a binary stream callback with a previously registered plugin. This callback is called for the plugin whose rights are asserted on the read material. Rights are asserted if the material had an attached pipeline with a plugin id when it was streamed. The world plugin must be attached before using this function.
|
|
RpMaterialSetSurfaceProperties is used to modify the surface lighting characteristics of the specified material. These surface properties define the ambient, diffuse and specular reflection coefficients for all surfaces within the geometry. The reflection coefficients are shared between all morph targets. Default values for the coefficients are defined as follows: 0.2 for the ambient, 0.6 for the diffuse and 0.6 for the specular. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application. The world plugin must be attached before using this function.
|
|
RpMaterialSetTexture is used to specify a texture for the given material. If the material already posesses a texture the old texture is destroyed before the new one is attached to the material. The world plugin must be attached before using this function.
|
|
RpMaterialStreamGetSize is used to determine the size in bytes of the binary representation of the specified material. This is used in the binary chunk header to indicate the size of the material chunk. The size does not include the size of the chunk header. The world plugin must be attached before using this function.
|
|
RpMaterialStreamRead is used to read a material from the specified binary stream. Prior to this function call a binary material chunk must have been found in the stream. The world plugin must be attached before using this function. The sequence to locate and read a material from a binary stream connected to a disk file is as follows: RwStream *stream; RpMaterial *NewMaterial; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if( stream ) { if( RwStreamFindChunk(stream, rwID_MATERIAL, NULL, NULL) ) { NewMaterial = RpMaterialStreamRead(stream); } RwStreamClose(stream, NULL); }
|
|
RpMaterialStreamWrite is used to write the specified material to the given binary stream. The stream must have been opened prior to this function call. The world plugin must be attached before using this function.
|
|
RpMaterialValidatePlugins validates the plugin memory allocated within the specified material. This function is useful for determining where memory trampling may be occuring within an application. This function only returns a meaningful response under a debug library. The world plugin must be attached before using this function.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |