Jump to content
  • Advertisement
Sign in to follow this  
robydx

shader and macro

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!