shader and macro

Started by
0 comments, last by robydx 18 years, 11 months ago
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?

http://www.notjustcode.it

DirectX tutorial

Advertisement
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

http://www.notjustcode.it

DirectX tutorial

This topic is closed to new replies.

Advertisement