C Senthil Kumar

When I write a shader in High-Level Shader Language, how can I specify the target shader model - shader version 2, 3 etc...

Also, how do I know which syntax/keywords etc... work in which version

For example, there might be some HLSL statements that work for shader model 3 but not version 2. How will I know that Are there any resources/documentation that specify this

Thanks



Re: Game Technologies: Graphics HLSL and target shader model

BLANC Guillaume

When using HLSL without effects, shader versions specified as an argument of D3DXCompileShader. When using effects, the version is specified in the technique semantic like in the exemple below that I took in D3D documentation:

technique RenderSceneWithTexture1Light
{
pass P0
{
VertexShader = compile vs_1_1 RenderSceneVS( 1, true, true );
PixelShader = compile ps_1_1 RenderScenePS( true );
}
}

In this sample, both vertex and pixel shader are using version 1.1

The compiler will of course tell you if hlsl code is supported with th e version you've specified. Yo know before compiling that a specific function is supported or not depending on the version, see HLSL Intrinsic Functions documentation.






Re: Game Technologies: Graphics HLSL and target shader model

C Senthil Kumar

Now I got it, thanks for the help!