Skip to main content
11 votes
Accepted

How is this lantern glow effect achieved?

My best guess right now is that it's a billboarded transparent sprite, which is animated to give it a pulsing effect. Exactly that. This is simple enough even for older hardware. There's also some ...
Mario's user avatar
  • 8,537
7 votes
Accepted

How does the following code generate a full screen quad?

it doesn't generate a quad, instead it generates a fullscreen triangle. The outputs end up as: ...
ratchet freak's user avatar
6 votes
Accepted

Why do a lot of games use DirectX9

The vast majority of game developers today don't deal with graphic APIs like DirectX, OpenGL, Mantle or Vulkan directly. They delegate that to a library or game engine, so they can focus on the fun ...
Philipp's user avatar
  • 122k
5 votes
Accepted

Why are committed resources better than placed resources?

You will get contradicting suggestions from their own: http://developer2.download.nvidia.com/assets/gameworks/downloads/regular/GDC17/DX12CaseStudies_GDC2017_FINAL.pdf Page 14: "Sub-allocation ...
macrod's user avatar
  • 66
4 votes

Why would a game developer choose Direct3D instead of something with more cross-platform support?

This is a rather broad question & the specific answer will vary from one situation to the next. Here are some general reasons: It takes less time, money & expertise to develop & support a ...
Pikalek's user avatar
  • 13.3k
4 votes

Special Texture Stretching without deformation

So, essentially what you're looking for is 9 Slice Scaling. However that's only good for stretching out a texture so the edges and corners remain undeformed (sort of). The corners are 1:1 in both ...
Draco18s no longer trusts SE's user avatar
4 votes

Why would a game developer choose Direct3D instead of something with more cross-platform support?

The answers in this thread all make good points that play into this decision, but a few more things to consider: Windows comes with DirectX built-in and the driver certification includes Direct3D ...
Chuck Walbourn's user avatar
4 votes

Are DirectX coordinates spaced out in meters?

They are just Units The units in DirectX (or OpenGL for that matter) does not correspond to any physical measure. For consistency and your mental health, you can define them to be whatever unit you ...
Theraot's user avatar
  • 28k
4 votes
Accepted

HLSL MipMap sampling in pixel shader

Sample calculates the mip level to sample based on screen space derivatives of the texture coordinates provided. Derivatives of texture coordinates can be computed as follows: ...
János Turánszki's user avatar
4 votes
Accepted

How do game engines implement multiple rendering platforms?

Most game engines will have a layer between their rendering abstraction and the actual rendering API. In Unreal and Qt this is called the Rendering Hardware Interface, or RHI. I'm not sure if the ...
Tano's user avatar
  • 211
4 votes

Can I use DirectXTK12 commercially?

From the license posted in the DirectXTK12 repo: microsoft/DirectXTK12 is licensed under the MIT License: A short and simple permissive license with conditions only requiring preservation of ...
Pikalek's user avatar
  • 13.3k
3 votes

Can I use DirectX with C#?

In 2023, this question is still one of the most prominent search engine results when typing "DirectX C#". Therefore, here is a renovated answer: Since 2013, the answers to that question have ...
jeancallisti's user avatar
3 votes

Why would a game developer choose Direct3D instead of something with more cross-platform support?

Because this is not actually as important as you seem to think it is OpenGL (or Vulkan) is not a magic bullet for cross-platform support; in fact supporting multiple rendering APIs on different ...
Maximus Minimus's user avatar
3 votes
Accepted

Left-handed version of the reversed depth projection with infinite far plane

Well, I feel stupid now. Turns out I had to use a positive 1 in the last member of the third row instead of the -1 displayed in ...
Swyter's user avatar
  • 41
3 votes
Accepted

Pros and cons of loading DirectX DLLs directly?

If the DLLs are loaded using a .lib your game will fail to launch if the DLLs are missing. Loading DLLs using LoadLibrary lets you display a friendlier message on ...
Stephane Hockenhull's user avatar
3 votes
Accepted

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

You posted a column-major version of the translation matrix for (1,1,-1): 1.0 0.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 0.0 1.0 -1.0 0.0 0.0 0.0 1.0 ...
Chuck Walbourn's user avatar
3 votes
Accepted

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

TL;DR: Edit your shader compilation to use Shader Model 5.1 or later. With the DirectX 12 API, there is no supported device to date that supports anything less than Direct3D Feature Level 11.0. ...
Chuck Walbourn's user avatar
3 votes

Synchronizing with monitor refreshes without vsync

In OpenGL you can control the swap interval of your application, which will limit the frame swap to the refresh rate of the monitor (v-sync). However, the user can override this by disallowing ...
Ian Young's user avatar
  • 2,679
3 votes

DirectX11 creating input layout throws error on input signature not matching shader (instancing)

The problem was I was not calculating the number of elements in the CreateInputLayout call. It was fixed at 2 elements. Incorrect ...
koreus737's user avatar
  • 131
3 votes
Accepted

Texture does not draw with ATI Radeon RX, but does with NVIDIA/no GPU

I can see that you're checking the HRESULTs returned from D3D functions in some cases (but not all of them), and where you're checking them you just silently handle the error. I'd suggest adding debug ...
Adam's user avatar
  • 7,619
2 votes

Rendering only a part of the screen in high detail

Yes, Foveated Rendering utilizes eye tracking to only render what the user is looking at in high detail. Everything else, can be rendered in lower detail. While it's fairly obvious when looking at a ...
House's user avatar
  • 73.5k
2 votes

Run Simple HLSL Pixel Shader with DirectX 9

Since this question has been viewed 1000 times, I might as well post a follow-up. This is the code I ended up with, processing Avisynth video scripts through pixel shaders. https://github.com/...
Etienne Charland's user avatar
2 votes

Unwanted darkening at polygon edges when using normal maps with SSAO

This is something of a cold case, but I thought I'd take a crack at it. My answer to the original question "Is there anything obvious wrong with the normals?" is that there does appear to be ...
Paul's user avatar
  • 176
2 votes

Problem Rendering a Wireframe Cube and Grid with DirectX 11

D3D11_INPUT_ELEMENT_DESC inputElementDesc[] = { {"POSITION",0,DXGI_FORMAT_R32G32_FLOAT,0,0,D3D11_INPUT_PER_VERTEX_DATA,0} }; You need to change the format to ...
Jordan Calderwood's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible