Questions tagged [directx]

30 questions
13
votes
2 answers

Derivative maps vs. Tangent Space Normal maps

I discovered that some engines use derivative maps instead of tangent space normal maps. After some reading, it seems to be a really awesome way to replace tangent space normals but are there some disadvantage using them ? Why still continue using…
MaT
  • 1,219
  • 10
  • 21
8
votes
2 answers

Help me grasp Anisotropic Filtering (AF)

Lately I've been reading about texture filtering, namely Nearest-neighbor filtering, Bilinear filtering, Trilinear filtering, Anisotropic filtering, MIP maps, RIP Maps and so on. From a high-level perspective I think I can understand these…
4
votes
0 answers

Drawing "after" Present to achieve better performance

I had an application that was originally single threaded and worked as follows: gather the items to be drawn (occlusion / frustrum culling / sorting into batches) draw items using an immediate context present I decided to use a deferred context…
default
  • 323
  • 1
  • 8
4
votes
1 answer

Clipping for perspective projection

In the following two graphs, the red lines are borders of the perspective-projection frustum, the blue lines are to be rasterized, the green lines are perspective-projection lines, which are wrong. How do modern GPU pipelines do such clipping…
chaosink
  • 561
  • 1
  • 3
  • 13
2
votes
1 answer

Rendering equation for spherical lights

I am currently implementing spherical lights in my DirectX game engine. I decided to build the shading formula from the classical rendering equation. Here is what I get: The simplifications show that the cosine term should be removed for spherical…
B Lee
  • 23
  • 4
2
votes
1 answer

Image saved as DDS with 16f format in photoshop has strange FOURCC text

I am analyzing the hex code for DDS files which are compressed via Nvidia's dds plugin in photoshop. I noticed something strange when having a 16 bit float file. This is the dialog: When I look at the header of this file it appears to not follow…
Samuel
  • 123
  • 3
2
votes
1 answer

Why does DirectX use COM pointers and interfaces?

I have a rudimentary understanding of COM and I know that its main purpose is to enable interoperability between programs written in different languages. However I dont understand why that is useful to the DirectX api. Is it because DirectX has to…
mbl
  • 291
  • 1
  • 8
2
votes
1 answer

DX9 Shadow map PCF issue

I am trying to do simple PCF with Unity but I am facing some issues and I don't know where they come from. If anybody has an idea... Here are two examples // C# GetTemporaryRT(_shadowMapProperty, _shadowSettings.shadowAtlasWidth,…
MaT
  • 1,219
  • 10
  • 21
2
votes
0 answers

If statements in shaders - implications and consequences

I've heard a lot that in shader development, you absolutely need to avoid branching and so if statements. But why? Does this have a real impact on performances on old and modern hardware or is it more a case by case choice depending on your…
MaT
  • 1,219
  • 10
  • 21
2
votes
1 answer

Is it possible to make a projection matrix to not project in the center?

I have the following projection matrix: and I need to make a hole in the center of my matrix, something like that: (I don't want to project a custom W and H) Is that possible ? Thanks.
1
vote
0 answers

OpenGL/D3D11 offscreen render multiple buffering

Recently I've been looking at Vulkan, and one thing that I noticed is that the application is responsible for choosing which buffer to render to in the case of multiple buffering. This got me thinking: since one of the benefits of multiple buffering…
1
vote
0 answers

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 texture coordinate for all texture samplings in one…
Emil Kabirov
  • 183
  • 5
1
vote
0 answers

D3D12EnableExperimentalFeatures causes D3D12CreateDevice to fail

I am following Nvidia's DXR tutorial: D3D12HelloTriangle. I call below code before creating device and it returns true UUID experimentalFeatures[] = { D3D12RaytracingPrototype }; HRESULT hr = D3D12EnableExperimentalFeatures(1, experimentalFeatures,…
ali
  • 710
  • 4
  • 13
1
vote
0 answers

Rounding rules for mip level with point sampling

In shaders, when using SampleLevel intrinsic, if we pass 0.5 in the mip level parameter, and the sampler is a point sampler, what mip level is selected ? According to this blog:…
v.oddou
  • 623
  • 4
  • 9
1
vote
0 answers

Compute shader in DirextX: difference between four kinds of memory barriers

There are four kinds of memory barriers in DirectX. Their names and definitions are: DeviceMemoryBarrier: Blocks execution of all threads in a group until all device memory accesses have been completed. DeviceMemoryBarrierWithGroupSync: Blocks…
Fan
  • 11
  • 1
1
2