Questions tagged [directx]

DirectX is a set of multimedia APIs from Microsoft aimed primarily at game developers. Popular APIs within the DirectX collection include Direct3D, XInput, and XAudio.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

SharpDX (DirectX11) Weird depth behaviour creating pixel error

I'm trying to render a simple terrain but I have a problem with the rendering result. The "blue" (it's the backbuffer clear color) pixels are the ones that I don't know where they come from. The ...
0
votes
0answers
30 views

Retrieving shader byte code using D3D11

I have a shader as an 'ID3D11VertexShader' (or generally any 'ID3D11*Shader') instance. For my application I would like to read the shader byte code that is associated with this instance. The goal is ...
0
votes
0answers
98 views

How to encode captured RGBA frames with H.264/H.265 (NV Codec SDK/AMD AMF)?

I have a desktop application that captures the content of the screen. The result are DirectX 11 2D textures with RGBA8 format. My goal is to stream that captured content to a mobile device with ...
0
votes
1answer
16 views

How to get DXGI_ERROR description?

In a D3D12 program, I encounter a DGXI_ERROR (CreateSharedHandle return an int <0), but I ...
0
votes
0answers
22 views

Dynamic cube mapping with a single draw call

currently i am following the book '3d_game_programming_with_DirectX11' and now i am in 'Dynamic cube mapping using Geometry shader' chapter. This is where i am stuck now. The sample code it's showing ...
0
votes
1answer
37 views

Writing Hull shader in directx

hey i am studying different types of shaders in directx. and it comes to hull shader. so i write hlsl codes for both constant hull shader and control point hull shader in same file in visual studio ...
0
votes
1answer
15 views

creating 2d array texture with mipmap

these day i am working with texture2d array with mipmapping. so this is how i tried so far. my approach load multiple(not textureArray form) textures that i want to set as array from computer folder. ...
0
votes
1answer
22 views

How to draw stencil ref value

hi i am currently implementing UI screen that shows Depth Complexity of scene, so that we can figure out how many time each pixels work for same pixels. for this i need to render stencil ref value. ...
0
votes
1answer
65 views

Resize window in D3D12

I am trying to implement the d3d12 window resizing function. First, I delete all the buffers referenced by SwapChain, and then run SwapChain :: ResizeBuffers. At this point I get the error: ...
0
votes
0answers
21 views

Array textures on Pixel shader

I'm developing on D3D11 and D3D12 in parallel. D3D12 is really difficult, but I learn it gradually. I faced a problem such as passing an array of textures to a vertex Shader. The method ...
0
votes
2answers
67 views

how to generate mipmap, and check if done properly?

i am implementing Mipmapping for my texture for the first time. i have 2 questions HOW TO CHECK IF MIPMAP IS DONE PROPERLY ? HOW TO SET MIPMAP FOR TEXTURE FROM FILE ? First one. i implemented ...
1
vote
1answer
37 views

reading from texture2d resource in directx11

Hi^^ i am trying to read data in resource, which i used to do well without any problems. but suddenly it is not working. first i made immutable resource that has data in it, which is ...
2
votes
2answers
61 views

z ordering in directx11

Hi recently i am trying to implement z ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for ...
1
vote
1answer
64 views

couldn't switch to requested monitor resolution in Windows 7

Run the game,and it shows that it couldn't switch to requested monitor resolution, DX11 could not switch resolution in Windows 7(both 32 and 64 bit ) when I tried to build the game with Unity 2017.3, ...
0
votes
0answers
98 views

Part of the back side of a transparent object disappears

I did some blending and culling to get the image below. As you can see, it is messed up. On the right side of the image, only the front side of the mesh shows. On the left side of this image, it ...
0
votes
1answer
56 views

Synchronizing with monitor refreshes without vsync

What is the preferred way of synchronizing with monitor refreshes, when vsync is not an option? We enable vsync, however, some users disable it in driver settings, and those override app preferences. ...
0
votes
1answer
37 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
0answers
20 views

How to program 3D translate widget like in blender?

Im struggling to achieve the translation widget in my own render engine. Funny enough I thought that widgets are easy, but boy was I wrong... What I want to implement: Where I am having problems: ...
0
votes
0answers
28 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
57 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 ...
1
vote
0answers
63 views

HLSL DXGI_FORMAT_A8_UNORM Texture - dark colors appear less opaque than white

I am trying to render a DXGI_FORMAT_A8_UNORM texture (precisely, a font bitmap) in multiple colors by specifying the color per vertex and then apply the alpha value ...
0
votes
1answer
228 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
3answers
110 views

weird behaviour doing simple XMMATRIX multiplications

I have the following function: ...
0
votes
0answers
38 views

XMMATRIX performance

Dears, I am facing a performance problem when I try to access cell 42 and 43 in XMMATRIX define in DirectXMath.h. The frames dropped by 100 FPS. Here is my code: ...
1
vote
1answer
27 views

What is the difference between D3D12 structures/functions with terminal 1 in the name and without?

I could not figure out the difference between for instance CD3DX12_DESCRIPTOR_RANGE and CD3DX12_DESCRIPTOR_RANGE1. Why do both exist? Which should I use? Is there a general rule of behavior/usage/...
0
votes
0answers
29 views

Why is there 2 viewport in D3D12Fullscreen sample? What is sceneviewport for?

In Microsoft's DX12 sample, there are 2 viewports (with 2 scissors, and 2 heap descriptors). It seems that only the postviewport is used (at each resize, ...
0
votes
0answers
66 views

DirectX sampling a Texture2DArray interpolates between textures unintentionally

I'm trying to texture my procedurally generated terrain. Previously I used an array of textures e.g. Texture tex[8], however in the shader you can't access this by ...
0
votes
1answer
74 views

How do game devs optimize their games for new CPUs/architectures?

I've learned that DirectX helps devs to program games on a variety of hardware. However, that's the visual/graphics side of things. How do game devs deal with new CPUs or CPU architectures? Is there ...
0
votes
0answers
46 views

Calculating UV Coordinates in domain shader

Dears, I was trying to implement the terrain tutorial in Introduction to game programming by frank luna. I succeeded to implement it using the effect file. When I try to separate the Vertex, hull, ...
0
votes
1answer
54 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
0answers
50 views

Perspective projection matrix with a non-orthogonal near plane

I'm trying to figure out a way to provide such a perspective projection matrix to a shader that the "near" plane wouldn't necessarily be orthogonal to the camera vector. More specifically, I'm ...
0
votes
0answers
64 views

DirectX 11 - Input Assembler - Vertex Shader Linkage error - SpriteFont

I'm trying to render text in my DX11 project, by using SpriteFont and SpriteBatch. Everything worked before adding the code in,...
1
vote
0answers
36 views

How do I get the proper swapchain enumeration for getting the backbuffer?

I have code that I'm trying to update from DirectX 8, and so far I have been doing just fine until I reached this line of code: ...
0
votes
1answer
93 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 ...
1
vote
1answer
136 views

Getting AABB Collision to work - C++

I've been trying for weeks to get AABB collision set up on my DX11 project. So far, I have a 'condition' set up in place, so that when both cubes collide the 'light' cube will show within the scene. ...
0
votes
0answers
105 views

XNA 4.0 C# How to draw cube with the index method

EDIT NOTE: I was trying to impliment indexing to my code instead of instancing. I left the indexing method because in my case, I don't need to use it. Preview Untill now I have drawed my cube with ...
0
votes
1answer
84 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
72 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
97 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 ...
0
votes
1answer
57 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
2answers
202 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): ...
0
votes
0answers
207 views

What are these leaked objects?

I'm working on the fifth iteration of my game engine, this time in C++ and Direct3D12. While I was working on supporting delayed object deletion, I started getting messages on the console about ...
1
vote
0answers
294 views

Why are committed resources better than placed resources?

This NVIDIA document regarding dos and don'ts in DirectX 12 states the following: Use committed resources where possible to give the driver more knowledge This allows the driver to better ...
1
vote
1answer
88 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 ...
1
vote
0answers
158 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
292 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
131 views

Directx 12 Root signature compatibility with pso

Can you bind a different root signature than the one that pipeline was created with? If so does it have to have exactly the same parameters or could it have like one more but the pipeline will ignore ...
1
vote
1answer
50 views

Why are points adjusted using the projection and inverse view matrix during picking?

I am working on my first 3D game, which contains several vehicles placed on a board. I want to implement mouse picking of the vehicles. I found this great tutorial and used its code. But I don't ...
0
votes
1answer
570 views

How do I draw text using DirectX 12?

I'm currently tasked with porting a control from Direct 11 to DirectX 12. How do I draw text on the screen? How do I draw any 2D on a DirectX 12 device? Current Text rendering code is below: <...
0
votes
1answer
191 views

Loading texturecube using DirectXTK DDSTextureLoader

I've been trying to implement a skybox for some time now and there's probably only a tiny problem left to solve. When I load a texture using DirectXTK's CreateDDSTextureFromFileEx with a TEXTURECUBE ...