Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Under Windows 8, what is the alternative to this code:

technique11 Light0Tex
{
    pass P0
    {
        ...

technique11 Light1Tex
{
    pass P0
    {
        ...

And:

Light1Tech    = mFX->GetTechniqueByName("Light1");

...

Light1Tech->GetPassByIndex(p)->Apply(0, md3dImmediateContext);
share|improve this question
    
SharpDX.Toolkit has some custom functionality that wraps it. –  r2d2rigo Dec 21 '12 at 13:30
    
In case it wasn't clear from Chuck's answer, this syntax belongs to the old-and-somewhat-deprecated "effect" system, which allowed wrapping up multiple shaders and render states in one source file using the technique/pass structure, and also provided a runtime API wrapping constant buffers and state-setting. D3D has moved away from this model; it now only officially supports one shader per file, and you must set up all constant buffers and state objects yourself. –  Nathan Reed Jul 4 at 3:10

1 Answer 1

Effects 11 is not supported by Windows Store apps for Windows 8.0 because it requires D3DCompile APIs at runtime. Hence, 'technique11' and it's kin are deprecated.

Effects 11 also has specific compiler support in the HLSL compiler, which in the latest (#47) is still there but emits a warning. Some newer DX 11.1 and DX 11.2 constructs are not supported with the legacy fx_5_0 profile.

All that said, you can technically use Effects 11 in a Windows Store app for Windows 8.1 because D3DCompiler #47 is present at runtime. You can also continue to use Effects 11 for Win32 desktop apps as long as you recognize a future HLSL compiler revision is likely to remove support for the required fx_5_0 profile.

See the Effects 11 CodePlex project.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.