directx

How can I get a vector type in C#?

二次信任 提交于 2019-12-10 02:02:08
问题 I want to use Vectors in a C# application I'm writing, sepcifically a Vector3. What's the best way for me to get a Vector type without writing my own? 回答1: I used one in a POC that I found on CodeProject. It's not ideal, but it worked for our situation. At the time, however, it did not have a method to reflect a Vector3 about a given normal, but that may have changed since then. If you don't mind using DirectX (some stay away from it for whatever reason), then there is a Vector3 type in that

SharpDX: Enabling BlendState

谁都会走 提交于 2019-12-09 20:29:48
问题 I'm trying to get the "SharpDX.Direct3D11.DeviceContext.OutputMerger.Blendstate" to work. Without this, i have nice scene (Polygones with textures on it, for a Spaceshooter). I've done OpenGL Graphics in the past three years, so i thought it might be as simple as in OpenGL - just enable Blending and set the right Dst/Src Modes. But if i set a new BlendStateDescription, all Output is Black, even if "RenderTarget[x].IsBlendEnabled" is set to "false". I searched for a tutorial or something, and

Matrix mult order in Direct3D

江枫思渺然 提交于 2019-12-09 13:23:15
问题 I've received two conflicting answers in terms of multiplying matrices in Direct3D to achieve results. Tutorials do state to multiply from left to right and that's fine but it's not how I would visualize it. Here's an example: OpenGL (reading from top to bottom): GLRotatef(90.0f); GLTranslatef(20.0f,0,0); So you visualize the world axis rotating 30 degrees. Then you translate 20.0 on the now rotated x-axis so it looks like you are going up on the world y-axis. In Direct3D, doing: wm = rotatem

How can I use WPF's D3DImage with managed DirectX or XNA?

做~自己de王妃 提交于 2019-12-09 12:57:07
问题 I'd really like to get into some D3D coding, but I don't have the time lately to learn C++ for what will amount to a hobby project. 回答1: If you're looking for a managed way to do Direct3D programming, I would recommend SlimDX. It's an open source .NET wrapper over DirectX. Since managed DirectX is not being supported any longer by Microsoft, this is a good way to use managed code with D3D. It's updated quite frequently and I've had very good luck using it thus far. There's a thread here that

General purpose compute with Vertex/Pixel shaders (Open GL / DirectX)

随声附和 提交于 2019-12-09 12:54:59
问题 I have a question regarding compute shaders. are compute shaders available in DX 9? would it be still possible to use a compute shader with a DX9 driver if there is no compute shader fragment on the GPU? ( SGX 545 does not have it, but SGX 6X generation is going to have it), as far as what IMG says. I would like to know If i can do some simple general purpose programming on SGXs GPUs with DirectX9 or OpenGL drivers. Also, is there anyway I can use OpenGL vertex shaders for GPGPU programming?

GOP setting is not honored by Intel H264 hardware MFT

岁酱吖の 提交于 2019-12-09 12:22:05
问题 Problem statement: Intel hardware MFT is not honoring the GOP setting, resulting in more bandwidth consumption in realtime applications. The same code works fine on Nvidia hardware MFT. Background: I'm trying to encode NV12 samples captured through DesktopDuplication APIs to video stream using MediaFoundation H264 hardware encoder on Windows10 machine, stream and render the same in real-time over LAN. Initially, I was facing too much buffering at the encoder as the encoder was buffering up to

GUI API for directX? [closed]

假如想象 提交于 2019-12-09 06:55:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Is there any GUI API that can be used together with DirectX other than MFC, WIN32, Winforms and WPF? 回答1: If you're doing your own DirectX rendering, you can use any GUI technology for windows that exposes an HWND. Just use the "panel" equivelent in whatever toolkit you want, and feed it's handle (HWND) into

DirectX 11的初始化

北城余情 提交于 2019-12-09 00:05:30
总体来说可以概括为以下几个步骤: 创建Device和Context 创建SwapChain 为BackBuffer创建View 创建Depth/Stencil Buffer,并为之创建View 将View绑定到Context中 设置Viewport 创建Device和Context HRESULT D3D11CreateDevice( IDXGIAdapter *pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, const D3D_FEATURE_LEVEL *pFeatureLevels, UINT FeatureLevels, UINT SDKVersion, ID3D11Device **ppDevice, D3D_FEATURE_LEVEL *pFeatureLevel, ID3D11DeviceContext **ppImmediateContext ); 主要调用D3D11CreateDevice创建ID3D11Device和ID3D11DeviceContext。接口说明可以查看API文档。这里注意第四个参数Flags。在Windows10系统下,如果要设置为D3D11_CREATE_DEVICE_DEBUG,则必须安装DirectX Graphics Tools。 参见

A function like “glReadPixels” in DirectX / SharpDX

南笙酒味 提交于 2019-12-08 20:38:11
问题 I'm searching for a way to read a pixels color at the mousepoint. In OpenGL it was done by calling the function "glReadPixels" after drawing the scene (or parts of it). I want to make a simple color picking routine in the background, for identifing a shapes / lines in 3D Space. So, is there any equivalent method/function/suggestion for doing the same in SharpDX (DirectX10 / DirectX11) ? 回答1: This is perfectly possible with Direct3D11: simply follow these steps: Use DeviceContext

Loading/Creating an image into SharpDX in a .NET program

丶灬走出姿态 提交于 2019-12-08 19:21:14
问题 I'm trying to use SharpDX to create a simple maze-like 2D program using DirectX. To that end I want to create bitmaps that I can render on-screen for the walls, hallways, outside of the maze, etc. However, I can't seem to figure out how to either load an existing image file into the Bitmap class in the SharpDX library, or how to create a new such Bitmap class from scratch. Since all the classes are said to be mapped directly to DirectX types, I guess this just means I need to learn more