|
After moving from Softimage 2011 32 bit to Softimage 2012 64 bit, none of the custom shaders I am using display in the directx realtime window. I’ve installed Directx runtime and SDK, and I’ve placed my shaders in the appropriate hlsl folder (I can add them from the render tree and edit them directly from Softimage, so I’m fairly sure the program isn’t having trouble finding them).
I can drop one of the HLSL preset shaders on an object and it will display correctly in realtime mode, so I don’t think it’s a directx issue. The shaders compile successfully inside Softimage when I double check them, but there is still no realtime display - and no errors are reported either. The same shaders were working fine on 2011 so I’m somewhat stumped.
Here’s an example of one of the simpler shaders I’m working with:
#include "../Common.fx"
float4 m_MaterialDiffuse <
string SasUiLabel = "Diffuse";
string SasUiControl = "ColorPicker";
> = { 1.0f, 1.0f, 1.0f, 1.0f }; // diffuse
// texture texture m_DiffuseTexture0 <
string ResourceName = "..\\resource\\dummydiffuse.dds";
string ResourceType = "2D";
>;
sampler m_DiffuseTexture0_Sampler<bool SasUiVisible = false;> = sampler_state
{
Texture = (m_DiffuseTexture0);
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear; };
struct VS_INPUT
{
float3 Pos : Position0;
float2 UV0 : TEXCOORD0; };
struct VS_OUTPUT
{
float4 Pos : Position0;
float2 UV0 : TEXCOORD0;
float2 Fog : COLOR0; }; VS_OUTPUT VS_Main(VS_INPUT In) {
VS_OUTPUT Out;
float4 P = mul(float4(In.Pos,1.0f), g_mWorld); // position (view space)
P = mul(P, g_mView ); // position (view space)
Out.Pos = mul( P, g_mProjection ); // position (projected)
Out.UV0 = In.UV0;
Out.Fog = FogParam( P );
return Out; }
float4 PS_Main(VS_OUTPUT In) : COLOR0
{
float4 Color = tex2D( m_DiffuseTexture0_Sampler, In.UV0) * m_MaterialDiffuse;
return FogApply( Color, In.Fog ); // return tex2D( m_DiffuseTexture0_Sampler, In.UV0) * m_MaterialDiffuse; }
technique Default {
pass P0
{
CullMode = CW;
ZWriteEnable = True;
AlphaBlendEnable = true;
SrcBlend = SRCALPHA;
DestBlend = INVSRCALPHA;
VertexShader = compile vs_2_0 VS_Main();
PixelShader = compile ps_2_0 PS_Main();
}
}
common.fx includes matrix declarations and some methods such as the FogApply above. I’ve doublechecked to make sure it’s in the proper place as well. If anyone can clue me in on how to get this working I’d really appreciate it.
|