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
13 views

DirectXTK: SpriteBatch::Begin and Draw methods give LNK2019: unresolved external

Right now, im using DirectXTK (version 2020.2.24.4) and Visual Studio 2019. My declarations look like this: ...
0
votes
0answers
43 views

How do I render to a resizable window from a large fixed size back buffer in current graphics APIs?

I have some code that uses DirectX 9 with Windows native window management, that I would like to port to newer graphics APIs, but this code has a fairly unusual approach to window resizing, and it ...
0
votes
1answer
22 views

How to update different constant buffers for different vertices in vertex buffer?

Lets say I have vertices and indices for Box and Sphere and I put them into one vertex buffer. But if I want to use different constant buffers for each of the figures, how would I do that? As I ...
0
votes
1answer
24 views

d3d11 black texture when manually creating from image (Rust)

I am trying to create a ID3D11Texture2D from a RgbaImage loaded from a .jpg. The below code produces no errors. However, the texture is black when it is actually ...
1
vote
0answers
13 views

My triangle disappears when multiplaying by my perspective projection matrix

Whenever I multiply my transformation matrix, which is passed to the shader via constant buffer, my triangle disappears. Here is the code for the passed matrix: ...
0
votes
0answers
32 views

How to draw lines in Directx12?

I want to draw line between two points (x1,y1,z1) (x2,y2,z2). I want to have possibility to change this line start and end point ...
0
votes
0answers
21 views

How to draw different geometries in DirectX?

I want to draw many cubes and many lines. I am dealing with many cubes, that is ok. But to do if I also want to draw another shapes(not triangles)? Do I need to create 2 vertex and index buffers? ...
0
votes
1answer
63 views

If I use vertex shader to do all operations on object, then constant buffer can be empty?

The program cycle is Update(); UpdatePipeline(); In Update() constant buffer for each object, that after transformations, has ...
0
votes
1answer
24 views

Figuring out the exponent in a spotlight equation from the angle of a cone

I followed a tutorial on how to build a spotlight using DirectX. This tutorial uses a point light equation plus a line of code to limit the light to the shape of a cone. I have everything working, but ...
0
votes
1answer
83 views

How to convert this resource texture creation code from DirectX 11 to DirectX 12?

I have some code below that is Directx 11 that im using to make a resource texture. ...
0
votes
0answers
73 views

Converting texture format

I am implementing glTF scene loading in my pet DirectX 11 renderer using tinygltf loader from Syoyo Fujita. When loading a texture, tinygltf loads its raw data in its native format (e.g. 4x8b uint in ...
0
votes
0answers
31 views

Per-frame buffer management in DirectX 11

My buffer management when using the Metal API had me use a per-frame buffer cache to manage the buffers that were still in flight and could not be used. The Metal API is very explicit about when a ...
0
votes
1answer
111 views

Porting C# OpenGL rendering code to C++ DirectX

I have the following rendering method written in C# and apparently using OpenGL immediate mode, and i'm trying to port it to C++ and DirectX: ...
2
votes
2answers
170 views

How do game engines implement multiple rendering platforms?

How do game engines like UE4, Unity, Source, Cry Engine, etc add different rendering library's to their game engines? (Eg. OpenGL, DirectX, Vulkan)
0
votes
0answers
44 views

Optimizing texture fetches with higher mip levels

Let's say I have some shader program in DirectX or OpenGL rendering a full screen quad. And in a pixel/fragment shader I sample some huge textures at random texture coordinates. That is one same ...
0
votes
0answers
48 views

Compute normal based on Voronoi pattern

I am applying a 3D Voronoi pattern on a mesh. Using those loops, I am able to compute the cell position, an id and the distance. But I would like to compute a normal based on the generated pattern. ...
0
votes
0answers
35 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
71 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
134 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
50 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
37 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
60 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
66 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
49 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
326 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
39 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
373 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
52 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
95 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
430 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
99 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
183 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
66 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
37 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
1answer
80 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
91 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
358 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
133 views

weird behaviour doing simple XMMATRIX multiplications

I have the following function: ...
0
votes
0answers
51 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
45 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
105 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
81 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
1answer
72 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
68 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 ...
1
vote
0answers
42 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
180 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
173 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
176 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
151 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
97 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
2 3 4 5
21