Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: SoundGuy on December 11, 2009, 02:41:59 PM

Title: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: SoundGuy on December 11, 2009, 02:41:59 PM
Hey,

I have a problrem with Jackie's shadow when moving from using WME in DX8 to DX9.

When using DX9, the shadow model is always in t-pose as if the bones and skin isn't applied to it.
it works ok in DX8 in WME 1.8.10 but when changing it to DX9 or moving to WME 1.9.0 it behaves like this.

here is a screenshot
(http://pizza-morgana.com/beta/jackie_shadow_bad.JPG)
and the .X file
http://pizza-morgana.com/beta/Jackie_shadow.X (http://pizza-morgana.com/beta/Jackie_shadow.X)

any ideas why is this happening or who to fix it?

Oded
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: SoundGuy on December 11, 2009, 02:42:40 PM
I'll also add that the shadow models looks ok in both MView and DXViewer.exe
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: Mnemonic on December 11, 2009, 02:54:04 PM
Are you perhaps using a different model for the shadow? (the SHADOW_MODEL in actor definition)

EDIT: You are, right? The shadow model *must* use exactly the same bone structure as the main model. If it doesn't, you'll get this.
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: SoundGuy on December 11, 2009, 03:41:57 PM
it uses the exact same bone structure

here are the relevant lines from the .ACT3D file:

 
Code: [Select]
SCRIPT = "actors\Jackie\Jackie.script"
  SHADOW_IMAGE = "actors\Jackie\shadow.png"
  SHADOW_SIZE = 25.0
  LIGHT_POSITION { -80, 500, -80 }
  SHADOW_TYPE = "flat"
  SHADOW_COLOR { 0, 0, 0, 128 }
 

...
...


  ;--- external data
  MODEL = "actors\Jackie\Jackie6_cm_weld2.x" 



  SHADOW_MODEL = "actors\Jackie\Jackie_shadow.x"


I'll reemphasize, it works preferctly in DX8.
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: SoundGuy on December 11, 2009, 03:46:21 PM
here's the same thing in the Scene Editor of WME 1.8.10 (which uses DX 8)

(http://pizza-morgana.com/beta/jackie_shadow_ok.JPG)
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: Mnemonic on December 11, 2009, 04:10:27 PM
Well, I'm only telling you what can cause this symptom. I don't know why, and I can't even test it without the complete actor definition and all models.
You'll have to ask microsoft why each DirectX version parses the X files differently.
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: SoundGuy on December 11, 2009, 04:17:07 PM
files:

http://pizza-morgana.com/beta/Jackie6_cm_weld2.x (http://pizza-morgana.com/beta/Jackie6_cm_weld2.x)
http://pizza-morgana.com/beta/Jackie.act3d (http://pizza-morgana.com/beta/Jackie.act3d)
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: Mnemonic on December 11, 2009, 05:50:23 PM
The first link seems to be broken.
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: SoundGuy on December 11, 2009, 11:00:48 PM
http://pizza-morgana.com/beta/Jackie6_cm_weld2.X (http://pizza-morgana.com/beta/Jackie6_cm_weld2.X)
sorry was typing it by hand and it's cae sensitive.
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: Mnemonic on December 12, 2009, 02:02:33 PM
I ran it through the debugger and the DX9 .X file parser indeed can't see any bones in the shadow model. No idea why, though, sorry. It's a blackbox for me (the D3DXLoadSkinMeshFromXof function if anyone's interested).

Apparently the function changed between DX8 and DX9. Could you export the shadow model as text .X file? Perhaps it will become more apparent what's going on in there.
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: SoundGuy on December 12, 2009, 09:28:27 PM
I tried saving file as text .X file from the MView , but then it refuses to load the the text file in mview now, but it does load it in WME, and the shodow is still not applied.

I don't know if i have the latest version of it in MAX, i remember there were some bowties in the shadow model in the past, and the version i have is one before that, my laptop

try
http://pizza-morgana.com/beta/Jackie_Shadow_text.X (http://pizza-morgana.com/beta/Jackie_Shadow_text.X)

vs  older version, working , but has bowties which causes graphical glitches only in some computers. which was corrected in the newer version. in this one the skeleton does work correctly.
http://pizza-morgana.com/beta/Jackie_Shadow_text1.X  (http://pizza-morgana.com/beta/Jackie_Shadow_text1.X)
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: Mnemonic on December 12, 2009, 10:07:47 PM
Did you mean it the other way? Shadow_text1.x seems to be the faulty one, while Shadow_text.x seems to work.

Copying the XSkinMeshHeader and SkinWeights templates to Jackie_Shadow_text1.X appears to fix the t-pose problem.
Title: Re: Shadow Model isn't skinned when moving from DX8 to DX9
Post by: SoundGuy on December 12, 2009, 10:19:25 PM
you're probably right about the two files swtiched.

i'll try that - thanks!