slimdx

Multiple Render Targets not saving data

此生再无相见时 提交于 2019-12-03 15:58:08
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 shader: PS_OUT PS( PS_IN input ) { PS_OUT output; output.col = float4(0,0,0,0); output.norm = float4

What is a good code structure for api-independent vertex processing? [closed]

血红的双手。 提交于 2019-12-03 11:03:53
Currently working on a 3D media engine using C# and I have come across a little conundrum. I have my rending loop figured out, I got a great plug-in architecture and content management system and even a material pipeline all planned out. Then engine is planned to use DirectX and OpenGL (via 'renderer' plug-ins), along with both APIs' programmable pipe-line. Anyways, at the beginning of this week I started on working on the engines abstract layer for processing vertices (I have been dreading this for weeks now). And as some of you know, vertex handling between graphic APIs' is not at all

E_INVALIDARG: An invalid parameter was passed to the returning function

我的未来我决定 提交于 2019-12-02 17:57:59
问题 I'm trying to make simple SlimDX example to test some performance vs GDI and unfortunately I got stuck on the very beginning. I've created simple Console Application in VS2010 and added this code to programs main method: // 0. STEP SlimDX.Direct3D10.Device device = new SlimDX.Direct3D10.Device(DriverType.Hardware, DeviceCreationFlags.BgraSupport); SlimDX.Direct2D.Factory factory = new SlimDX.Direct2D.Factory(); // 1. STEP Texture2DDescription textureDesc = new Texture2DDescription();

Setting up the constant buffer using SlimDX

点点圈 提交于 2019-12-02 09:49:42
问题 I've been following the Microsoft Direct3D11 tutorials but using C# and SlimDX. I'm trying to set the constant buffer but am not sure how to either create or set it. I'm simply trying to set three matrices (world, view and projection) using a constant buffer but I'm struggling at every stage, creation, data input and passing it to the shader. The HLSL on MSDN (which I've essentially copied) is: cbuffer ConstantBuffer : register( b0 ) { matrix World; matrix View; matrix Projection; } The C++

Toggle an input

ぃ、小莉子 提交于 2019-12-02 08:07:19
I am using SlimDX to use my Xbox 360 controller and I would like a way of when pressing a button on the controller the state changes to on and stays on but when I press it again it becomes off. Sort of like a toggle. But I have been unable to do one so far(Just a beginner really). Thanks for any help. Thomas. You may use a bool to determine if the button is toggled on or off. You will also need to know the gamepad's previous state, so the bool won't toggle all the time, just because you keep pressing the button. bool myCommand = false; // declare the bool GamePadState oldState; // you need to

E_INVALIDARG: An invalid parameter was passed to the returning function

我们两清 提交于 2019-12-02 07:55:07
I'm trying to make simple SlimDX example to test some performance vs GDI and unfortunately I got stuck on the very beginning. I've created simple Console Application in VS2010 and added this code to programs main method: // 0. STEP SlimDX.Direct3D10.Device device = new SlimDX.Direct3D10.Device(DriverType.Hardware, DeviceCreationFlags.BgraSupport); SlimDX.Direct2D.Factory factory = new SlimDX.Direct2D.Factory(); // 1. STEP Texture2DDescription textureDesc = new Texture2DDescription(); textureDesc.Width = 512; textureDesc.Height = 512; textureDesc.MipLevels = 1; textureDesc.ArraySize = 1;

Setting up the constant buffer using SlimDX

我的未来我决定 提交于 2019-12-02 07:27:55
I've been following the Microsoft Direct3D11 tutorials but using C# and SlimDX. I'm trying to set the constant buffer but am not sure how to either create or set it. I'm simply trying to set three matrices (world, view and projection) using a constant buffer but I'm struggling at every stage, creation, data input and passing it to the shader. The HLSL on MSDN (which I've essentially copied) is: cbuffer ConstantBuffer : register( b0 ) { matrix World; matrix View; matrix Projection; } The C++ code on MSDN is: ID3D11Buffer* g_pConstantBuffer = NULL; XMMATRIX g_World; XMMATRIX g_View; XMMATRIX g

D3DERR_INVALIDCALL: Invalid call (-2005530516)

六月ゝ 毕业季﹏ 提交于 2019-12-02 07:02:39
I seem to be getting an error when testing on my WinXP(SP3) PC. The error is below but I don't get it when using my Win7 laptop. D3DERR_INVALIDCALL: Invalid call (-2005530516) at SlimDX.Result.Throw[T](Object dataKey, Object dataValue) at SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue) at SlimDX.Direct3D9.Device..ctor(Direct3D direct3D, Int32 adapter, DeviceType deviceType, IntPtr controlHandle, CreateFlags createFlags, PresentParameters[] presentParameters) The code that is causes the error is: using (var d3d = new Direct3D()) { using (var tmpDevice = new

Nvidia 3d Video using DirectX11 and SlimDX in C#

亡梦爱人 提交于 2019-12-01 03:15:26
Good day, I am trying to display a real-time stereo video using nvidia 3DVision and two IP cameras. I am totally new to DirectX, but have tried to work through some tutorials and other questions on this and other sites. For now, I am displaying two static bitmaps for left and right eyes. These will be replaced by bitmaps from my cameras once I have got this part of my program working. This question NV_STEREO_IMAGE_SIGNATURE and DirectX 10/11 (nVidia 3D Vision) has helped me quite a bit, but I am still struggling to get my program working as it should. What I am finding is that my shutter

D3DImage using DX10

徘徊边缘 提交于 2019-11-30 23:58:35
问题 Is it possible to use DirectX 10 (I am using SlimDX) with WPF's D3DImage? The only examples and docs I can find only show using DX9 surfaces. 回答1: Yes, you can use DirectX 10, 11, and DirectWrite using the D3DImage in WPF by creating your render target surface as shared, and then creating a DX9 texture based on that shared texture handle to use in WPF. This means that essentially you can use 10, 11, and DirectWrite the same way you use DX9 with no additional overhead, and no airspace issues.