Message 1 of 4
Extending the Direct X Shader via MaxScript.
Not applicable
11-28-2007
02:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there a way to define constants in a MaxScript extension to the direct X material that can be read in the preprocessor? For example, a sample of the shader .fx code goes like this:
#if defined(SHD_BASE)
#define PS_NEEDS_BASE_TEXCOORD
#endif
I could create a series of header files for all the possible shader permutations, but was hoping there might be a way to define a constant that could be read by the preprocessor before the fx file is compiled for rendering. For example, if I could set some sort of "hasDiffuse" constant in the extension to the DX Material that could be read by the preprocessor:
#if hasDiffuse == true
#define SHD_BASE
#endif
Or even better, if there was some way to #define SHD_BASE directly from a MaxScript extension of the DX Material.
Thanks!
#if defined(SHD_BASE)
#define PS_NEEDS_BASE_TEXCOORD
#endif
I could create a series of header files for all the possible shader permutations, but was hoping there might be a way to define a constant that could be read by the preprocessor before the fx file is compiled for rendering. For example, if I could set some sort of "hasDiffuse" constant in the extension to the DX Material that could be read by the preprocessor:
#if hasDiffuse == true
#define SHD_BASE
#endif
Or even better, if there was some way to #define SHD_BASE directly from a MaxScript extension of the DX Material.
Thanks!