Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
28 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
18 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
23 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
21 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
69 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
16 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
37 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
37 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
28 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
25 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
52 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
60 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
52 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
22 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
57 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
73 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
43 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
104 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
67 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
75 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
84 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
84 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
76 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
66 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 ...
0
votes
1answer
38 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
323 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
0answers
13 views

How do I calculate the dimensions of the image in the viewport?

The Situation: I have a quad in 3D space the is texture with an image. The Problem: I need to calculate the width and height in pixels at the Z depth the quad is at.
0
votes
0answers
14 views

How can I keep my cameras synchronized in two different 3D environments?

The Situation: I have two identical controls that render an image to a quad in 3D space. The camera can move on the x, y, z axis' however the Camera position and target are always sync'd to each ...
0
votes
2answers
91 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 ...
1
vote
1answer
48 views

How to organize passing data to shaders in cross-API render system?

I try to create rendering system that supports DirectX and OpenGL. I am trying to create class for constant buffer, but DirectX constant buffers and OpenGL uniform buffers have different memory ...
3
votes
1answer
76 views

How to identify individual keyboard keys across devices from different locales

I'm trying to make a UI system that adapts images for key binding depending on the keyboard type (azerty/qwerty/etc). For the moment I've done the binding with DirectInput Key Codes so it does not ...
1
vote
1answer
120 views

Why is my call to SetDisplayMode not supported?

I have some legacy DirectX code that always returns DDERR_UNSUPPORTED. I originally developed the code using DirectX3, and I am porting it to DirectX7 after ...
0
votes
1answer
56 views

CompileFromFile syntax error upon compilation

I am using visual studio c++ 2003 edition and I am trying to use the function CompileFromFIle function from DirectX SDK February 2010 SDK to add bloom to my source code for a mod I am working on and I ...
0
votes
1answer
114 views

Grainy texture from distance

I am using SharpDX, a C# wrapper over DirectX 11 to render terrain. While I am able to render terrain correctly, I noticed that moving around creates a lot of visual noise and makes the texture of ...
0
votes
1answer
138 views

Access a ID3D11Texture2D in another thread

I created a ID3D11Texture2D texture on a thread with DirectX graphics and I passed its pointer to a worker thread. I'm assured that the creator thread will no ...
0
votes
1answer
31 views

Can I used a NES USB controller with XInput?

I'm doing a project to graduate from my game design degree and I have to recreate two levels from MegaMan(1987). I saw that there are usb nes controllers out there that are used for emulators on PC. ...
0
votes
0answers
55 views

Is it possible to render two scenes at a time

Is it possible to draw multiple quads at the same time without combining them? Like say I want to do a effect on a object and render the rest of the object normal in the scene. IS THAT possible or ...
0
votes
0answers
51 views

Quads and post processing

I'm doing post processing, different effects. In my scene however, there is overlapping happening when doing Distortion mapping. Picture below. As you see, the distortion, or haze is on the box. But ...
0
votes
0answers
10 views

Can I get the pixels in width and height of the displayed area in the view port at differnt z axies?

What I am trying to do is simulate magnification. Currently I have a camera that moves in and out along the z-axis. The camera does not tilt. I'm trying to determine how far or close the camera is ...
0
votes
0answers
177 views

How to find tangent vector for Normal Mapping [duplicate]

Im doing some normal mapping. How do I find the tangent vector off of the normal of the object? thx
0
votes
1answer
116 views

Specular light for DirectX11

I illumine model through model illumine of Phong. Ambient and diffuse light’s constituent work well, but specular works wrong. Under this message I sent screenshoots: 1) ambient and diffuse 2) ...
1
vote
0answers
119 views

What's wrong with my normal mapping, and how can I fix it?

I'm trying to implement Normal Mapping in Directx and I'm very close to creating it but I'm getting these weird black colors on some objects. This is how it looks like without the Normal Mapping: And ...
0
votes
0answers
36 views

How are the variables for D3D11_BUFFER_RTV used?

https://msdn.microsoft.com/en-us/library/windows/desktop/ff476093(v=vs.85).aspx ...
0
votes
1answer
42 views

Why are the vertices from a mesh not transforming using a camera?

I am able to use a camera class to change the view and rotation of a simple quad, so I know it works, but when I move on to a more advanced geometry, such as a mesh, I am unable to affect the ...
2
votes
2answers
371 views

How do multiple render targets get rendered onto the back buffer(s) then screen?

I'm using DX11. I understand how render targets are created, set, and why they are used, but I am really unsure how this all plays together with presenting it to the screen. Does the GPU ...
0
votes
0answers
25 views

Determine if 2D-projected point is visible

I render a model and do have various 3D points around the surface of it. Because it's easier and I'm already using D2D for UI rendering, I implemented it so that these points are rendered as 2D points ...
2
votes
1answer
1k views
0
votes
1answer
48 views

SharpDX Y position inverted

I am currently drawing objects and it works perfectly, when i make x bigger the objects go right and when i make x lower they go left perfect, but when i make y bigger the object goes down and when i ...
0
votes
1answer
53 views

Direct3D 12 STATE_CREATION ERROR #649: CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE

Every time my constant buffer helper creates the "Constant buffer view" with the CreateConstantBufferView method i get an error which states: D3D12 ERROR: ...
1
vote
1answer
322 views

Pixel Shader stage did not run

I can't figure out why the pixel shader won't run. I'm using the Blinn-Phong per-pixel shader from here. Only change I've made is that I pass an aditional color per vertex which gets multiplied by the ...