Questions tagged [hlsl]

HLSL is the High-Level Shading Language, used to author shaders for use with Direct3D, and cross-compilable to SPIR-V. Use this tag for questions which are specifically about shaders written in this language. For generic shader questions use [shader] instead.

21 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
142 views

Injecting Virtual point lights into 3D Grid

I am currently trying to implement light propagation volumes in DirectX 11 and I have already done the RSM part which contains position, normal, depth and flux map generation. But for Injecting ...
user3059485's user avatar
5 votes
0 answers
59 views

Facetted look when using SampleBias

I am writing a simple material system for a game. Each material can have a specular value (phong) that is translated into "smoothness" via environment map. Similar to PBR, I compute a ...
Raildex's user avatar
  • 173
4 votes
0 answers
300 views

Direct3D Global Atomic Issue

Recently I ran into an odd issue with some of my DirectX11 DirectCompute code when trying it on an AMD GPU for the first time where as on a NVIDIA one it had worked fine all through development. The ...
Lemon Drop's user avatar
2 votes
0 answers
363 views

Corrupt values when writing and reading from the same RWTexture2D in HLSL/DirectX?

I'm playing around with DirectX 12 ray tracing, and I'm trying to read and write data to a 32-bit RGBA floating point RWTexture2DArray within a DirectX 12 HLSL shader. I'm getting weird corruption/...
b1skit's user avatar
  • 161
2 votes
0 answers
85 views

Per-object screen space uv issue

I am currently trying to sample a texture in screen space. This works well : ...
MaT's user avatar
  • 1,229
2 votes
0 answers
47 views

Multipass Rendering Vertex Buffer Organisation

I am working on a Renderer that should do a Depth Prepass before rendering the desired geometry. For this I have a Vertex and Pixel Shader that outputs to the Depth Texture. After that it should ...
user avatar
2 votes
0 answers
586 views

Implementing GGX VNDF importance sampling with DXR

I am currently implementing the GGX specular BRDF in a DXR raytracer using the importance sampling method describe by Heitz I am sampling the VNDF with: ...
Badnet's user avatar
  • 21
2 votes
0 answers
29 views

Should I use common resource bindings across all my shaders in HLSL/D3D12?

Will unaccessed bindings consume cache or bandwidth? I want to improve cache usage by splitting the per-path information in my renderer across different resources, but I also want to keep my binding ...
Paul Ferris's user avatar
2 votes
0 answers
80 views

Implementation of the paper "unified texture management of arbitrary meshes"

I briefly read the paper and I think I got the basic idea of it. The paper doesn't really go into implementation details though so my question is mostly on that. In the paper, needed tiles are ...
Temp4890's user avatar
1 vote
0 answers
87 views

Most efficient way to calculate signed distance field (SDF) for pixel subsamples?

Looking how to utilize as much parallelization processing as possible for the following task: A screen-sized texture is completely black except for blue pixels which are in close proximity to geometry ...
Daniel Cardin's user avatar
1 vote
0 answers
27 views

Help understanding Texture2D multi-sampling semantics: Why do we need sample index AND location?

Looking at the windows HLSL documentation for Texture2DMS.Load found here: https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/texture2dms-load can someone help me better understand different ...
Dan's user avatar
  • 11
1 vote
0 answers
49 views

BlinnPhong sphere edges look worse than Phong. Am I doing it wrong? (code and pictures included)

First of all, I am completely new to this so please excuse me if this is a dumb question. I am following the book Real-Time 3D Rendering with DirectX and HLSL, for now implementing shaders in Nvidia ...
egil87's user avatar
  • 11
1 vote
0 answers
97 views

Calculating ray intersection with two spheres (with smooth_blending between the two spheres to make them appear as one continuous geometry)

I have the following function to define the distance to the interesection between a ray and the surface of a sphere: ...
Iron Attorney's user avatar
1 vote
0 answers
95 views

Passing variable through cbuffer vs. shader input in HLSL

Let's say I want to pass some kind of value to a pixel shader in HLSL. I can either make a cbuffer and pass the value directly to the pixel shader, or I can make a cbuffer in the vertex shader and ...
H3XXX's user avatar
  • 115
1 vote
0 answers
113 views

Cannot use variable as texture sample value - HLSL DirectX11

I ran into strange problem. My HLSL VS won't compile for given lines: ...
DirectX_Programmer's user avatar
0 votes
0 answers
33 views

How to use unbound descriptor range properly in descriptor tables

I am trying to use 2 "D3D12_DESCRIPTOR_RANGE" in a root descriptor table,defined as follows: ...
VersesDev's user avatar
  • 129
0 votes
0 answers
48 views

Hlsl Texture2d array that can be accessed using a variable index

I have tried ...
t3rminal's user avatar
0 votes
2 answers
179 views

Storing array of floats within shader

I am about to implement a framerate histogramm chart for a DirectX Renderer. Ideally I would do this in pure shader code, but for a a histogramm I need to store the timestamps of the last ...
user20154's user avatar
0 votes
0 answers
73 views

16 bit SNORM format not correctly storing Z component?

I generate a normal GBuffer in my engine, and I store it using a R16G16B16A16_SNORM format like this: ...
H3XXX's user avatar
  • 115
0 votes
0 answers
76 views

Unity path tracing makes the pc crash

Good Morning. I'm testing Path Tracing techniques with unity, following this tutorial. http://three-eyed-games.com/2019/03/18/gpu-path-tracing-in-unity-part-3/ But I'm in trouble. Whenever I try to ...
Matheus Markies's user avatar
0 votes
0 answers
351 views

Weird PIX behavior with DXC

Recently I've switched from FXC to DXC to compile shader model 6.0. It compiles well without errors (and runs well) but I can't debug shaders because on my netbook PIX says "failed to load PDB ...
Flone's user avatar
  • 1