Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: fx files  (Read 10435 times)

0 Members and 1 Guest are viewing this topic.

SoundGuy

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 196
    • View Profile
fx files
« 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
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: fx files
« Reply #1 on: September 17, 2009, 07:43:10 AM »

Did you get rid of the C3DUtils::SetFixedVertexShader(Rend->m_Device, m_BlendedMesh->GetFVF()); line?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: fx files
« Reply #2 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).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SoundGuy

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 196
    • View Profile
Re: fx files
« Reply #3 on: September 17, 2009, 12:08:56 PM »

i think i did get rid of that line, but i'll try looking again.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: fx files
« Reply #4 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.136 seconds with 24 queries.