slimdx

Strange “The type arguments for method cannot be inferred from the usage.”

◇◆丶佛笑我妖孽 提交于 2019-12-13 03:20:23
问题 I'm scratching my head over trying to implement some code to share textures between D3D10 and D3D11 in SlimDX. This method is causing the problem: public void InitialiseTextureSharing() { // A DirectX10 Texture2D sharing the DirectX11 Texture2D sharedResource = new SlimDX.DXGI.Resource(textureD3D11); textureD3D10 = device10_1.OpenSharedResource(sharedResource.SharedHandle); // This fails to compile! } I get the following error from the compiler: The type arguments for method 'SlimDX

Multiple Render Targets not saving data

折月煮酒 提交于 2019-12-12 08:13:19
问题 I'm using SlimDX, targeting DirectX 11 with shader model 4. I have a pixel shader "preProc" which processes my vertices and saves three textures of data. One for per-pixel normals, one for per-pixel position data and one for color and depth (color takes up rgb and depth takes the alpha channel). I then later use these textures in a postprocessing shader in order to implement Screen Space Ambient Occlusion, however it seems none of the data is getting saved in the first shader. Here's my pixel

Rendering from WPF's internals to a Directx application

て烟熏妆下的殇ゞ 提交于 2019-12-12 07:57:41
问题 I have a WPF application that is intended for overlaying a HUD in a live stream. The original idea was to create a plugin for xsplit (a popular application for presenting live streams) to display the content of the WPF application. The problem with this approach is that rendering a bitmap to the COM interface of xsplit is far to damaging in CPU performance to release the application (As I believe there are issues in xsplit's COM interface as well as using RenderTargetBitmap taxing the CPU). I

SlimDX Device.Reset crashes with a “D3DERR_INVALIDCALL: Invalid call (-2005530516)” error

末鹿安然 提交于 2019-12-12 07:19:32
问题 We recently upgraded from VS 2005 to VS 2008 (Windows XP). We use SlimDx in one of our projects. All was working ok after the upgrade, except my Recover function, which gets called on devicelost/device reset which crashes with D3DERR_INVALIDCALL: Invalid call (-2005530516) I use Ctrl - Alt - Del and then Escape to simulate device lost. void Recover() { try { if (res.Code == D3DERR_DEVICENOTRESET) { res = m_device.Reset(m_presentParams); //Crashes on this. if (res.IsSuccess) { m_deviceLost =

Convert SlimDX.Direct3D11 Texture2D to .Net Bitmap

走远了吗. 提交于 2019-12-11 13:19:59
问题 Converting an .Net Bitmap to a SlimDx Texture2D works very fast like this: http://www.rolandk.de/index.php?option=com_content&view=article&id=65:bitmap-from-texture-d3d11&catid=16:blog&Itemid=10 private Texture2D TextureFromBitmap(FastBitmapSingle fastBitmap) { Texture2D result = null; DataStream dataStream = new DataStream(fastBitmap.BitmapData.Scan0, fastBitmap.BitmapData.Stride * fastBitmap.BitmapData.Height, true, false); DataRectangle dataRectangle = new DataRectangle(fastBitmap

Why is this 128Bit Color Format being converted to 32Bit

我的未来我决定 提交于 2019-12-11 09:18:34
问题 I am trying to write an HLSL pixel shader for a project I am working on. Basically want I want to do is if a texture has a pixel with a float value of 0.52 (on scale of 0-255 is 132.6) I want to output 133 60% of the time and output 132 40% of the time. Write now I am just trying to output the fractional remainder of the RGB value (i.e. the chance to bump the pixel up) however I always get a value of zero) I think this is because the colors are getting quantized to a 0-255 scale before they

Detecting a key press

可紊 提交于 2019-12-10 22:36:30
问题 I am currently checking the keyboard state in my program: SlimDX.DirectInput.KeyboardState keyboardState = keyboard.GetCurrentState(); And detecting key presses like this: if(keyboardState.IsPressed(SlimDX.DirectInput.Key.Q))... I can't figure out how to detect ANY key press, rather than specific keys. I can't put my finger on it after trawling through the SlimDX API documentation. I'm probably missing something really simple no doubt. 回答1: KeyboardState class has a PressedKeys read-only

Marshalling C# Structs into DX11 cbuffers

泄露秘密 提交于 2019-12-10 21:44:55
问题 I'm having some issues with (i think) the packing of my structure in C# and passing them through to cbuffers i have registered in HLSL. When i pack my struct in one manner the information seems to be able to pass to the shader: [StructLayout(LayoutKind.Explicit, Size = 16)] internal struct TestStruct { [FieldOffset(0)] public Vector3 mEyePosition; [FieldOffset(12)] public int type; } When i create this struct and set it as my constant buffer in C# it seems to work just fine. I get what

Incorrect Clipping and 3D Projection when using SlimDX

♀尐吖头ヾ 提交于 2019-12-10 18:59:05
问题 I am working on a simple project whereby I wish to display a 3D object within a WinForms application using SlimDX. I have created a small project to do this, but I am encountering a problem where the object I have rendered is being clipped between 0.0f and -1.0f. I have looked at a friend's code for a similar project (they do not have this problem) and cannot work out why it is happening. I've had to restrict the size of my object to the range of -0.1f -> 0.1f in order for me to be able to

SlimDX: Cannot see Direct3D debug output in Visual Studio 2010

我怕爱的太早我们不能终老 提交于 2019-12-10 11:28:50
问题 I've installed the June 2010 SDK Enabled the Debug Runtime in the DirectX Control Panel set the Debug Output Level to maximum (More) Enabled unmanaged code debugging. Result: The debug output from Direct3D is missing However if I start the application externally and use dbgview.exe, the output is shown there. What could be the reason for that? 回答1: After hours of trial and error I found a solution to my problem. Export your settings and check the value of the following setting: <PropertyValue