User Data

    data "name"  
        [ tag labelint ]  
        bytecountint [ bytes list ]  
     
    data "name"  
        [ tag labelint ]  
        "filename"  
     
    data "name"  
        [ tag labelint ]  
        declaration_name ( parameters )  

User data is arbitrary data stored in the scene file, which can be passed to shaders as a shader parameter of type data. This is useful for large amounts of data that is shared by several shaders, or too large or complex to be defined with individual shader parameters. There are three ways to define user data:

Shaders see a tag if they evaluate a parameter of type data. This tag can be accessed with the mi_query modes miQ_DATA_*, especially miQ_DATA_PARAM for accessing the data payload, and miQ_DATA_NEEDSWAP for determining if a raw byte block (the first two data definition methods) need swapping by the shader. Note that the result returned by miQ_DATA_PARAM must be cast to the appropriate data type.

Copyright © 1986-2008 by mental images GmbH