Jump to content
  • Advertisement
Sign in to follow this  
roos

Shader effects set in 3ds max

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

I have an animated character in my game right now, based on the DXSDK SkinnedMesh sample. It uses an .FX file (HLSL) which does all the skinning, plus also normal mapping. The artist I'm working with was telling me that 3DS Max 7 has "DX Material wrapper", so he could save a material into an .fx file. So for example, a skin shader for the main character's face or something. I'm quite confused about how to go about getting this working in-game though... I'm already using an .FX file which handles normal mapping and character animation. Is it possible to combine the character animation .FX file with some other .FX file? Also, I imagine it's not easy to support some arbitrary .fx file made in 3DS MAX, as my game doesn't really support "plug and play shaders"... Basically in my game, for every new shader I want to use, I have to write the setup code for it, like: m_pEffect->SetMatrix( .... ); m_pEffect->SetFloat( ..... ); If my post is really confusing, here's a video explaining the concept of using DX materials from an art package: http://mtlstream02.discreet.com/streaming/ms/showdx_200k.wmv Thanks very much in advance :) roos

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Hi,

I'm exporting all the parameters of the DirectX material from Max.
Then inside my engine/game simply load for each dx material the fx file that it also exported. And set all parameter values to the values setup inside Max that I have exported. That way your artists will see the same in Max as in the engine, material wise and you can create dynamic materials that way.

The shader coders define the parameters in the fx file, and what name to give it in the user interface when artists load the shader.

So they can create some metal shader fx file for example. Artists have a set of created fx files available. So also this metal fx file. Now the artists load the fx file in the DirectX material and setup its parameters until they created the look they want. Then they export the model and my exporter saves those parameter values that they have setup. Now in the engine I simply set the same parameter values to the parameters they are linked to.

I have also created a semantic manager class, which basically stores all global variables, such as the view matrix etc. Now I give inside the shaders files some parameters semantics, such as:

float4x4 projMatrix : PROJECTIONMATRIX;

And then it knows that it has to fill that projMatrix.
This way shaders/materials are fully dynamic/flexible and you are not limited in any way.

Cheers,
- John

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!