Jump to content
  • Advertisement
Sign in to follow this  
martinperry

SlimDX and SLHL PS 2.0 problem with loading efect

This topic is 3349 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to change brightnes of pixels in my scene with one light float lightingFactor = 1; float bright = clamp(xBrightness, 0.3f, 1.0f); if (xEnableLighting) { lightingFactor = saturate(saturate(dot(PSIn.Normal, PSIn.LightDirection)) + xAmbient); lightingFactor = lightingFactor * bright; // this line do the mess } Output.Color = tex2D(TextureSampler0, PSIn.TextureCoords); Output.Color *= lightingFactor; return Output If I load this effect in SlimDX efect = Effect.FromFile(this.device, @"./HLSL/multi.fx", null, null, null, ShaderFlags.None, null, out errs); I got "E_FAIL: An undetermined error occurred (-2147467259)" on this line. If I load this effect with "ShaderFlags.NoPreshader" flag, everything work fine. If I compile shader in FX Composer, everything is fine and shader works.

Share this post


Link to post
Share on other sites
Advertisement
Nothing, because C# and everything crash on this line
efect = Effect.FromFile(this.device, @"./HLSL/multi.fx", null, null, null, ShaderFlags.None, null, out errs);
and it didn´t move further to write out error.

Share this post


Link to post
Share on other sites
Do you have unmanaged code debuging on? Are the DirectX debug runtimes on?

C#, as you put it, should not just "crash", you should at least get the Break/Continue dialog, in which case, if you select break you can then check the value of your errs variable.

Share this post


Link to post
Share on other sites
If you're using the March version, there's a bug in the HLSL compiler that totally breaks certain shaders when preshader is active. I imagine August has fixed it.

Share this post


Link to post
Share on other sites
Thanks... but August release has some way different DirectInput :/
And this doesn´t work:
this.keyboard = new Input.Device<Input.KeyboardState>(this.input, Input.SystemGuid.Keyboard);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!