Skip to main content
9 votes
Accepted

Physically Based Area Lights

When I implemented real-time area lighting, there were two documents I kept referring to: "Moving Frostbite to PBR" by Sebastien Lagarde and "Real Shading in Unreal Engine 4" by ...
JarkkoL's user avatar
  • 3,686
8 votes
Accepted

What are Jittering and Dithering

Jittering and dithering are both techniques of adding noise to reduce visible artefacts (such as banding) in an image. They solve different kinds of artefacts so they are used in different situations. ...
Dan Hulme's user avatar
  • 6,880
7 votes
Accepted

Bloom in DirectX

This effect is called light bloom. Its algorithm is usually a variation of the following: Render your scene (preferably in high dynamic range) to texture. Make a thresholding pass to another texture. ...
IneQuation's user avatar
7 votes
Accepted

What's the difference between Sample and tex2D

They represent the same operation, but Sample is what it's called in D3D10 and newer versions of HLSL, while tex2D is what it's ...
Nathan Reed's user avatar
  • 25.3k
5 votes

Books to learn Ray Tracing

For an introduction, you can give a look at: Ray Tracing from the Ground Up (Amazon link here). It starts really from the basics, and provides simple implementations for the concepts that are ...
wip's user avatar
  • 1,871
5 votes
Accepted

Is `groupshared` memory stored in L2 cache of GPU?

There seems to be some confusion of terminology here. In Direct3D, you have threads and thread groups. "work item" and "work group" are generally encountered in OpenCL terminology, where a "work item" ...
Michael Kenzel's user avatar
4 votes
Accepted

Trading off instancing for render order

It depends on your GPU. "Tiled renderers" do this for you so the benefit of doing it yourself is minimal (unless you have some more efficient way of knowing the order, e.g. sorting a fixed-viewpoint ...
Dan Hulme's user avatar
  • 6,880
4 votes
Accepted

Why don't Direct3D/Metal support texture swizzles?

Why is this feature present in OpenGL/Vulkan and not Direct3D/Metal? It's present in OpenGL because someone thought it would be a good idea, wrote an OpenGL extension specification for it, released ...
Michael Kenzel's user avatar
4 votes
Accepted

mipmap selection process

Mipmap selection is done by looking at adjacent pixels on the screen, and finding how far apart their texture samples fall. The mip level is chosen so as to make the space between adjacent texture ...
Nathan Reed's user avatar
  • 25.3k
3 votes
Accepted

D3D11 Gpu profiling with queries accuracy

It looks like a normal amount of variance to me. Profiling results naturally fluctuate because there can be nondeterministic cache effects, changes in how the work is scheduled, there can be other ...
Nathan Reed's user avatar
  • 25.3k
3 votes
Accepted

Buffer of arrays in HLSL compute shader

It looks to me like you want a buffer containing a single array of integers (not a buffer containing multiple arrays, whatever that would mean). So, you should be able to just do this: ...
Nathan Reed's user avatar
  • 25.3k
3 votes

Books to learn Ray Tracing

Not a book, but here's an online write-up about the basics of Monte Carlo path tracing: Path Tracing – Getting Started With Diffuse and Emissive | The blog at the bottom of the sea I've also ...
Alan Wolfe's user avatar
  • 7,811
3 votes

Problem with Basic Diffuse Lighting

Your ambient lighting contribution is missing from the second one (:
Alan Wolfe's user avatar
  • 7,811
2 votes

Projected grid water horizon detail

The technic what Benedikt mentioned is explained in Section 2.4.1 of this thesis. http://fileadmin.cs.lth.se/graphics/theses/projects/projgrid/projgrid-lq.pdf Implementing this should solve your ...
TheXappy's user avatar
2 votes

How do you loop through the contents of a buffer in DX11?

There are a couple of issues. First you need to make sure that veBuffer has the correct type, so that probably means you need to cast it to pointer to vertex: <...
trojanfoe's user avatar
  • 121
1 vote
Accepted

D3D11 Map forces synchronization

Yes, Map can force synchronization in some situations. In D3D11, the driver handles GPU command recording, submission and synchronization. When you make D3D11 calls,...
Nathan Reed's user avatar
  • 25.3k
1 vote

what is the range for NDC coordinates to be visible in directx

Like you said... When using a perspective projection, your 'w' can be !=1. Between the vertex pocess stages (Vertex, Tessellation control, Tessellation evaluation, geometry) and the Fragment shader, ...
Thomas's user avatar
  • 1,366
1 vote
Accepted

what is the output from rasterizer

You are correct in your understanding that the rasterizer produces fragments. Each fragment can be thought of as a quasi-pixel, in that geometry may generate more than one fragment for the same pixel (...
Straivers's user avatar
  • 126
1 vote
Accepted

Downscaling texture via mipmap [DirectX 11]

I found the problem. By zeroing the sampler description I implicitly set LOD bounds to 0. After adding ...
ivokabel's user avatar
  • 1,474
1 vote
Accepted

ShadowMap peter-panning and wrong direction

I found out that simply removing minus sign in shader in converting coords to [0, 1] solved direction problem. But scale is still off - here is an example: ...
DirectX_Programmer's user avatar
1 vote
Accepted

Weirdly looking diffuse irradiance map

I've actually managed to find problem thanks to @PaulHK, thanks! I decided to pass which face I am currently working on and setting then coordinates manually per face. It is awful but it works rather ...
DirectX_Programmer's user avatar
1 vote
Accepted

R16_FLOAT, SampleCmp and CheckFormatSupport

Because I was using the CheckFormatSupport wrong. The second parameter is supposed to be an input. Here is what it should be like. ...
ACskyline's user avatar
  • 115
1 vote
Accepted

XMMatrixPerspectiveFovLH is broken?

Problem XMMATRIX and XMVECTOR (which use __m128 under the hood) require 16 byte alignment. ...
Matthias's user avatar
  • 1,084
1 vote

Physically Based Area Lights

Fellow 15-year-old here. As far as I have read, you would usually implement an Area light by combining multiple things: A point or directional light at the position for BRDF calculations. Using the ...
SparkyPotato's user avatar
1 vote

Problem with Basic Diffuse Lighting

...
Arjan Singh's user avatar
  • 2,491

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