<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Extending the Direct X Shader via MaxScript. in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960401#M28449</link>
    <description>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:&lt;BR /&gt;&lt;BR /&gt;#if defined(SHD_BASE) &lt;BR /&gt;        #define PS_NEEDS_BASE_TEXCOORD&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;#if hasDiffuse == true&lt;BR /&gt;        #define SHD_BASE&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;Or even better, if there was some way to #define SHD_BASE directly from a MaxScript extension of the DX Material.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
    <pubDate>Wed, 28 Nov 2007 10:25:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-11-28T10:25:40Z</dc:date>
    <item>
      <title>Extending the Direct X Shader via MaxScript.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960401#M28449</link>
      <description>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:&lt;BR /&gt;&lt;BR /&gt;#if defined(SHD_BASE) &lt;BR /&gt;        #define PS_NEEDS_BASE_TEXCOORD&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;#if hasDiffuse == true&lt;BR /&gt;        #define SHD_BASE&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;Or even better, if there was some way to #define SHD_BASE directly from a MaxScript extension of the DX Material.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Wed, 28 Nov 2007 10:25:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960401#M28449</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-28T10:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Extending the Direct X Shader via MaxScript.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960402#M28450</link>
      <description>It's not possible to define preprocessors in an FX file from MAXScript. The DirectX Shader Material is limited to the use of an effect. Shader data can be set and get but its code cannot be modified directly.&lt;BR /&gt;&lt;BR /&gt;A solution is to open the FX file with MAXScrit in text mode and modify/create it as needed.</description>
      <pubDate>Wed, 28 Nov 2007 17:09:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960402#M28450</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-28T17:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extending the Direct X Shader via MaxScript.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960403#M28451</link>
      <description>Thanks for the info!  I'll work with the fx files and some headers instead.&lt;BR /&gt;&lt;BR /&gt;I was hoping to implement our shader pipeline directly in Max, but I guess that's just not possible.  I'll have to create a hacked set of shaders instead.</description>
      <pubDate>Fri, 30 Nov 2007 03:22:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960403#M28451</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-30T03:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extending the Direct X Shader via MaxScript.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960404#M28452</link>
      <description>The C++ SDK is more powerful to do that. DirectX access is easy. I remember some presentations at GDC and Siggraph in 2005 and 2006 that covers these subjects. You can find them on the web (see GDC website or I can send you the files).</description>
      <pubDate>Fri, 30 Nov 2007 17:08:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/extending-the-direct-x-shader-via-maxscript/m-p/3960404#M28452</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-11-30T17:08:37Z</dc:date>
    </item>
  </channel>
</rss>

