directx

Projection matrix from OpenGL to DirectX

两盒软妹~` 提交于 2019-12-12 01:00:40
问题 I have an application which uses openGL and i have to port it to DirectX. To sum up my issue : How can I port a rotation matrix based on a right-handed coordinate system to a left-handed coordinate system ? This is what i found on MSDN: Flip the order of triangle vertices so that the system traverses them clockwise from the front. In other words, if the vertices are v0, v1, v2, pass them to Direct3D as v0, v2, v1. Use the view matrix to scale world space by -1 in the z-direction. To do this,

Creating a swap chain with MSAA fails

不打扰是莪最后的温柔 提交于 2019-12-12 00:53:52
问题 When I try to setup a swap chain with MSAA support I get an DXGI_ERROR_INVALID_CALL error - here is the code that creates the swap chain: // Describe and create the swap chain. DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {}; swapChainDesc.BufferCount = frameCount_; swapChainDesc.Width = static_cast<UINT>(rsd.width); swapChainDesc.Height = static_cast<UINT>(rsd.height); swapChainDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swapChainDesc

How can I mix Image with a Video stream from USB capture device using DirectShowLib in C#

假装没事ソ 提交于 2019-12-12 00:05:42
问题 I'm able to show a video stream in a window. I'm using DirectShow VideoMixingRenderer9 in C#. I have created an Image with sometext in it. Now, how can I mix this image with the video stream so that both video stream and text is shown in the capture window. I tried with ISampleGrabber filter but it doesn't work with all video device and capture screan only shows the text with black background but no video stream. So I don't want to use ISampleGrabber filter. 回答1: IVMRMixerBitmap9 interface

Directx - Matrix translation in local axis

泄露秘密 提交于 2019-12-11 23:29:01
问题 I have difficulty for using matrices I can move an object, rotate, and move in word coordinate like these: matScale* matRotate * matTranslate But I don't know how to move an object in his local axis i.e: after rotate, move(0,0,10) i local Z of the object EDIT: Sorry but I'm lost :( I have tried this: D3DXMatrixRotationX(&matRotateX, modell->getPitch()); D3DXMatrixRotationY(&matRotateY, modell->getYaw()); D3DXMatrixRotationZ(&matRotateZ, modell->getRoll()); matRotate = matRotateX * matRotateY

Assimp not properly loading indices

♀尐吖头ヾ 提交于 2019-12-11 22:16:50
问题 I'm trying to load simple 3d model cube.3ds, but next error occurs: when I read indices to my vector, vector contains: [0, 1, 2, 3, ...]. It's not properly. I found almost the same topic: Assimp and D3D model loading: Mesh not being displayed in D3D, but I don't found the answer. Can anyone describe in detail properly algorithm for loading indices from meshes. Thank's a lot! 回答1: Here is a example pulled from the assimp sample code on accessing the mesh indices. for (; n < nd->mNumMeshes; ++n

C++ indicates my highest Shader Model is 3

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 21:21:49
问题 I'm trying to detect what's the highest Shader Model my Graphics Card has in C++ by using if(caps.VertexShaderVersion < D3DVS_VERSION(i, 0)){return false;} where i is the shader model I want to check, but I can only get it up to 3. The problem is I've checked my Graphics Card (Gigabyte GeForce GTX 470) and it has DirectX 11 so shouldn't it have Shader Model 5? Or is there something wrong with the way I'm checking the Shader Model? 回答1: Direct3D 9, which is the API you're using, is not aware

DirectX 11, Combining pixel shaders to prevent bottlenecks

岁酱吖の 提交于 2019-12-11 19:26:45
问题 I'm trying to implement one complex algorithm using GPU. The only problem is HW limitations and maximum available feature level is 9_3. Algorithm is basically "stereo matching"-like algorithm for two images. Because of mentioned limitations all calculations has to be performed in Vertex/Pixel shaders only (there is no computation API available). Vertex shaders are rather useless here so I considered them as pass-through vertex shaders. Let me shortly describe the algorithm: Take two images

SharpDX Not Drawing

一世执手 提交于 2019-12-11 19:06:56
问题 I am trying my hand at writing a simple DirectX 11 application in C# using SharpDX. I am able to set the clear color, and that works, but when I try to draw polygons, they do not show up. I am creating a new Game class in another source file to create the window and draw to it. Game.cs: using System; using System.Linq; using System.Drawing; using SharpDX.Windows; using SharpDX.DXGI; using SharpDX.Direct3D; using SharpDX.D3DCompiler; using SharpDX; using DXMath = SharpDX.Mathematics.Interop;

Error Message when Referencing .dll Files

試著忘記壹切 提交于 2019-12-11 18:56:54
问题 I would like the use DirectInput in my XNA game however I'm having an issue when it comes to referencing the .dll file. I'm using Microsoft Visual Studio C# Express Edition. This is exactly what I do: right click "References" chose "add reference" navigate to the .dll file and hit OK I then receive the following error: As stated above I would like to reference the Microsoft.DirectX.DirectInput namespace but I don't know which .dll file that it's in so I just picked the "d3dref9.dll". Every

Resizing Texture before sending to SinkWriter SharpDX

心已入冬 提交于 2019-12-11 17:32:06
问题 I'm working on Screen recording application. My problem is I need to resize the Texure2d before making sample using CreateDXGISurfaceBuffer. I'm new with Mediafoundation and upon reading the documentation I couldn't find any sample code from the website. I'm using IDXGIOutput1::DuplicateOutput to get the screen texture. Is there a better way to resize the texture without suffering the performance? 回答1: Video Processor MFT can scale your textures. When you use it in Direct3D 11 enabled mode,