directx-11

Two problems while initializing Directx 11.0 - 1.FeatureLevel, 2. 4xMSAA quality

╄→尐↘猪︶ㄣ 提交于 2019-12-11 09:46:29
问题 1.I'm learning the initialization part of D3D through the book Introduction to 3D Game Programming with DirectX 11. When I compile and run the code on the book I got a message from VS2012 which says "Direct3D Feature Level 11 unsupported",which indicates my machine successfully creates the device but doesn't support Directx 11. here is the actual code: UINT createDeviceFlags = 0; #if defined(DEBUG) || defined(_DEBUG) createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; #endif D3D_FEATURE_LEVEL

Rendering to texture - ClearRenderTargetView() works, but none objects are rendered to texture (rendering to screen works fine)

拜拜、爱过 提交于 2019-12-11 09:22:35
问题 I try to render the scene to texture which should be then displayed in corner of the screen. I though that I can do that this way: Render the scene (my Engine::render() method that will set shaders and make draw calls) - works ok . Change render target to the texture. Render the scene again - does not work. The context->ClearRenderTargetView(texture->getRenderTargetView(), { 1.0f, 0.0f, 0.0f, 1.0f } ) does set my texture to red color (for scene in step 1. I use different color), but none

Directx 11 With C++: Difference between using constant buffers and SetRawValue()?

大憨熊 提交于 2019-12-11 09:06:31
问题 What is the difference between using SetRawValue() to change values in the shader code, and just updating constant buffers? The example code in my book updates each variable of a constant buffer using SetRawValue(), but I don't see why the author didn't just update the constant buffer with UpdateSubresource(). 回答1: SetRawValue is part of the effects (.fx) support that since DX11 now sits outside of the main code and is supplied as source wrappers that can be used instead of coding directly to

Dx11 Crash when accessing XMMATRIX

假装没事ソ 提交于 2019-12-11 07:23:14
问题 I've been creating a flocking swarm project in DirectX 11 and had an error where I try and create a vector of Pointers to objects and on the 3rd iteration of pushing back it will crash and jump to this: XMFINLINE _XMMATRIX& _XMMATRIX::operator= ( CONST _XMMATRIX& M ) { r[0] = M.r[0]; r[1] = M.r[1]; r[2] = M.r[2]; r[3] = M.r[3]; return *this; } the crash happens when I execute this code: Populate(); for (unsigned int i = 0; i < m_numOfPrey; i++) { m_preyVec[i]->LoadContent(dx, colour, yaw,

How to take CPU memory(UCHAR Buffer) in to GPU memory(ID3D11Texture2D Resource)

心已入冬 提交于 2019-12-11 07:09:22
问题 The code here will run in GPU and capture windows screen, it give us ID3D11Texture2D Resource. Using ID3D11DeviceContext::Map I taking GPU resource in to BYTE buffer from BYTE buffer in to CPU Memory g_iMageBuffer its a UCHAR . Now I want to do reverse engineering, I want to take g_iMageBuffer buffer(CPU Memory) in to ID3D11Texture2D (GPU memory). Please someone help me how to do this reverse engineering I am new to graphical part. //Variable Declaration IDXGIOutputDuplication* IDeskDupl;

DirectX newb - Multisampled Texture2D with depth on a Billboard

谁说胖子不能爱 提交于 2019-12-11 02:46:10
问题 Here's my requirement: Using DirectX11 (via SlimDX) I have to download a series of verteces and use them to create a Texture2D of a map of county borders. Then I need to do the same thing with state borders, and draw them over the county borders. Then, I need to take that texture and create 2 different textures from it, each containing unique radar data. Then I want to take those textures and display them so that the user can look at, for example, base reflectivity and base velocity side by

Understanding ID3D11Device and ID3D11DeviceContext

岁酱吖の 提交于 2019-12-11 02:36:39
问题 I have some problems understanding the difference between ID3D11Device and ID3D11DeviceContext . Is the ID3D11Device a representative of your GPU and ID3D11DeviceContext used for functions, to control the device ? Why do you need 2 objects? Which function do you use with the device and which with the device object? Which object sends the final image to the backbuffer? The back buffer is in the ID3D11RenderTargetView object, isn't it? Which objects are connected to the swap chain, and why? 回答1

D3D11 CreateTexture2D in 32 bit format

不想你离开。 提交于 2019-12-11 01:42:36
问题 Surprisingly I am not able to find any help on the subject, even though I am pretty certain this is quite a basic question. So maybe somebody here could help me to progress on that. I am trying to create a d3d11 texture, mono-channel, 32 bit per pixel. The official documentation is interesting ( http://msdn.microsoft.com/en-us/library/windows/desktop/ff476521(v=vs.85).aspx) and I found this example for a four-channel 8 bits per pixel: ID3D11Texture2D *MakeCheckerboard(ID3D11Device *myDevice)

How to give an option to select graphics adapter in a DirectX 11 application?

我怕爱的太早我们不能终老 提交于 2019-12-10 22:57:37
问题 I think I know how it should work - only it does not. I have a lenovo laptop with a 860m and an intel integrated card. I can run my application from outside with both gpu, and everything works fine: the selected gpu will be the adapter with index 0, it has the laptop screen as output, etc. However if I try to use the adapter with index 1 (if I run the app normally, that is the nvidia, if I run it with the nvidia gpu, that is the intel), IDXGIOutput::EnumOutputs does not find anything, so I

Transferring textures across adapters in DirectX 11

大兔子大兔子 提交于 2019-12-10 20:54:13
问题 I'm capturing the desktop with the Desktop Duplication API from one GPU and need to copy the texture (which is in GPU memory) to another GPU. To do this I have a capture thread that acquires the desktop image then copies it to a staging resource (created on the same device) using ID3D11DeviceContext::CopyResource. I then map that staging resource with Read, map the destination dynamic resource (which was created on the other device) with WriteDiscard and copy the data. On the rendering thread