Name doesn't matter because mental ray finds parameters by byte order and
offsets. As long as parameters are defined in the same byte size and order
as described in the .spdl and/or shaderdef, the value will be pushed to the
shader appropriately. For example, I have a different parameter called
'global_ambience' not shown in the code snippet to receive Softimage's
global scene ambience color value, but Softimage calls that parameter
'ambience'. My shader has no problem finding and using the ambience. BTW -
I removed the 's' in 'lights[1]' and tested per your suggestion, but it made
no difference.
The issue I'm battling here is the shader def is not pushing the light list
or any of the renderer flags to the shader (such as trace on/off,
derivatives, environment on/off, etc...). I need to deduce if the shader
def is broken/buggy or whether I am not declaring those features correctly
in my shader def code. One problem I am experiencing is the lack of
examples to isolate the problem as all the native softimage mental ray
shaders still use .spdl, but all the SDK examples of shaders use shader
defs. There are only a few examples and they are so basic they are not
useful as none of them push a light list to the shader like a material
shader requires, or declare any renderer options other than 'version' to
illustrate how to instruct the renderer to activate/deactivate features.
Complicating matters is the code in the examples does not match the code
generated by the shaderdef wizard.
As mentioned earlier, I can use the .spdl to define the same features
without problem. The reason I do not want to use .spdl is because it's a
huge hassle to make updates and I am limited by the types of controls I can
define in the shader's PPG.
thanks,
Matt
I have no s at the end of light[1]
On Tue, Nov 11, 2014 at 10:36 PM, Daniel Brassard <[email protected]>
wrote:
In my book:
typedef struct
{
// Light list
int i_light; // memory address of first light in light array
int n_light; // number of lights in the light array;
miTag light[1]; // pointer to light array
} ml_shader_params