Questions tagged [hlsl]

HLSL(High Level Shader Language) is a proprietary shading language developed by Microsoft for use with the Microsoft Direct3D API

HLSL is a C-like language developed by Microsoft and it's used in Direct3D API to define shaders. HLSL is used by Direct3D 9, and is required by the unified shader model in Direct3D 10+.

HLSL can be used to define pixel shaders, vertex shaders, geometry shaders, compute shaders, tessellation shaders, raytracing shaders and mesh shaders. It is analogous to for OpenGL.

Vulkan SDK and DirectX Shader Compiler also supports compiling HLSL shaders into SPIR-V, enabling its use in Vulkan applications.

Resources

1642 questions
0
votes
1 answer

Blur shader(Grab pass) showed pink in editor but work in mobile

This shader work on mobile, but in editor it showed as pink. Previously it work fine, but somehow after I build on mobile, Then it start to showed as pink. No error but It give me warning. I am using Unity 2017.2. I also try to reopen project. but…
Tengku Fathullah
  • 1,279
  • 1
  • 18
  • 43
0
votes
1 answer

Can't compile HLSL Hull shader code

Here's a simple hull shader code that i made, to try to understand tessellation. I just can't find anything wrong with this code, but the compile function always return false. Here's my code: My input and output structures: [domain("tri")] //…
mondlicht
  • 3
  • 5
0
votes
1 answer

How do I get Visual Studio 2017 / msbuild to use the latest DirectX shader compiler?

I'm trying to compile a C# game project which utilizes HLSL shaders. These shaders are part of the .csproj project, and therefore Visual Studio is supposed to compile them along with the code. The shader properties should be correct - shaders are of…
paavohtl
  • 23
  • 1
  • 7
0
votes
1 answer

DirectX 11 What is a Fragment?

I have been learning DirectX 11, and in the book I am reading, it states that the Rasterizer outputs Fragments. It is my understanding, that these Fragments are the output of the Rasterizer(which inputs geometric primitives), and in-fact are just…
Mike5050
  • 625
  • 1
  • 7
  • 22
0
votes
1 answer

HLSL shading distance fade x3

Hi all I'm trying to fade between 3 distances. For example I have a grass system that all use the same shader and 3 types of LOD so I need to crossfade between 3 different distances so they don't just pop in. This is how I've been trying to do…
0
votes
2 answers

Trying to Reproduce a light source Lara Croft Go in Unity

I want to have a light that projects onto multiple planes of my level geometry, to mimic the effect in this video: http://youtube.com/watch?v=vujrxOmh8Jc I attempted to recreate it with a point light, like this: But mine only projects on the the…
hassan sadeghein
  • 97
  • 1
  • 1
  • 5
0
votes
1 answer

Can I use a bias value outside [0, 1] for SampleBias in HLSL?

The doucment SampleBias said that Bias is a floating-point number between 0.0 and 1.0 inclusive. However I have done a little experiment and Bias values outside [0, 1] work fine. Is Bias value outside [0, 1] guaranteed to work? Or this just depends…
delphifirst
  • 1,781
  • 1
  • 14
  • 23
0
votes
1 answer

A D3D11_USAGE_STAGING Resource cannot be bound to any parts of the graphics pipeline

I'm trying to Create RWStrutruedBuffer with a D3D11_USAGE_STAGING for cpu access . error: D3D11_USAGE_STAGING Resource cannot be bound to any parts of the graphics pipeline. How can get the RWStrutruedBuffer from GPU to CPU? I need the…
F.Eazism
  • 43
  • 10
0
votes
0 answers

Issue recreating PhotoShop's Hue\Saturation\Brightness

I'm trying to adjust HSV color space same as PhotoShop. What I've tried : RGB to HSV, it's seem that is a correct step. But I found HSV adjusting was a lie.Whatever I try to adjust hue\saturation\Bright, the result isn't equal with PS. Finally, I…
F.Eazism
  • 43
  • 10
0
votes
1 answer

Dropdown UI widget for fx/hlsl shader

I've made a HLSL shader (fx format) and would like to add a enum/list paremeter to its UI - as a better alternative to the list of boolean flags. So instead of : [x] "Use custom map" [x] "Use custom map alpha" [x] "Use diffuse alpha" [x] "Use…
mslaf
  • 55
  • 1
  • 7
0
votes
2 answers

DirectX 11 Rendering Object Inside out

I am having alot of struggles trying to follow Frank Luna's book for DirectX 11 3D Programming, and I am currently up to chapter 7 section 2. I have imported the Skull model file and I have begun to render it. The strange thing is that when I am…
Sharpie
  • 113
  • 8
0
votes
0 answers

Will pixel shader cut some points? (I want to generate voxel)

I have to save every vertex for generating voxel. No culling back, the whole scene can be store to voxel, but I don't know how to pass the pixel shader if the vertex is lost. Should I put camera to far place for that whole scene can be show?…
F.Eazism
  • 43
  • 10
0
votes
1 answer

How to change this shader to solid color?

I tried changing "float4 Color: COLOR1" but didn't help because it's for Diffuse or specular color. I don't know what else to do, I don't know what to add. I ran out of ideas. HRESULT GenerateShader(ID3D11Device* pD3DDevice,…
Evilminator
  • 3
  • 1
  • 2
0
votes
1 answer

Inputting Position Into the Pixel Shader

In most of the programs I have seen that make use of vertex position data in the Pixel Shader, there is a tendency to process it as a float4 vector. This restriction does not appear to be present fin the other shaders. In the program that I am…
NAKASSEIN
  • 45
  • 1
  • 6
0
votes
1 answer

Vertex Shader Input Order

Does input order for a SM 4.0 vertex shader matter? e.g. is struct App2VS { float3 position : POSITION; float4 color : COLOR0; float3 normal : NORMAL; ... }; equivalent to struct App2VS { float4 color : COLOR0; float3…
jameszhao00
  • 7,213
  • 15
  • 62
  • 112