- quick-fixed various shader errors to make AssimpView start again
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@173 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
23c99f2176
commit
92ba3e433e
|
@ -87,7 +87,7 @@ std::string g_szNormalsShader = std::string(
|
||||||
"}\n"
|
"}\n"
|
||||||
|
|
||||||
// Vertex shader for rendering normals using fixed function pipeline
|
// Vertex shader for rendering normals using fixed function pipeline
|
||||||
"VS_OUTPUT RenderNormalsVS_FF(VS_INPUT IN)\n"
|
"VS_OUTPUT_FF RenderNormalsVS_FF(VS_INPUT IN)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
"VS_OUTPUT_FF Out;\n"
|
"VS_OUTPUT_FF Out;\n"
|
||||||
"Out.Position = mul(float4(IN.Position,1.0f),WorldViewProjection);\n"
|
"Out.Position = mul(float4(IN.Position,1.0f),WorldViewProjection);\n"
|
||||||
|
@ -119,9 +119,9 @@ std::string g_szNormalsShader = std::string(
|
||||||
"{\n"
|
"{\n"
|
||||||
"CullMode=none;\n"
|
"CullMode=none;\n"
|
||||||
"VertexShader = compile vs_2_0 RenderNormalsVS_FF();\n"
|
"VertexShader = compile vs_2_0 RenderNormalsVS_FF();\n"
|
||||||
"ColorOp[0] = SelectArg0;\n"
|
"ColorOp[0] = SelectArg1;\n"
|
||||||
"ColorArg0[0] = Diffuse;\n"
|
"ColorArg0[0] = Diffuse;\n"
|
||||||
"AlphaOp[0] = SelectArg0;\n"
|
"AlphaOp[0] = SelectArg1;\n"
|
||||||
"AlphaArg0[0] = Diffuse;\n"
|
"AlphaArg0[0] = Diffuse;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
|
@ -296,13 +296,13 @@ std::string g_szDefaultShader = std::string(
|
||||||
"}\n"
|
"}\n"
|
||||||
|
|
||||||
// Vertex shader for fixed function pipeline
|
// Vertex shader for fixed function pipeline
|
||||||
"VS_OUTPUT DefaultVShader_FF(VS_INPUT IN)\n"
|
"VS_OUTPUT_FF DefaultVShader_FF(VS_INPUT IN)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
"VS_OUTPUT Out;\n"
|
"VS_OUTPUT_FF Out;\n"
|
||||||
|
|
||||||
// Multiply with the WorldViewProjection matrix
|
// Multiply with the WorldViewProjection matrix
|
||||||
"Out.Position = mul(float4(IN.Position,1.0f),WorldViewProjection);\n"
|
"Out.Position = mul(float4(IN.Position,1.0f),WorldViewProjection);\n"
|
||||||
"float3 worldNormal = mul( IN.Normal, float3x3( WorldInverseTranspose)); \n"
|
"float3 worldNormal = mul( IN.Normal, (float3x3) WorldInverseTranspose); \n"
|
||||||
|
|
||||||
// per-vertex lighting. We simply assume light colors of unused lights to be black
|
// per-vertex lighting. We simply assume light colors of unused lights to be black
|
||||||
"Out.Color = float4( 0.2f, 0.2f, 0.2f, 1.0f); \n"
|
"Out.Color = float4( 0.2f, 0.2f, 0.2f, 1.0f); \n"
|
||||||
|
@ -441,9 +441,9 @@ std::string g_szDefaultShader = std::string(
|
||||||
"{\n"
|
"{\n"
|
||||||
"CullMode=none;\n"
|
"CullMode=none;\n"
|
||||||
"VertexShader = compile vs_2_0 DefaultVShader_FF();\n"
|
"VertexShader = compile vs_2_0 DefaultVShader_FF();\n"
|
||||||
"ColorOp[0] = SelectArg0;\n"
|
"ColorOp[0] = SelectArg1;\n"
|
||||||
"ColorArg0[0] = Diffuse;\n"
|
"ColorArg0[0] = Diffuse;\n"
|
||||||
"AlphaOp[0] = SelectArg0;\n"
|
"AlphaOp[0] = SelectArg1;\n"
|
||||||
"AlphaArg0[0] = Diffuse;\n"
|
"AlphaArg0[0] = Diffuse;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
|
@ -695,14 +695,14 @@ std::string g_szMaterialShader = std::string(
|
||||||
"}\n"
|
"}\n"
|
||||||
|
|
||||||
// Vertex shader for zero to five lights using the fixed function pixel pipeline
|
// Vertex shader for zero to five lights using the fixed function pixel pipeline
|
||||||
"VS_OUTPUT MaterialVShader_FF(VS_INPUT IN)\n"
|
"VS_OUTPUT_FF MaterialVShader_FF(VS_INPUT IN)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
"VS_OUTPUT_FF Out;\n"
|
"VS_OUTPUT_FF Out;\n"
|
||||||
|
|
||||||
// Multiply with the WorldViewProjection matrix
|
// Multiply with the WorldViewProjection matrix
|
||||||
"Out.Position = mul( float4( IN.Position, 1.0f), WorldViewProjection);\n"
|
"Out.Position = mul( float4( IN.Position, 1.0f), WorldViewProjection);\n"
|
||||||
"float3 worldPos = mul( float4( IN.Position, 1.0f), World);\n"
|
"float3 worldPos = mul( float4( IN.Position, 1.0f), World);\n"
|
||||||
"float3 worldNormal = mul( IN.Normal, float3x3( WorldInverseTranspose)); \n"
|
"float3 worldNormal = mul( IN.Normal, (float3x3) WorldInverseTranspose); \n"
|
||||||
"Out.TexCoord0 = IN.TexCoord0;\n"
|
"Out.TexCoord0 = IN.TexCoord0;\n"
|
||||||
|
|
||||||
// calculate per-vertex diffuse lighting including ambient part
|
// calculate per-vertex diffuse lighting including ambient part
|
||||||
|
@ -1161,7 +1161,7 @@ std::string g_szMaterialShader = std::string(
|
||||||
"ColorArg0[0] = Texture;\n"
|
"ColorArg0[0] = Texture;\n"
|
||||||
"ColorArg1[0] = Diffuse;\n"
|
"ColorArg1[0] = Diffuse;\n"
|
||||||
"AlphaOp[0] = Modulate;\n"
|
"AlphaOp[0] = Modulate;\n"
|
||||||
"AlphaArg0[0] = Textur;\n"
|
"AlphaArg0[0] = Texture;\n"
|
||||||
"AlphaArg1[0] = Diffuse;\n"
|
"AlphaArg1[0] = Diffuse;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
|
@ -1269,10 +1269,10 @@ std::string g_szPassThroughShader = std::string(
|
||||||
"SrcBlend =srcalpha;\n"
|
"SrcBlend =srcalpha;\n"
|
||||||
"DestBlend =invsrcalpha;\n"
|
"DestBlend =invsrcalpha;\n"
|
||||||
"VertexShader = compile vs_2_0 DefaultVShader();\n"
|
"VertexShader = compile vs_2_0 DefaultVShader();\n"
|
||||||
"ColorOp[0] = SelectArg0;\n"
|
"ColorOp[0] = SelectArg1;\n"
|
||||||
"ColorArg0[0] = Texture;\n"
|
"ColorArg0[0] = Texture;\n"
|
||||||
"AlphaOp[0] = SelectArg0;\n"
|
"AlphaOp[0] = SelectArg1;\n"
|
||||||
"AlphaArg0[0] = Textur;\n"
|
"AlphaArg0[0] = Texture;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
);
|
);
|
||||||
|
|
|
@ -955,8 +955,7 @@ int CreateDevice (bool p_bMultiSample,bool p_bSuperSample,bool bHW /*= true*/)
|
||||||
{
|
{
|
||||||
if( piBuffer)
|
if( piBuffer)
|
||||||
{
|
{
|
||||||
MessageBox(g_hDlg,(LPCSTR
|
MessageBox(g_hDlg,(LPCSTR)piBuffer->GetBufferPointer(),"HLSL",MB_OK);
|
||||||
)piBuffer->GetBufferPointer(),"HLSL",MB_OK);
|
|
||||||
piBuffer->Release();
|
piBuffer->Release();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -974,8 +973,7 @@ int CreateDevice (bool p_bMultiSample,bool p_bSuperSample,bool bHW /*= true*/)
|
||||||
{
|
{
|
||||||
if( piBuffer)
|
if( piBuffer)
|
||||||
{
|
{
|
||||||
MessageBox(g_hDlg,(LPCSTR
|
MessageBox(g_hDlg,(LPCSTR)piBuffer->GetBufferPointer(),"HLSL",MB_OK);
|
||||||
)piBuffer->GetBufferPointer(),"HLSL",MB_OK);
|
|
||||||
piBuffer->Release();
|
piBuffer->Release();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue