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
0answers
22 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 : ...
0
votes
1answer
91 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 ...
0
votes
0answers
27 views

How can I write the depth buffer to a texture in D3D?

How can write the depth buffer to a texture? I see a lot of OpenGL examples, but I'm looking for one using Direct3D 11.
6
votes
1answer
157 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
25 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
36 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 ...
3
votes
2answers
41 views

DirectX11 Using Multiple Shaders

I currently have a scenario where I am rendering terrain with a shadow map. I have two passes, one for the depth buffer to create the shadow map (which is rendered to a texture) and a second that ...
0
votes
1answer
28 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
38 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. ...
3
votes
1answer
37 views

Vertex normals in the geometry shader using directx

I'm in directx 11 with the geometry shader. Is is possible to calculate vertex normals? Just one like segment per vertex? In the geometry shader? I did vertex normals per face, this is what I got, ...
0
votes
1answer
21 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 ...
0
votes
1answer
27 views

Full screen quad in the HLSL Directx 11

I want to create a full screen Triangle/Quad so I can blur the box that is the quad I made. I want to do this in the vertex buffer. I tried this code: struct VSQuadOut { float4 position : ...
1
vote
2answers
82 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
57 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 ...
1
vote
1answer
81 views

How can I read the smallest mipmap back to the CPU after calling generateMips?

I'm implementing an adaptive tonemapper based on the standard "scale down the luminance map to a 1x1 texture" approach. This is my code following the rendering of the luminance map: //Average the ...
1
vote
0answers
27 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 ...
0
votes
0answers
24 views

How do I count the number of pixels that pass the depth test. stencil test

I cant seem to understand how to count the number of pixels that pass the depth test or fail. My book gives me: if( StencilRef & StencilReadMask ⊴ Value & StencilReadMask) accept pixel ...
0
votes
1answer
35 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 ...
3
votes
1answer
103 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 ...
5
votes
2answers
223 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 ...
2
votes
1answer
51 views

DX11 Losing Instance Buffer Data

I've got a function that basically creates different instance buffers into an array for me to use in my DrawIndexedInstanced call. But when I pass the vertex buffer and instance buffer through to my ...
3
votes
0answers
23 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 ...
3
votes
1answer
76 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 ...
1
vote
1answer
29 views

DirectxMesh obj to cmo texture coordinates off

I'm having trouble getting the texture coordinates of the cmo to match how the mesh was unwrapped in blender. I am using the directxmesh to convert the obj to a cmo and the directxtk to load the cmo. ...
-2
votes
1answer
67 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 ...
1
vote
1answer
30 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 ...
5
votes
3answers
259 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 ...
2
votes
0answers
82 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 ...
1
vote
0answers
47 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 ...
1
vote
0answers
36 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
38 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
46 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 ...
2
votes
1answer
40 views

Shader constant management problem in DirectX 11

I've been learning the "dragon book" written by Frank D. Luna and trying to implement the part of the demo on my own. As some of you can see, the demo of the book uses effects interfaces to update the ...
1
vote
0answers
22 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.
1
vote
2answers
36 views

Primitives LINESTRIP Closing to the first point?

I'm doing a exercise form the Frank Luna book. It ask to draw a LineStrip that looks like the red line in the picture. I'm using ...
2
votes
1answer
96 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 ...
0
votes
1answer
132 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 ...
3
votes
2answers
178 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
47 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
53 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
33 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 ...
2
votes
2answers
90 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
51 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
31 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
108 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
90 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
1answer
107 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() { ...
2
votes
2answers
150 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 ...
0
votes
1answer
128 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 ...
0
votes
1answer
112 views

Problem with ID3D11DeviceContext::CopyResource method - How to properly read a texture CPU-side?

I am trying to make a full copy from a render target texture to a staging one but it seems my data length ends up being only 4 in length instead of 921600 (1280 * 720). Here is my textures ...