//
EDIT: Ups, Auslesen der FVF flags korrigiert
Ich habe mich geirrt. Nach einer etwas ausführlicheren Analyse ist nun klar: Es wird D3DFVF_NORMAL benutzt.
So sehen die Aufrufe während dem Zeichnen des Körpers aus:
Zu Beginn:
Code: Alles auswählen
Device::SetTransform: D3DTS_VIEW,
Device::SetTransform: D3DTS_PROJECTION,
Device::SetTransform: 256,
Device::SetTransform: 256 bis 283
Mehrmals hintereinander:
Code: Alles auswählen
Device::SetRenderState: D3DRS_VERTEXBLEND, D3DVBF_1WEIGHTS,
Device::SetRenderState: D3DRS_INDEXEDVERTEXBLENDENABLE, true,
Device::SetIndices: 0,
// Abwandlung
Device::SetRenderState: D3DRS_VERTEXBLEND, D3DVBF_DISABLE,
Device::SetRenderState: D3DRS_INDEXEDVERTEXBLENDENABLE, false,
Device::SetTransform: 256,
Device::SetIndices: 0,
Device::SetStreamSource: 0, 327398776, 40,
Device::SetVertexShader: D3DFVF_XYZB2, D3DFVF_NORMAL, D3DFVF_TEX1, D3DFVF_LASTBETA_UBYTE4 (Abwandlung: D3DFVF_XYZ, D3DFVF_NORMAL, D3DFVF_TEX1)
Device::SetLight:
Device::SetRenderState: D3DRS_FOGENABLE, true,
Device::LightEnable: true,
Device::SetLight:
Device::SetLight:
Device::SetLight:
Device::SetLight:
Device::SetRenderState: D3DRS_NORMALIZENORMALS, false,
Device::SetRenderState: D3DRS_AMBIENT,
Device::SetMaterial:
Device::ApplyStateBlock: 25,
Device::SetRenderState: D3DRS_ALPHATESTENABLE, false,
Device::SetRenderState: D3DRS_ZWRITEENABLE, true,
Device::SetRenderState: D3DRS_ZENABLE, D3DZB_TRUE,
Device::SetRenderState: D3DRS_ZFUNC, D3DCMP_LESSEQUAL,
Device::SetRenderState: D3DRS_ALPHABLENDENABLE, true,
Device::SetRenderState: D3DRS_SRCBLEND, D3DBLEND_SRCALPHA,
Device::SetRenderState: D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA,
Device::SetTexture: 0,
Device::SetTextureStageState: 0, D3DTSS_ADDRESSU, D3DTEXTUREADDRESS,
Device::SetTextureStageState: 0, D3DTSS_ADDRESSV, D3DTEXTUREADDRESS,
Device::SetTextureStageState: 0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR,
Device::SetTextureStageState: 0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE,
Device::DrawIndexedPrimitive: D3DPT_TRIANGLELIST, 0, 46, 0, 59,
State Block 25:
Code: Alles auswählen
Device::SetTextureStageState: 0, D3DTSS_COLOROP, D3DTOP_MODULATE,
Device::SetTextureStageState: 0, D3DTSS_COLORARG1, D3DTA_TEXTURE,
Device::SetTextureStageState: 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE,
Device::SetTextureStageState: 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE,
Device::SetTextureStageState: 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE,
Device::SetTextureStageState: 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE,
Device::SetTextureStageState: 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE,
Device::SetTextureStageState: 0, D3DTSS_TEXCOORDINDEX, 0,
Device::SetTextureStageState: 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE,
Device::SetTextureStageState: 1, D3DTSS_TEXCOORDINDEX, 1,
Device::SetTextureStageState: 1, D3DTSS_COLOROP, D3DTOP_DISABLE,
Device::SetTextureStageState: 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE,
Device::SetTextureStageState: 2, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE,
Device::SetTextureStageState: 2, D3DTSS_TEXCOORDINDEX, 2,
Device::SetTextureStageState: 2, D3DTSS_COLOROP, D3DTOP_DISABLE,
Device::SetTextureStageState: 2, D3DTSS_ALPHAOP, D3DTOP_DISABLE,
Device::SetTextureStageState: 3, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE,
Device::SetTextureStageState: 3, D3DTSS_TEXCOORDINDEX, 3,
Device::SetTextureStageState: 3, D3DTSS_COLOROP, D3DTOP_DISABLE,
Device::SetTextureStageState: 3, D3DTSS_ALPHAOP, D3DTOP_DISABLE,
Device::SetTextureStageState: 4, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE,
Device::SetTextureStageState: 4, D3DTSS_TEXCOORDINDEX, 4,
Device::SetTextureStageState: 4, D3DTSS_COLOROP, D3DTOP_DISABLE,
Device::SetTextureStageState: 4, D3DTSS_ALPHAOP, D3DTOP_DISABLE,
Device::SetTextureStageState: 5, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE,
Device::SetTextureStageState: 5, D3DTSS_TEXCOORDINDEX, 5,
Device::SetTextureStageState: 5, D3DTSS_COLOROP, D3DTOP_DISABLE,
Device::SetTextureStageState: 5, D3DTSS_ALPHAOP, D3DTOP_DISABLE,
Device::SetTextureStageState: 6, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE,
Device::SetTextureStageState: 6, D3DTSS_TEXCOORDINDEX, 6,
Device::SetTextureStageState: 6, D3DTSS_COLOROP, D3DTOP_DISABLE,
Device::SetTextureStageState: 6, D3DTSS_ALPHAOP, D3DTOP_DISABLE,
Device::SetTextureStageState: 7, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE,
Device::SetTextureStageState: 7, D3DTSS_TEXCOORDINDEX, 7,
Device::SetTextureStageState: 7, D3DTSS_COLOROP, D3DTOP_DISABLE,
Device::SetTextureStageState: 7, D3DTSS_ALPHAOP, D3DTOP_DISABLE,
Ja, stimmt, die Animationen werden wohl "manuell" gemacht. Es werden keine Shader verwendet. Der vertex buffer ist auch immer ein anderer..
Das Spiel hat ein eigenes Modellformat. Ich nehme an, dass die Normalen darin gespeichert sind. Doch was ist mit den Animationen? Ist es üblich/sinnvoll, die Normalen für jedes Animationsframe separat zu speichern?
Leider bleibt die Frage offen, wie es sein kann, dass die Normalen plötzlich nicht mehr korrekt sind.. die D3D Funktionen geben auch immer S_OK zurück.