Stack Exchange Network

Stack Exchange network consists of 174 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
16 views

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

Preview Untill now I have drawed my cube with 36 vertices (2 triangles for each face - in total 12 triangles), but my game performance is bad. I decided to improve the performance by using the index ...
0
votes
1answer
10 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
32 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
63 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
38 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
72 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
39 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
votes
0answers
22 views

Keeping a Third Person Camera at a fixed distance - DirectX 11

I'm attempted to create a third person camera which will rotate around the player as I move the mouse left and right. I've worked out a right vector to move the camera along by which should change as ...
0
votes
0answers
21 views

Direct3D 11 incorrect screenshot (picture is moving)

I want learn how to create screenshots in D3D11. Here code: ...
1
vote
0answers
34 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
votes
0answers
29 views

Confused about Vulkan and dx12 queues

in vulkan when I ask for info about my gpu it tells me that I have 16 graphics queues, I also heard that if you use 2 graphics queues it won't make your program faster, just more complicated since one ...
1
vote
1answer
80 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
68 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
0answers
31 views

Using a light mask overlay without lighting the sky

I'm using an overlay to create a lighting effect in a 2D game. The overlay is a grey-scale mesh and I multiply each pixel of the mesh with the pixel already written to the framebuffer. This works ...
0
votes
1answer
60 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
41 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
35 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
0answers
30 views

BlinnPhongShader error looks like toon shading

I'm following a tutorial on Direct3D11 (SharpDX), and in the Tutorial it looks right: But in my Application it looks really really weird - there's no white specular highlight, and the shading changes ...
0
votes
0answers
49 views

Direct3D11 Constant Buffer empty in Pixel Shader - but it was set

Does anybody know why sometime constant buffers are just empty? I searched this for a long time now but i still got no help. Im using a perFrame, perObject and perMaterial Buffer. I set them witht he ...
0
votes
1answer
223 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
12 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
12 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
72 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
37 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 ...
0
votes
0answers
44 views

Creating a DirectX 11 Render Target crashes when a video recording tool is running

A player told me he wanted to make a video of my game, but when he starts the game it crashes every time. I bought the same video recording tool he is using to test it myself. I could reproduce the ...
3
votes
1answer
65 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
104 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
47 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
97 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
102 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
28 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
54 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
46 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
15 views

Building a content pipeline at build-time models

I came across some text that refers to building a content pipeline at build-time instead of run-time. content pipeline im referring to is loading models. Can someone shed some light on what it is to ...
0
votes
0answers
151 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
94 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
105 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
33 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
38 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
270 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
23 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
0answers
49 views

Passing in 2 arrays into HLSL pixel shader

I am in the process of learning how to use DirectX (using SharpDX). If you know DirectX they are both similar SharpDX is just a wrapper for DirectX. I was able to show a triangle using an index ...
0
votes
1answer
44 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
45 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
259 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 ...
0
votes
1answer
373 views

Accessing UAV data in a Pixel Shader SRV

I'm working with a basic compute shader which only task is to modify the input color of an UAV. This UAV data should then be passed to an SRV in a pixel shader which should then output this color. The ...
0
votes
1answer
158 views

CreateShaderResourceView fails because of plane slice

I'm trying to write a wrapper for the CreateShaderResourceView method inside my Texture class, which shouldn't be any problem at all since everything was working ...
2
votes
1answer
343 views

Why do these DirectXMath functions seem like they return column-major matrics?

I know these questions have been asked a million times in various formats, but I'm getting weirdly skeptical about some of the row-major vs. column-major claims about the DirectXMath library. If I ...