DirectX 11 is the primary graphics API for Microsoft platforms including Windows, Xbox One, and Windows phone.

learn more… | top users | synonyms (2)

0
votes
2answers
149 views

Screen point to world space conversion

I have a 3D cube that can be rotated with the mouse to show any side of the sphere.I want to be able to click a point on the cube and draw a circle around that point at a fixed height(so i dont need ...
-1
votes
1answer
48 views

Sampling in the Compute Shader not working

I'm trying to sample a image in the compute shader. My code is [numthreads(1, N, 1)] void VertBlurCS(int3 groupThreadID : SV_GroupThreadID, int3 dispatchThreadID : ...
1
vote
2answers
201 views

What is DirectX 11's equivalent of D3DCAPS9::MaxVertexIndex of DirectX 9?

I'm porting a DirectX 9 program to DirectX 11. How do I get the value in DirectX 11 that is retrieved using D3DCAPS9::MaxVertexIndex in DirectX 9? Thanks in advance.
6
votes
1answer
181 views

How can I speed up this HLSL shader?

I have written a lighting shader file that is used as the fragment shader part of a deferred lighting pipeline. Unfortunately, each iteration seems to be adding 0.5ms to my frame time, so any more ...
0
votes
0answers
29 views

Geting contents of index bufffer

I would like to copy the contents of an index buffer into the system memory. ie get the array of indices used for the rendering. How would i go about this in directX11? i searched the interweb but ...
0
votes
1answer
50 views

Storing and rendering Mesh Data in stl container

I'm trying to refresh my DirectX11 knowledge, and ran into a problem while trying to render multiple meshes instanced. What I want to do is give my ObjectManager class the name of an .obj file and it ...
1
vote
1answer
39 views

picking 3D objects rendered using instancing

i have a peice of code that renders a 3D image, say a cube. I require 3 cubes in in different locations, this is done using instancing and i am able to render the cube in 3 different locations. ...
1
vote
0answers
46 views

How can I prevent other applications from interrupting my game's exclusive fullscreen mode?

I am developing a game using D3D 11. When I got a pop-up message from a chat client (HipChat), my game's full screen mode is disabled because IDXGISwapChain::Present returns DXGI_STATUS_OCCLUDED. ...
2
votes
1answer
346 views

DirectX11 Equivalent of OpenGL code

I am currently porting parts of my engine over to D3D11 from OpenGL and was trying to figure out how I would accomplish the following blending functions in D3D11. glEnable(GL_BLEND); ...
0
votes
1answer
53 views

Distance per mesh in HLSL directx

I'm subdividing a sphere so when distance gets greater, the sphere is subdivided less to save memory. The sphere changes to another sphere when the distance is 10. My problem is that only one ...
1
vote
2answers
95 views

Does Direct3D 11 enable Z-clipping/discard by default?

I'm rendering simple 2D figures in DirectX 11.1 and I cannot get Z-values to be rendered; all pixels with Z != 0 get discarded. I'm doing proper world transform as far as I know. X/Y translations ...
1
vote
0answers
91 views

Using linestrip and geomtry shader for a ribbon trail effect? Problem with vertex orders

I'm using DirectX 11 and c++ and I've been trying to make a ribbon trail renderer. I was hoping to be able to not have to build every vertex on the CPU side, just keeping the, uuh, "keyframes", or ...
0
votes
3answers
804 views

Direct3D 11 - Mipmap level selection

When we sample a texture resource through an SSO in HLSL, how is the mip level selected for sampling; assuming the texture resource contains mips? The SSO has parameters that seem to be concerned ...
16
votes
7answers
5k views

Modern Shader Book? [closed]

I'm interested in learning about Shaders: What are they, when/for what would I use them, and how to use them. (Specifically I'm interested in Water and Bloom effects, but I know close to 0 about ...
1
vote
0answers
35 views

Direct3D11: Directional Shadow Maps

I've recently implemented shadow maps on my project. However, I'd like to add a feature that allows the light direction to be dynamically changed, so that the terrain can be viewed using different ...
3
votes
1answer
152 views

Efficient vertex buffer memory management?

I am building a voxel engine with a similar mechanism to minecraft(yes, I know...). It works by loading and unloading individual chunks of 16*64*16 cubes each in a square grid around the player. This ...
0
votes
1answer
46 views

Pixel Shader from Visual Studio Graphics Diagnostics

i want to check my pixel shader variables in graphics diagnostics but unfortunately when i click start debugging in pixel history (mentioned below), a new tap will open and says source is not ...
5
votes
2answers
260 views

What are other sources of screen tearing?

I have a DirectX11 based engine / application that is showing screen tearing on a certain system. The system has a large TV monitor with a GTX 980 graphics card. The tearing tends to happen in ...
1
vote
2answers
126 views

Will DirectCompute run this HLSL code

I found a sample about how to run a HLSL code with DirectCompute. https://code.msdn.microsoft.com/windowsdesktop/DirectCompute-Basic-Win32-7d5a7408 This is the HLSL script I want to run ...
3
votes
1answer
95 views

Getting rid of texture bleeding

Edit: I figured out what problem I was facing, it's called Texture/Pixel bleeding, which I was not aware of yet. I posted an answer below consisting of a small description of the problem and a link to ...
5
votes
3answers
278 views

How to pass rendered frames from OpenGL to DirectX 11?

I have a dll that does some rendering using OpenGL. I need to render it to a texture and use that texture in direct x 11. My current attempt has been to render the OpenGL to a texture on one ...
3
votes
0answers
32 views

Bilinear filtering of output image in Direct3D 11

I'd like to render something at one resolution, but display it in a window at another resolution (e.g. render the scene at 640x480 and stretch it to a 1024x768 window). Simply resizing the window ...
2
votes
1answer
530 views

Render to Texture Using Multisampling

I have a DirectX11 application, which has multisampling / anti-aliasing enabled. However, I want to add an effect that requires a render-to-texture step. When I add this extra step, I lose all ...
1
vote
1answer
35 views

Frame timer does not show time

I am currently using DirectX11 and MFC. The top of the window should tell me how long it takes to render the cube (in seconds). At the moment the cube is rendered but when I try to work out how many ...
-2
votes
1answer
73 views

DirectX is difficult sometimes [closed]

I recently started DirectX 11. Sometimes I can't get my head around it. First of all what are COM objects and why we do have to release them? I have done most of initialization, but I am stuck in ...
2
votes
0answers
104 views

Scene Graph: Does anybody have a real world example?

I'm trying to wrap my head around how scene graphs work, and how to apply that to my game, in the context of all my game objects, including assets, cameras, units, shaders, etc. All I can find are ...
0
votes
1answer
153 views

Assimp Texture Coords problem

I've got a problem when loading objects using assimp. I did succesfully load vertex data and I am able to draw static mesh (without bones and animations, I've got few bugs there but I'll go back to ...
1
vote
0answers
66 views

HLSL screen-space to world-space

I'm trying to use RenderDoc to understand how a DirectX11 game engine's vertex shader works, and ultimately recover the world-space positions of vertices. I have captured a frame using RenderDoc, and ...
2
votes
1answer
125 views

When does the memory transfer from CPU to GPU happen when creating a buffer?

I just finished my first DirectX 11 program. But I have several questions on memory transfer between CPU and GPU. In my program, I create a vertex buffer first: bool InitializeGeometry() { ...
1
vote
0answers
39 views

applying two Vertex shaders on two model with the same pixel shader

i want to apply two HLSL vertex shader on two different models but with the same pixel shader. what i've done is wrong but i didn't know how can I use both vertex shader with one pixel shader (and i ...
3
votes
0answers
43 views

Perspective division by zero yields unexpected results

Usually, this is how a shape in clip space is defined: [0.25, 0.25, 0.0, 1.0] [0.25, 0.75, 0.0, 1.0] [0.75, 0.75, 0.0, 1.0] [0.75, 0.25, 0.0, 1.0] After perspective division to NDC space the result ...
3
votes
0answers
60 views

Nothing drawn in Window, not even the clear color

A few years ago I have followed RasterTek's Direct3D11 tutorials to create a simple application in C++. I'm not trying to convert this very simple sample to C# using SharpDX. I've got the Window ...
3
votes
2answers
213 views

How to create a native windows menu / ribbon for a DirectX 11 app

I need to create menu items on top of my DX11 windowed app - similar to most windowed applications (File, Edit, etc...). How can I achieve this ? There is a hMenu handle to pass to the DirectX window ...
1
vote
1answer
974 views

How to render a vertex buffer in DirectX11 C++ (specifically with box2d's b2Draw)

I have all the DirectX11 devices etc setup and working with DirectXTK's SpriteBatch and currently attempting to implement a b2Draw class to draw my box2d physics worlds. I have little idea on how to ...
1
vote
0answers
23 views

Texture coordinate into texel form?

How do I convert a texture coordinate, like 1,0 into a texel form(a single value?). Like in the image below, what is the value of Q22 in texel? I'm in directx 11.
0
votes
3answers
122 views

How do I specify ARGB format textures in my input declaration?

const D3D11_INPUT_ELEMENT_DESC InputLayoutDesc::Basic32[3] = { {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, {"NORMAL", 0, ...
9
votes
1answer
9k views

DirectX11, how do I manage and update multiple shader constant buffers?

Alright, I'm having a hard time grasping how constant buffers are bound to a pipeline stage and updated. I understand that DirectX11 can have up to 15 shader-constant buffers per stage and each buffer ...
2
votes
1answer
157 views

World, view, projection matrix?

What does multiplying an object in local space with a WVP(world,view,projection) matrix do? My book says "local space to homogeneous clip space" Luna, Frank D. (2012-05-21). Introduction to 3D Game ...
1
vote
1answer
51 views

ID3D11Buffer and std::array : buffer looks empty

I am having trouble at rendering vertices stored in a std::vector. // Create and initialize the vertex buffer. D3D11_BUFFER_DESC vertexBufferDesc; ZeroMemory(&vertexBufferDesc, ...
1
vote
1answer
126 views

ID3D11Device::CreateInputLayout: Encoded Signature size doesn't match specified size

I get [ STATE_CREATION ERROR #161: CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE] with the following code: // Vertex data struct VertexData { XMFLOAT3 v; XMFLOAT2 vt; XMFLOAT3 vn; }; // ...
1
vote
0answers
42 views

What is Purpose of pIntermediate in UpdateSubresources?

DX11 used ID3D11DeviceContext::UpdateSubresource but now DX12 seems to use a new method UpdateSubresources. I think I can figure out most of the differences between these two functions but the ...
1
vote
1answer
64 views

DirectX 10 - dimension of vertices passed to vertex shader

I'm trying to learn DirectX programming. Looking at different tutorials there is something about vertices that I find a bit confusing. I know that DirectX uses vertices with four elements (x, y, z, ...
2
votes
2answers
129 views

If IDXGISwapChain::Present blocks, does that mean I'm GPU bound?

I updated my DirectX11 renderer to render on multiple threads using deferred contexts. Before my change, the Present method took a negligible amount of time (according to VTune analysis). After my ...
1
vote
1answer
96 views

View Matrix to Texture Matrix

I'm converting view coordinates to texture coordinates for both my shadow maps and Screen space reflections. I keep seeing this conversion in examples: var T = new Matrix { ...
1
vote
0answers
37 views

Is it normal in skeletal animation to NOT consider the translation component in bone transform matrices?

I'm using assimp to load a model, and DirectX11 and DirectX ToolKit to render it. In the document of DirectXTK's IEffectSkinning, it says: As an optimization, SkinnedEffect and DGSLEffect assume ...
0
votes
1answer
186 views

DirectXTK Model : How to draw with custom vertex & pixel shader?

Here is the code I use to render a .cmo (from .fbx) mesh : void Render() { assert(g_d3dDevice); assert(g_d3dDeviceContext); Clear(Colors::LimeGreen, 1.0f, 0); ...
0
votes
0answers
106 views

Screen Space Reflections

Screen space reflections seems very straight forward but for some reason I'm struggling with this. My GBuffer is in View space and depth is z/w. float3 ViewSpaceToScreenSpace(float3 viewSpace) { ...
2
votes
2answers
185 views

How can I test DXGI_ERROR_DEVICE_REMOVED error handling?

My application uses DX11 and it periodically gets a DXGI_ERROR_DEVICE_REMOVED error on startup. It is an infrequent thing (I can go days or weeks without seeing it) but according to the documentation ...
7
votes
1answer
640 views

Strange SSAO effect (wrong position/normal textures in view space?)

I try to create an SSAO effect in my game engine (DirectX 11, C++), based mainly on gamedev.net tutorial by José María Méndez. Unfortunately, it doesn't cover texture-creating problem (normals, ...
0
votes
1answer
190 views

The Pixel Shader unit expects a Sampler configured for default filtering to be set at Slot 0 […]

I don't understand this error. The full output being : The Pixel Shader unit expects a Sampler configured for default filtering to be set at Slot 0, but the sampler bound at this slot is ...