Hi leude
Ich hab da ein problem, ich will ein effect auf ein object laden, aber es will nicht funktionieren(es färbt sich immer gelb)
Da es nie funktioniet egal wie ich es mache, mache ich eine simple einfärbung in rot
fx(obwohl es an ihr nicht liegen kann):
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
float4x4 g_mTot : WorldViewProjection;
struct VS_OUTPUT
{
float4 Pos : POSITION;
};
VS_OUTPUT SimpleTransform(float4 iPos : POSITION)
{
VS_OUTPUT o;
// Project the position into screen space
o.Pos = mul(iPos, g_mTot);
return o;
}
struct PS_OUTPUT
{
float4 Color : COLOR;
};
PS_OUTPUT ColorRed()
{
PS_OUTPUT o;
float4 Color={1.0f, 0.0f, 0.0f, 1.0f};
o.Color = Color;
return o;
}
technique t0
{
pass p0
{
VertexShader = compile vs_1_1 SimpleTransform();
PixelShader = compile ps_1_1 ColorRed();
}
}
|
und hier das rendern der fx
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
g_pEffect->SetTechnique("t0");
g_pEffect->Begin(&cPasses, 0);
for (iPass = 0; iPass < cPasses; iPass++)
{
g_pEffect->BeginPass(iPass);
D3DXMatrixTranslation( &matTrans, rlp1, -2.0f, 5.0f );
D3DXMatrixScaling( &matRot, 0.3f, 0.3f, 0.3f );
matWorld = matRot * matTrans;
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
g_pEinheit->DrawSubset(0);
g_pEffect->EndPass();
}
g_pEffect->End();
|
weis nich was falsch ist.
Danke im vorraus