Jump to content

  • Log In with Google      Sign In   
  • Create Account

gradbot

Member Since 27 Jul 2012
Offline Last Active Sep 25 2012 09:38 PM

Posts I've Made

In Topic: Render Depth to texture

25 September 2012 - 09:27 PM

It's very possible that blank white is actually correct.

Thanks mhagain! I was just doing that. It turns out all my Z data was between 0.998 and 1. I used the following code to see it.
return (1 - Depth.Sample(Sampler, input.cords)) * 500;

In Topic: [SlimDX] Need help from Native/Managed Interop Expert

27 July 2012 - 10:28 AM

I ran into a similar error while using SlimDX with F#. For those of you who don't know what F# is, it's a type inferred functional .net language. Type inference is normally awesome but in this case caused an error. I'm posting this here so others can find this solution.

let result, device, swapChain = Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.None, swapChainDescription)
let resource = Resource.FromSwapChain(swapChain, 0)

Causes System.MissingMethodException to be thrown. Building from source I found it dying at this line.

T result = safe_cast<T>( T::typeid->InvokeMember( "FromPointerReflectionThunk", flags, nullptr, nullptr, args, CultureInfo::InvariantCulture ) );

Which again tells me that the method is missing. Finally I realized (thanks to this thread) that I needed to specify a type that did have the method. Adding <Texture2D> to the return type of FromSwapChain fixed the problem. F# was inferring the type to be Resource. The following works.

let result, device, swapChain = Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.None, swapChainDescription)
let resource = Resource.FromSwapChain<Texture2D>(swapChain, 0)

PARTNERS