nicholasgsa
11-16-2010, 04:40 AM
Hello everyone :
I am a beginner, I write a simple shader ,when I rendering, I get the Error "PHEN 0.3 error 051011: shader "one_color" not found ". (WindowsXP, maya 2009 ,visual studio 8)
###################################
MI :
declare shader
color "one_color" (
color "color" default 1 1 1 )
version 1
apply material
end declare
#################################
DLL :
#include <stdio.h>
#include <math.h>
#include <shader.h>
typedef struct {
miColor color;
} one_color_t;
DLLEXPORT int one_color_version(void) {return(1);}
DLLEXPORT miBoolean one_color_init(
miState *state,
one_color_t *param,
miBoolean *init_req)
{
if (!param) {
/* shader init */
*init_req = miTRUE; /* do instance inits */
} else {
/* shader instance init */
}
return(miTRUE);
}
DLLEXPORT miBoolean one_color_exit(
miState *state,
one_color_t *param)
{
if (param) {
/* shader instance exit */
} else {
/* shader exit */
}
return(miTRUE);
}
DLLEXPORT miBoolean one_color(
miColor *result,
miState *state,
one_color_t *param)
{
/*
* get parameter values. It is inefficient to do this all at the beginning of
* the code. Move the assignments here to where the values are first used.
* You may want to use pointers for colors and vectors.
*/
miColor color = *mi_eval_color(¶m->color);
/*
* set shader results. ``+='' etc. is useful for shaders in shader
* lists but other shaders may need to simply assign result variables.
*/
result->r += 0.0;
result->g += 0.0;
result->b += 0.0;
result->a += 0.0;
return(miTRUE);
}
#################################
I hope to get some advice, Sorry my bad English,Hope that we can understand what I mean. :banghead:
Thanks a loooooooooooooooooooooot :cry:
I am a beginner, I write a simple shader ,when I rendering, I get the Error "PHEN 0.3 error 051011: shader "one_color" not found ". (WindowsXP, maya 2009 ,visual studio 8)
###################################
MI :
declare shader
color "one_color" (
color "color" default 1 1 1 )
version 1
apply material
end declare
#################################
DLL :
#include <stdio.h>
#include <math.h>
#include <shader.h>
typedef struct {
miColor color;
} one_color_t;
DLLEXPORT int one_color_version(void) {return(1);}
DLLEXPORT miBoolean one_color_init(
miState *state,
one_color_t *param,
miBoolean *init_req)
{
if (!param) {
/* shader init */
*init_req = miTRUE; /* do instance inits */
} else {
/* shader instance init */
}
return(miTRUE);
}
DLLEXPORT miBoolean one_color_exit(
miState *state,
one_color_t *param)
{
if (param) {
/* shader instance exit */
} else {
/* shader exit */
}
return(miTRUE);
}
DLLEXPORT miBoolean one_color(
miColor *result,
miState *state,
one_color_t *param)
{
/*
* get parameter values. It is inefficient to do this all at the beginning of
* the code. Move the assignments here to where the values are first used.
* You may want to use pointers for colors and vectors.
*/
miColor color = *mi_eval_color(¶m->color);
/*
* set shader results. ``+='' etc. is useful for shaders in shader
* lists but other shaders may need to simply assign result variables.
*/
result->r += 0.0;
result->g += 0.0;
result->b += 0.0;
result->a += 0.0;
return(miTRUE);
}
#################################
I hope to get some advice, Sorry my bad English,Hope that we can understand what I mean. :banghead:
Thanks a loooooooooooooooooooooot :cry:
