Cannot Compile the MainSolution

Nov 1, 2009 at 5:07 AM

Hi All,

I have been trying and trying and just cannot get the main solution to compile, I have installed the "WPF M-V-VM Toolkit 0.1" (which I read you needed to do on another thread), but still all I get is:


Cannot find project output file D:\Dev\WPFSLFx\SL\Demo_silverlight\SLEffectHarness\Bin\Debug\SLEffectHarness.xap.

The type reference cannot find a public type named 'BandedSwirlEffect'. Line 22 Position 65.    D:\Dev\WPFSLFx\WPF\Demo_wpf\TemplatesToConfigureEffects.xaml    22    65    WPFDemoApp

The "ShaderBuildTask.PixelShaderCompile" task could not be loaded from the assembly ShaderBuildTask, Version=1.0.3072.18169, Culture=neutral, PublicKeyToken=44e467d1687af125. Could not load file or assembly 'ShaderBuildTask, Version=1.0.3072.18169, Culture=neutral, PublicKeyToken=44e467d1687af125' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available.    D:\Dev\WPFSLFx\WPF\ShaderEffectLibrary\WPFShaderEffectLibrary.csproj    123    32    WPFShaderEffectLibrary

The "ShaderBuildTask.PixelShaderCompile" task could not be loaded from the assembly ShaderBuildTask, Version=1.0.3072.18169, Culture=neutral, PublicKeyToken=44e467d1687af125. Could not load file or assembly 'ShaderBuildTask, Version=1.0.3072.18169, Culture=neutral, PublicKeyToken=44e467d1687af125' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available.    D:\Dev\WPFSLFx\WPF\TransitionEffects\WPFTransitionEffects.csproj    145    32    WPFTransitionEffects

The name 'PixelFormats' does not exist in the current context    D:\Dev\WPFSLFx\SL\Demo_silverlight\SLEffectHarness\MainPage.xaml.cs    57    148    SLEffectHarness

The name 'PixelFormats' does not exist in the current context    D:\Dev\WPFSLFx\SL\Demo_silverlight\SLEffectHarness\MainPage.xaml.cs    77    156    SLEffectHarness


Please help me out, even if its something simple, I would really appreciate the help.

Mark

Nov 1, 2009 at 10:09 AM

I think it could be because im using the silverlight 3.0 sdk... could this be the cause?

Nov 1, 2009 at 10:24 AM

Ok, well I just figured out that I didnt need to install the MVVM toolkit, but I did need to install the "Shader Effects BuildTask and Templated" project, which I have done, and now I get less errors, but still:


Cannot find project output file D:\Dev\WPFSLFx\SL\Demo_silverlight\SLEffectHarness\Bin\Debug\SLEffectHarness.xap.        0    0    SLEffectHarness.Web
The name 'PixelFormats' does not exist in the current context    D:\Dev\WPFSLFx\SL\Demo_silverlight\SLEffectHarness\MainPage.xaml.cs    57    148    SLEffectHarness
The name 'PixelFormats' does not exist in the current context    D:\Dev\WPFSLFx\SL\Demo_silverlight\SLEffectHarness\MainPage.xaml.cs    77    156    SLEffectHarness
The type reference cannot find a public type named 'BandedSwirlEffect'. Line 22 Position 65.    D:\Dev\WPFSLFx\WPF\Demo_wpf\TemplatesToConfigureEffects.xaml    22    65    WPFDemoApp
error X5608: Compiled shader code uses too many arithmetic instruction slots (65). Max. allowed by the target (ps_2_0) is 64.
    D:\Dev\WPFSLFx\WPF\ShaderEffectLibrary\ShaderSource\Ripple.fx    48    14    WPFShaderEffectLibrary


If I continue to make progress, I will report back, but for now, if anyone can help, that would be great!

Cheers,

Mark

Nov 1, 2009 at 7:45 PM

I'm having same issues....can't build solution...get same error messages...

 

I think this error particular error you're getting...

error X5608: Compiled shader code uses too many arithmetic instruction slots (65). Max. allowed by the target (ps_2_0) is 64.

Means you need to get the latest DirectX sdk (somebody posted this in another thread here)

 

 

 

 

 

 

 

 

 

 

Nov 1, 2009 at 8:09 PM

This helped reduce # of errors to one

Error    1    error X5608: Compiled shader code uses too many arithmetic instruction slots (65). Max. allowed by the target (ps_2_0) is 64.
\WPFSLFx\WPF\ShaderEffectLibrary\ShaderSource\Ripple.fx    48    14    WPFShaderEffectLibrary

The one you also got....

 

 

If you install this...you will get rid of the other build  errors

 

Shader Effects BuildTask and Templates.zip (Recommended default)

http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=14962

 

here is direct link.

http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=14962#DownloadId=40167

 

Again, after installing shader effects buildtaks + templates, I got rid of all my errors, except error #x5608.

 

Let me know if you, know how to fix last error...I'm going to check get latest direct sdk. That should fix it (at least another thread said so)

 

Nov 1, 2009 at 9:08 PM
Edited Nov 1, 2009 at 9:14 PM

To get rid of error X5608:

 

Open Ripple.fx

 

Modify main function as per below (basically comment out pixel shader code)

You'll be able to build effect WPFShaderEffectLibrary, and then WPFDemoApp..

(of course, the Ripple effect will not work...but u will have the other effects working)


float4 main(float2 uv : TEXCOORD) : COLOR
{
 
//float2 dir = uv - center;
//
//float2 toPixel = uv - center; // vector from center to pixel
//float distance = length(toPixel);
//float2 direction = toPixel/distance;
//float angle = atan2(direction.y, direction.x);
//float2 wave;
//sincos(frequency * distance + phase, wave.x, wave.y);
//
//float falloff = saturate(1-distance);
//falloff *= falloff;
//
//distance += amplitude * wave.x * falloff;
//sincos(angle, direction.y, direction.x);
//float2 uv2 = center + distance * direction;
//
//float lighting = saturate(wave.y * falloff) * 0.2 + 0.8;
//
//float4 color = tex2D( implicitInputSampler, uv2 );
//
//color.rgb *= lighting;

  float4  color = 0;
   
   return color;
}

Nov 1, 2009 at 9:15 PM
Edited Nov 1, 2009 at 9:17 PM

ps...I can build the WPF app, and get it to run.

   I still had a couple of compile errors with the SilverLight projects.

For the Ripple.fx, if I get a chance, I may hunt around for an alternate ripple.fx. that will compile, or if somebody could, update the Ripple.fx code to use less instrunctions.

 

Nov 1, 2009 at 9:23 PM

alt Ripple.fx modification (to get instruction count <= 65

 

float4 main(float2 uv : TEXCOORD) : COLOR
    {

    float2 dir = uv - center;
    
    float2 toPixel = uv - center; // vector from center to pixel
    float distance = length(toPixel);
    float2 direction = toPixel/distance;
    float angle = atan2(direction.y, direction.x);
    float2 wave;
    sincos(frequency * distance + phase, wave.x, wave.y);
    
    float falloff = saturate(1-distance);
    falloff *= falloff;
    
    distance += amplitude * wave.x * falloff;
    sincos(angle, direction.y, direction.x);
    float2 uv2 = center + distance * direction;
    
    //float lighting = saturate(wave.y * falloff) * 0.2 + 0.8;
    
    float4 color = tex2D( implicitInputSampler, uv2 ) * .5;
    
    //color.rgb *= lighting;

    //float4  color = 0;

    return color;
    }

 

Nov 2, 2009 at 4:48 AM

It looks like you are right, I have done the same things and I can get it all to compile except for the silverlight projects, which Im not too interested in anyways.

 

BTW, I didnt have to comment out the whole ripple.fx file, I just changed the line:

float falloff = saturate(1-distance);

to:

float falloff = 1-distance;

to make it compile...

Nov 2, 2009 at 11:41 AM

Your alteration of Ripple.fx, sounds better, will do that instead.