Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Compiling shaders for SM 1.x cards  (Read 2196 times)
tuntori
Community Member
*
Posts: 4


« on: January 27, 2010, 10:01:00 AM »

Hello,

I have problems compiling shaders for SM 1.x cards. I made some, but none of them work for it. Even the simplest possible shader that outputs solid color only doesn't work. Tested on 2 computers with GF4Ti 4200 and Radeon 9200.
I read somewhere that compiling SM1.x is unsupported on last shader compiler and the older one can be used by calling SetEffectCompileMode(false). But when I set it to false it also doesn't work and outputs this error in debug file:
Code:
01-27-2010 16:26:07 | SHADER MANAGER : Error : D:\AG\bin\Debug\simple.fx(17): ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
ID3DXEffectCompiler: Compilation failed
it points to the line that specifies pixel shader version and function.
SetEffectCompileMode(false) makes the shader not work even if the card supports higher shader models and if it's true works only on SM2.0 cards and up.

if calling SetEffectCompileMode(true) I get this:
Code:
01-27-2010 16:26:49 | SHADER MANAGER : Shader technique 'TSM1' couldn't be validated
01-27-2010 16:26:49 | SHADER MANAGER : Shader 'Shader1' successfully created.
and again it doesn't work.

I'm using this shader taken from the wiki:
Code:
// Global world-view-projection matrix
float4x4 matWorldViewProj : WORLDVIEWPROJECTION;
 
// Vertex Shader
float4 VS(float4 inPosition : POSITION) : POSITION {
    return mul(inPosition, matWorldViewProj);
}
 
// Pixel Shader
float4 PS() : COLOR {
    return float4(1, 1, 1, 1);
}
 
technique TSM1 {
    pass P0 {
        VertexShader = compile vs_1_1 VS();
        PixelShader  = compile ps_1_1 PS();
    }
}

I'm making a lightweight game which will run well even on older than these cards so I'd like to enable some effects in these if it's possible.
Please help.
Logged
Toaster
Community Member
*
Posts: 378


WWW
« Reply #1 on: January 27, 2010, 10:23:55 AM »

SM 1.x is no longer supported I believe, you are better off compiling as 2.0 I think its safe to say almost everyone should have a 2.0 card which is a GeForce FX 5200 and higher OR a Radeon 9500 or higher.. That tech is now 2 years away from being a decade old..

-Toaster
Logged

Visit my site at: Unknown Abstraction
tuntori
Community Member
*
Posts: 4


« Reply #2 on: January 27, 2010, 01:52:11 PM »

You are right about that but still there might be a bug in this function.
Shaders doesn't work with any card if it's set to false.
Or maybe I don't understand its purpose. Is it for disabling shaders at all?
Logged
Aki
Customers
Community Member
*****
Posts: 82


« Reply #3 on: January 27, 2010, 02:45:19 PM »

You are right about that but still there might be a bug in this function.
Shaders doesn't work with any card if it's set to false.
Or maybe I don't understand its purpose. Is it for disabling shaders at all?
I'm pretty sure that's the goal of the function. .Fx "Effect" files must be compiled at runtime depending on the GPU (much like VB.net/C#), hence when compiling is disabled, shader effects are as well.
Logged

SylvainTV
Administrator
Community Member
*****
Posts: 4944


WWW
« Reply #4 on: January 29, 2010, 06:57:26 AM »

The DX10 compiler can't compile the ps_1_x anymore.
If you try to compile with the DX9 compiler (with SetEffectCompileMode(false)), you must make sure that you have D3DX9_31.dll on your computer. The old compiler is in that !
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks