• Advertisement
Sign in to follow this  

Macro support implementation in FX(hlsl)

This topic is 2072 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

Hi all, recently I've tried to implement macro support for my effect system. It is working using the d3deffect class. We have some count of *.fx files for each type of entity( atmospherics.fx, water.fx, meshes.fx etc), so if some #ifdef #endif brunching is happened for the some particular technique, we need to recompile all effect (many techniques)/
Now what I wanna do:

1) split each effect to many ones, such a single technique equals one effect, (<name_of_effect>_<name_of_tech>.fx)
2) put common functions separately to the outer *.fxh file, will be included to the each of pointed above effects

so if we need to recompile something, we are doing it at "technique" level, not all effect

Is it right, may be someone has implemented this alghoritm, are you?

Now second, the next common used idea - do not use effect files and d3deffect functionality at all.
pro - we can work at shader level
cons - not easy to implement, we need deal with many registers, and set it manually (some people assigns registers explicitly)

Now the second question - what method are the best? What approach do you using in your projects? Thanks

Share this post

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

  • Advertisement