Questions tagged [directx11]

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

115 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
2 answers
539 views

Why isn't my cbuffer updating?

I am really frustrated because my cbufer isn't updating. This is my VS: ...
Daniel Hop's user avatar
4 votes
0 answers
133 views

Flicker when drawing multiple shapes over image based texture

I'm rendering video frames with multiple color filled shapes over it using SharpDx and D3D11. Rendering seems to be fine when just rendering the video frame and is as expected. Now if i draw a ...
Kartik150's user avatar
  • 163
4 votes
0 answers
879 views

DX11 CreateTexture2D

When i want to load texture i can either call CreateTexture2D without passing pointer to texture content passing Default usage and call ...
Grigory's user avatar
  • 141
4 votes
0 answers
284 views

How do you fix wobbling shadow edges?

I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really ...
SvinSimpe's user avatar
  • 215
4 votes
0 answers
2k views

How do I sample a cubic shadow map in DirectX 11?

I've implemented a cubic shadow map for dealing with omni-directional light sources in my scene. By defualt it produces hard shadows Obviously a shadow map with higher resolution (currently using ...
SvinSimpe's user avatar
  • 215
4 votes
0 answers
244 views

DX 11 Specular Highlights in Deferred Renderer

I am currently implementing a deferred renderer in DX11.1. Right now I am having a problem that I can't seem to crack with specular highlights when I have multiple light sources. I keep a vector of ...
Patrick Purcell's user avatar
4 votes
0 answers
394 views

1:1 mapping of texels to pixels with DX11 and multisampling and linear interpolation

Is it possible to get a 1:1 mapping of texels to pixels on a multisampled target in DX 11 with interpolation? It seems to me that the texture coordinate used in the shader is always one of the sub-...
ltjax's user avatar
  • 851
4 votes
1 answer
915 views

HLSL Buffer<> Data Type

I'm working on converting a dx11 shader from a .fx file for use in Unity3D and I'm a little puzzled by the HLSL Buffer<> type declared in the shader. More specifically, what are these and how can I ...
Jeremiah Leslie's user avatar
3 votes
1 answer
213 views

How Can I Match the Windows Cursor Latency with a DirectX Rendered Cursor?

My Win32/DirectX 11.1 project requires that I render the mouse cursor myself rather than use the system cursor. This is easy enough; however, I've found that there is a human-perceptible latency when ...
Matthew Elkins's user avatar
3 votes
0 answers
280 views

How to make use of resizable BAR?

From what I understand, resizable BAR (aka. Smart Access Memory) makes it possible to access the whole GPU memory from CPU code. But how can a programmer make use of that? Is there an example or code ...
thalm's user avatar
  • 227
3 votes
0 answers
478 views

Performance of ClearRenderTargetView

While profiling GPU usage in VS2017, I've noticed a strange disproportion in performance of ClearRenderTargetView compared to ...
vines's user avatar
  • 131
3 votes
0 answers
181 views

Simulating wind (vertex bending)

Right now I'm using the Crytek vegetation bending technique, vertex colors control how much force is applied to the branches, leafs and trunks. I have it working and it looks nice but I'm just using ...
Justin William Stanley Bryant's user avatar
3 votes
0 answers
698 views

Struggling with simple orthographic projection for a 2D setup

I'm trying to build a simple setup for 2D using SharpDX. Basically I want to supply my vertices in classic Cartesian coordinates: X-right, Y-up, starting with (0,0) in bottom-left corner. I've had ...
Petr Abdulin's user avatar
  • 2,711
3 votes
0 answers
134 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 ...
Vladimir Panteleev's user avatar
3 votes
0 answers
275 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 ...
Jaanus Varus's user avatar
3 votes
0 answers
390 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 (...
Roy T.'s user avatar
  • 10.2k
3 votes
0 answers
1k views

Geometry Shader and Stream Output with Directx11

I am having trouble trying to send verticies generated in the Geometry Shader to Stream Output. What I am trying to accomplish is to generate verticies from the Geometry Shader and store them to a ...
lexro's user avatar
  • 31
2 votes
1 answer
185 views

Depth func LESS EQUAL not working as expected

How is it possible that a fragment is generated, passes the depth test but isn't written to the current render target? This is the pixel history I see if I capture a frame in RenderDoc: The fragment ...
leone ruggiero's user avatar
2 votes
0 answers
115 views

Calculating light in tangent space

Just a simple question. To do lighting in tangent space, just take the transpose of the TBN basis Matrix and multiply that against the light direction. Is that right? Here is my code ...
terry's user avatar
  • 29
2 votes
0 answers
479 views

RWTexture3D in Compute Shader on Intel HD 4000

I'm having some weird issues running a Compute Shader with DirectX 11 on an Intel HD 4000 GPU. The goal is to write different shapes into a DXGI_FORMAT_R32_FLOAT 3D Texture with a size of ...
Lukas F.'s user avatar
  • 121
2 votes
0 answers
312 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 ...
BoyUnderTheMoon's user avatar
2 votes
0 answers
666 views

Directx 11 full screen

I build simple directx 11 application in c++ that draw square to screen. Also check in the end of the program when I close the last peace of directx the number of free reference. This work great in ...
amit's user avatar
  • 93
2 votes
0 answers
386 views

PSSM and tightening the split frustrums

So I have implemented PSSM which currently does not care about the objects in the scene, meaning alot of resolution is wasted on empty space. This image shows the bottom two splits wasting alot of ...
KaiserJohaan's user avatar
  • 1,464
2 votes
0 answers
178 views

Realtime local reflections of particle system

I'm finding my way around CryEngine 3 (through Steam) and want to create a simple effect where a fire on shore is reflected in a body of water. For testing purposes, I've made the water dead calm... ...
Basic's user avatar
  • 1,267
2 votes
0 answers
186 views

Stereo 3D: drawing 2D elements at apparent screen depth

I'm developing an application making use of DirectX11's stereoscopic features. At such I am not relying on nVidia's automatic implementation. That means I have to replicate a way to render 2d elements ...
TheWanderer's user avatar
2 votes
1 answer
110 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, w)...
Frabu's user avatar
  • 121
1 vote
0 answers
77 views

Blue color instead of alpha using Alpha Blending

I am testing rendering with alpha blending state according to this guide. The aim is to add snow on terrain grass texture. Finally, I got the wrong result -- the blue color fillings up all alpha = 0 ...
Dmitry Kozlov's user avatar
1 vote
0 answers
424 views

Setting an array in the HLSL shader

I have a array of six float4x4's in my shader. cbuffer pseudeocb { float4x4 Mypseudo[6]; }; I need to set these in my code. ...
terry mobley's user avatar
1 vote
0 answers
101 views

Alpha is not working in diffuse light shader

I am following this tutorials series on rastertek.com and I got a bit stuck on the Diffuse Lighting Tutorial. Particulary, the part that does not work for me is alpha channel of the light color. Here ...
lolbas's user avatar
  • 111
1 vote
0 answers
905 views

How do I wrap my custom texture to a quad using DX11 and C++?

I have manually cut out some textures from a sprite sheet and saved them as individual files for now, and I am trying to load in this png and apply it to the quad I have drawn on the screen, but for ...
jjmcc's user avatar
  • 233
1 vote
0 answers
735 views

Is there a quick-reference card for HLSL (DX9 or DX11)?

Does anyone know of a DX9 or DX11 counterpart to the GLSL quick-reference card from Khronos? The GLSL card is pages 8-11 here, and lists preprocessor directives, operators, types, and builtin ...
cxw's user avatar
  • 155
1 vote
0 answers
215 views

HLSL - GPU Performance Impacts of degenerate triangles

The background: After refactoring some code last night and realising I have had an issue that may of been impacting GPU performance. My particle system uses the geometry shader to expand a single ...
ErnieDingo's user avatar
  • 1,150
1 vote
0 answers
270 views

How to composite my UI render target over my backbuffer?

I have two render targets, the back buffer and another target that I am using to draw UI (at the moment this is only a quad on-screen). I have gone through the graphics debugging and checked that ...
user9942393's user avatar
1 vote
0 answers
2k views

Copying a ID3D11Texture2D created by one device without the D3D11_RESOURCE_MISC_SHARED flag to another device

I'm writing a native plugin for Unity that is responsible for presenting the rendered Unity scene in a separate window with its own swap chain and an associated device and context all owned by the ...
Papouh's user avatar
  • 111
1 vote
0 answers
128 views

how to debug calculating tangent space

[][]2 there's problem calculating tangent space and look.... it seems there is no problem with UV code and my shader is 100% no problem. I just copy and pasted tutorial code which works well.. I ...
yunsungjuns's user avatar
1 vote
0 answers
1k views

Passing an UAV to a Pixel Shader in DirectX11

I have a compute shader which task is to take an input image and then blur it using a Gaussian filter approach. The input and output for the compute shader looks like this: ...
Riggs's user avatar
  • 69
1 vote
0 answers
679 views

OpenGL to DIRECTX RayCasting and Picking

Im doing some ray casting and picking from a book that is Open GL. I Get perfect movement on the x and y(I rotated the grid 90 so it would match the x and y. Buy when I try to put it on the the z axis,...
Terry's user avatar
  • 21
1 vote
0 answers
156 views

Clipping wrong results in C++ DIRECTX 11

Im trying to do some clipping but having some weird results. The triangle is not getting clipped how it should be. Here are some images. The second image is how it should. video of what is happen ...
Terry's user avatar
  • 21
1 vote
0 answers
174 views

Integrating ogre3d with hololens

I would like to integrate ogre3d with directx and c++ using hololens. is it that possible to do so ? what are the steps to convert the rendering engine, what's rendered to the frame buffer to the ...
andre ahmed's user avatar
1 vote
0 answers
422 views

Cascade Shadow Map Problems DirectX 11

So after fixing all my lighting and shadow problems that my new terrain system showed me that I had I have an issue with my shadow maps, I have had it since my XNA days but because of my world setup, ...
Justin William Stanley Bryant's user avatar
1 vote
0 answers
1k views

how to properly rotate in directX11

I am trying to Rotate a textured quad in directX however I think i am missing something. I am pretty sure it is because i am applying transformations to the WorldMatrix instead of the ObjectWorld, ...
naahn's user avatar
  • 11
1 vote
0 answers
230 views

How to create a texture2d from an array of pixels in DirectX11

I currently have a ray-casting camera that holds an array of pixel colors (XMFLOAT4 color) that is 1024x768. I am trying to create a Texture2D in DirectX11 that is also 1024x768 and simply copy over ...
jstan's user avatar
  • 11
1 vote
0 answers
138 views

rendering a terrain

I'm trying to render a terrain using directx 11 and applying a heightmap to it. I load the heightmap then I copy it to a integer vector, then for each vertex position I assign the Y position of that ...
ahmed andre's user avatar
1 vote
0 answers
181 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 ...
BlueFrog's user avatar
  • 111
1 vote
0 answers
938 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 ...
eShredder's user avatar
1 vote
0 answers
700 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 ...
aaronsnoswell's user avatar
1 vote
0 answers
102 views

Applying two Vertex shaders on two models with the same pixel shader

I want to apply two HLSL vertex shaders on two different models but with the same pixel shader. What I've done is wrong but I don't know how I can use both vertex shaders with one pixel shader (and I ...
Nathan Drake's user avatar
1 vote
0 answers
80 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.
user74076's user avatar
1 vote
0 answers
237 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 ...
Shawn Eary's user avatar
1 vote
0 answers
162 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 ...
James0124's user avatar
  • 230