Wintermute Engine Forum

Wintermute Engine => Technical forum => WME sources discussion => Topic started by: SoundGuy on September 17, 2009, 04:24:52 AM

Title: fx files
Post by: SoundGuy on September 17, 2009, 04:24:52 AM
hey,
i've finally managed to compile 1.8.10 and played a little with the rendering functions to include the addition of reading and using .FX files.
the pixel shader part works ok, but the vertex shader doesnt' do anything at all to the rendered model!
as if there's somewhere that overrides the vertex shader that i couldn't find. any ideas?

once it work i will share my code changes.
i'll also appreciate help in uderstanding how to incorporate the .FX file name into the ACT3d file instead of being hardcoded in my .cpp file like it is today.

Oded
Title: Re: fx files
Post by: Mnemonic on September 17, 2009, 07:43:10 AM
Did you get rid of the C3DUtils::SetFixedVertexShader(Rend->m_Device, m_BlendedMesh->GetFVF()); line?
Title: Re: fx files
Post by: Mnemonic on September 17, 2009, 07:48:56 AM
As for act3d file - generally speaking, you'll want to be able to assign different materials (= fx files) to individual submeshes, not to the entire actor. So ideally the act3d file would need to contain some nested definitions, like:

Code: [Select]
ACTOR3DX
{
  NAME = "trinity"
  ; blah blah

  MATERIAL
  {
    MESH_NAME = "head"
    EFFECT = "something.fx"
  }

Currently the ANIMATION blocks work like that, so that might be a good starting point.

Other way is having the fx embedded directly in .X files. There is a standard .X template for that, I'm not sure about exporter support, though.

And of course, it would be nice to have a script method for switching the material at runtime (much like the SetTexture method works now).
Title: Re: fx files
Post by: SoundGuy on September 17, 2009, 12:08:56 PM
i think i did get rid of that line, but i'll try looking again.
Title: Re: fx files
Post by: Mnemonic on September 19, 2009, 02:27:19 PM
I was looking at the code and if you are using the (unfinished) C3DEffect class, get rid of flags setting (the D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT etc.). You don't wanna use those flags, just set them to zero.