Shader add_colors

Click on the filename to display or download the file.

add_colors.mi
declare shader 
    color "add_colors" ( 
        color "x", 
        color "y" ) 
    apply material 
    version 1 
end declare 

add_colors.c
#include "shader.h" 
 
struct add_colors {  
    miColor x; 
    miColor y; 
}; 
 
DLLEXPORT 
int add_colors_version(void) { return 1; } 
 
DLLEXPORT 
miBoolean add_colors (  
    miColor *result, miState *state, struct add_colors *params ) 
{ 
    miColor *x = mi_eval_color(&params->x); 
    miColor *y = mi_eval_color(&params->y); 
 
    result->r = x->r + y->r; 
    result->g = x->g + y->g; 
    result->b = x->b + y->b; 
 
    return miTRUE; 
} 

22 April 2008 23:41:03