shader and macro
the istruction D3DXCreateEffectFromFile permit to pass D3DXMACRO.
I need for the macro to do something like this:
float4 MyShader.... bla bla
began
#define SOMETHING
float4 MyShader... bla bla
In other word I need to add lines like #define to change my effect file while compiling. Can Macro do this? How?
solved
I must just pass the name
for example if I want
#define CIAO
I just pass "CIAO" to macro.name
If you want to substitute a portion of code you can for example
float4 PShader():COLOR0
CIAO
}
define macro as
macro.name="CIAO
macro.definition="return float4(1,0,0,0);"
and code 'll began
float4 PShader():COLOR0
return float4(1,0,0,0);
}
very easy. Bye
I must just pass the name
for example if I want
#define CIAO
I just pass "CIAO" to macro.name
If you want to substitute a portion of code you can for example
float4 PShader():COLOR0
CIAO
}
define macro as
macro.name="CIAO
macro.definition="return float4(1,0,0,0);"
and code 'll began
float4 PShader():COLOR0
return float4(1,0,0,0);
}
very easy. Bye
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement