pindercarl
10-13-2005, 01:57 AM
I'm trying to use assembly in .fx files to reduce the load times for files containing DirectX 9 shaders, since each .fx file in the scene is compiled when the scene is loaded.
I've been able to get the assembly in the .fx file and it loads in Max with no difficulties, but it doesn't work--that is to say the object is not draw when an assembly vertex shader is used, or the object is black when an assembly pixel shader is used.
For example, this is what a technique within the shader might look like:
pass envPass
{
ALPHABLENDENABLE = TRUE;
SRCBLEND = SRCALPHA;
DESTBLEND = INVSRCALPHA;
ZEnable = true;
ZWriteEnable = true;
vertexshader =
asm
{
vs_1_1
dcl_position v0
dcl_texcoord v1
dcl_tangent v2
dcl_binormal v3
dcl_normal v4
dp4 oPos.x, v0, c0
dp4 oPos.y, v0, c1
dp4 oPos.z, v0, c2
dp4 oPos.w, v0, c3
dp4 oT4.x, v0, c4
dp4 oT4.y, v0, c5
dp4 oT4.z, v0, c6
dp4 oT4.w, v0, c7
mov oT0.xy, v1
mov oT1.xyz, v4
mov oT2.xyz, v2
mov oT3.xyz, v3
};
PixelShader = compile ps_3_0 f();
}
Has anyone made this work before?
I've been able to get the assembly in the .fx file and it loads in Max with no difficulties, but it doesn't work--that is to say the object is not draw when an assembly vertex shader is used, or the object is black when an assembly pixel shader is used.
For example, this is what a technique within the shader might look like:
pass envPass
{
ALPHABLENDENABLE = TRUE;
SRCBLEND = SRCALPHA;
DESTBLEND = INVSRCALPHA;
ZEnable = true;
ZWriteEnable = true;
vertexshader =
asm
{
vs_1_1
dcl_position v0
dcl_texcoord v1
dcl_tangent v2
dcl_binormal v3
dcl_normal v4
dp4 oPos.x, v0, c0
dp4 oPos.y, v0, c1
dp4 oPos.z, v0, c2
dp4 oPos.w, v0, c3
dp4 oT4.x, v0, c4
dp4 oT4.y, v0, c5
dp4 oT4.z, v0, c6
dp4 oT4.w, v0, c7
mov oT0.xy, v1
mov oT1.xyz, v4
mov oT2.xyz, v2
mov oT3.xyz, v3
};
PixelShader = compile ps_3_0 f();
}
Has anyone made this work before?
