Questions tagged [directx11]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
24 views

Objects World Matrix Issue in Direct3D11

I have an issue with the transform matrix of my cube. When I change its position (world matrix) and rotate the camera, it is getting deformed. Here's my shader update code: ...
0
votes
1answer
51 views

Having some trouble with my frustum checking code

I'm trying to check if a bounding sphere is either within or intersecting my frustum. It mostly works but there are cases where it should and it doesn't. The frustum is made up of 6 planes which have ...
0
votes
1answer
23 views

Sampled texture from bitmap font produces blue glow

I'm creating a texture is DirectX 11 from bitmap fonts. I realize that I can use DXTK, but this is an exercise for me, not in learning another library. My sample code looks like this. ...
0
votes
0answers
24 views

Lighting abnormal when calculating in tangent space. Probably something wrong with coordinate transformation matrix

I'm trying to calculate lighting in tangent space. But I just keep getting abnormal results. I was modifying the book's demo code and I wander if there maybe something wrong with the transformation ...
0
votes
1answer
113 views

God rays shader - Trouble with sun position

I have found a shader that I like here: https://www.shadertoy.com/view/4dyXWy The code for the fragment shader from the link above is: ...
0
votes
1answer
26 views

Why specular reflection work only in center of virtual scene?

How to calculate this cpecular reflection? HLSL ...
1
vote
1answer
123 views

Can't get Direct3D11 depth buffer to work

I can't get the depth buffer to work correctly. I am rendering 2 cubes in a single Draw function, and from one angle it looks great But swing the camera around to view the opposite sides, and I ...
0
votes
1answer
47 views

How can I create a Texture2D out of an array of color data?

I'm trying to make a simple engine with DirectX where you can draw to the screen with a function Draw(x, y, r, g, b). The function sets the pixel at x,y to the color r,g,b. The engine has a parameter ...
0
votes
0answers
36 views

Instancing with Directx11

I'm a total beginner with Directx/3D programming. I need help with implementing hardware instancing on Directx 11. I'm trying to render multiple cubes on the screen, to create some sort of Minecraft-...
2
votes
1answer
99 views

What actions should I perform in DirectX 11 to correctly process Alt+Tab?

What actions, in order, should I perform in DirectX 11 application to correctly process Alt+Tab event from Windows OS? My application is in fullscreen mode. I expect my application to minimize to ...
0
votes
1answer
184 views

How do I draw 2D sprites from a sprite sheet in DirectX 11 without ghosting/artifacts

I'm new to DirectX and I am trying to get my feet wet by making a simple 2D game. I chose DirectX 11 and am using the DirectX ToolKit helper library which recommended I start with DX11 and not DX12. ...
0
votes
1answer
73 views

DirectX depth/order render issue

I have what appears to be a depth or order rendering problem which I have never seen happen before. My terrain and water are rendered with my displacement shader, and at the moment all other models ...
0
votes
0answers
55 views

How to apply a first person weapon image to your directx fps camera

simple question here, I need to know how would you devs and programmers alike add a simple "texture2d" Image of a shotgun to the camera in a fps directx 11 scene I also use a void UpdateCamera(); ...
0
votes
2answers
49 views

d3d11 renderqueue multi pass rendering design best practice

The goal: issue least calls to d3d11 ImmediateContext and render advanced effects like toon / outline / anything that requires rendering the same vertex buffers with at least two different vertex ...
0
votes
1answer
76 views

DirectX 11 generate normals for tessellated triangles

I've spent a couple days looking for an answer to this - How can I access the newly created triangles of tessellation and generate normals for them? I've followed much of the shader code from the ...
2
votes
1answer
121 views

FormatMessage not working for HRESULTs returned by Direct3D 11

I am using Windows 7 x64 and Visual Studio 17 (v15.9.7). Say I try to create a swap chain using IDXGIFactory2::CreateSwapChainForHwnd and pass in ...
1
vote
1answer
28 views

Why is my texture displaying incorrect colours using dx11?

I am trying to load my data from a binary file (ppm) and create a texture using this data. It is important that I learn to do it this way as I am eventually going to be packing all of my textures into ...
1
vote
1answer
81 views

Fix Pixel Shader “Stage did not run. No output”

I'm trying to set up a minimal D3D11 renderer but fail to get the pixel shader stage to run. The available answers here or the ones I found through Google couldn't help me, unfortunately. Using ...
1
vote
0answers
54 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 ...
0
votes
1answer
44 views

Direct3D & Assimp Texture is inverted weirdly!

I'm working on a rendering engine but even on the first mesh is something wrong. I use assimp for mesh importing! In the Assimp Viewer it looks correct: And in my software it looks like this: Look ...
0
votes
1answer
68 views

DirectX11 program bug full screen

I have a problem switching the engine from full screen to normal. I use alt + enter. The problem is this: when I start the engine in full screen and press alt + enter - it hangs. For mode of the ...
0
votes
1answer
43 views

error X4016: SV_InstanceID semantic cannot be used with 10Level9 targets

I'm using a variant of the D3D12 UWP template that comes with VS2017 Community Edition and I have two related questions: When I add this italicized and bolded code to the vertex shader signature, I ...
0
votes
1answer
67 views

Can't figure out why my mouse picking code doesn't work

I am trying to create code to check for intersections between bounding spheres and the mouse. I get a mouse ray but it doesnt seem to point in the direction you think it should Attached is a ...
1
vote
1answer
85 views

Frustum Culling bug in program

I did Frustum Culling in my engine, but it does not work correctly. All shown in the video: Video If the approximation is too close, the model disappears. On the right in the console you can see ...
1
vote
2answers
173 views

Why does my FPS go down so much when rendering basic sprites?

I have a UWP DX11 application and I've recently removed the vsync and noticed that my fps goes down drastically when I'm only drawing very basic sprites on the screen and I'm trying to learn why this ...
0
votes
1answer
51 views

Huge input delay although framerate is stable - possibly related to the DirectX Tool Kit?

I'm in the process of learning how to use the DirectX 11 API and came upon the following problem: Although my rendering function executes quite fast at around 150 fps (as one expects considering how ...
0
votes
0answers
22 views

(C++, DirectX 11, UWP) - How do I update the ByteWidth of a VertexBuffer without recreating it?

I want to have one buffer used for all dynamic properties but the amount of vertices in this could vary from just a few for an interface to the whole scene. As such if it's becomes initialized with ...
0
votes
2answers
147 views

DirectX11 - CreateInputLayout() Vertex shader linkage problem

I keep getting the same error every time, I really have tried everything to fix the problem but it's still not working. Basically I'd like to draw a simple cube. The error(s): ...
1
vote
1answer
21 views

3D Texture Only interpolates on Y-Axis

I'm having trouble wrapping my brain around what actually is the issue here, but the sampler I'm using in my volume renderer is only interpolating the 3D texture along the Y axis. I roughly followed (...
0
votes
0answers
34 views

Render a basic Quad to screen?

I have been trying to accomplish this for quite some time with no success; I've looked at several relevant questions here on StackOverflow with no success; I've also followed 6 different tutorials ...
1
vote
0answers
80 views

“Proper” way to do 2d scrolling game

I am new to game development and I would like to make a 2D scrolling game with a tile based engine. If you want an idea, it should resemble the Legend of Zelda: A Link to the Past like in the image: ...
1
vote
0answers
41 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 ...
7
votes
2answers
2k views

“DirectX will only draw polygons with an [X,Y] from [-1,-1] to [1,1] and with a Z from 0 to 1.”, What does this mean and how to work around it?

I've been following the D3D11 tutorials on Rastertek to expand my knowledge on rendering which I will need as I want to build my own engine, as a hobby. After finally getting a model to be rendered ...
0
votes
1answer
34 views

Typical Point Light Flow?

A Quick Note This question assumes you have some knowledge about the overall rendering process and do not need clarification on rendering objects with HLSL and a <...
0
votes
1answer
54 views

Why does order matter in constant buffers?

I have a rather peculiar question remaining after solving most of my own question on StackOverflow. When creating the constant buffers used by my shaders, I've learned that the order of variables ...
0
votes
1answer
41 views

Extrude only vertices where the assigned texture is transparent?

I am looking at implementing a water surface on my spherical object and have created a texture with transparent pixels where the water should be. However, I am currently confused on how I can extrude ...
0
votes
1answer
144 views

DirectX 11 Compute Shader error DXGI_ERROR_DEVICE_HUNG

I am trying to use a compute shader for ray picking technology. My shader accepts: vertex buffer of all models index buffer of all models a buffer of transformation matrices of all models Offset ...
1
vote
1answer
87 views

Which DirectX Version to use for a low poly game?

Which DirectX Version (10, 11 or 12) is recommended to use, if you want to have a low-poly game with shaders, shadow and aliasing. But not normal or height maps. Moreover my question is, because once ...
0
votes
1answer
134 views

Terrain collision with sphere and OBB

I'm implementing my physics engine for my 3D game. So far I've been able to implement collision detection between OBB, spheres and planes. The engine generate contacts and resolve them with an ...
0
votes
1answer
93 views

Difference between texture.Load and texture.Sample(PointSampler,..) in HLSL/Dx

Conceptually, I understand the difference between load and sample but I want to know if essentially point sampling and load do the same thing when it comes to selecting a texture value (ignoring an ...
0
votes
1answer
199 views

DirectX 11 - Depth Stencil not working

I'm currently working on a game for university in DirectX 11. I have tried to add in a depth buffer to my project, but since adding it in none of my objects show. ...
1
vote
0answers
122 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 ...
0
votes
1answer
151 views

Initializate float4x4 in vertex shader

Forgive me for my English. I am trying to create a 4x4 matrix in vertex shader, but it is not initialized correctly. Why is this happening? Vertex shader: ...
0
votes
1answer
142 views

Implementing a Deferred Renderer (Basic Understanding)

I am trying to implement a Deferred Renderer in Direct3D11. I am fairly new to this. I already bought a book: Practical Rendering & Computation with Direct3D 11. However, this book doesnt answer ...
0
votes
1answer
61 views

How can I ensure my Direct3D 11 shader scripts are not visible to the user?

Right now for my engine, I rely on pixel and vertex shader script text files that I load and compile when I need them. What I am wondering is, how can I store the shader scripts so that they are not ...
1
vote
0answers
44 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 ...
0
votes
1answer
68 views

How would I implement render scaling in a DX11 game?

I would like to implement render scaling that could render a scene at a certain % of the window resolution. How would I do this? I've tried resizing a number of things, then resizing them up or down ...
1
vote
0answers
63 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 ...
0
votes
0answers
32 views

The texture blurs when the window size changes

When i change window size to big size, texture becomes blurred. When window is small, texture is normal. Anisotropic filter is used. With point filter Without mipmaps. Back buffer == desktop ...
0
votes
1answer
51 views

Swapping out Vertex Buffer Necessary for Terrain LOD?

I am using Directx 11 to try and implement terrain level-of-detail. I am trying the idea represented in this tutorial: http://www.rastertek.com/tertut18.html Which is split your terrain into nodes, ...