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
8
votes
1 answer

Can Silverlight play videos with transparency?

Can Silverlight play video with transparency? At least some tricky way for color keying with C# or HLSL? So if you know any way how to please post some info. If yes. What do I need? MSDN if there is any help on this. Open Source…
Rella
  • 65,003
  • 109
  • 363
  • 636
8
votes
6 answers

Real HLSL IDE/debugger

Are there any IDE's for developing HLSL code? The three key features I want are: 1) syntax highlighting 2) auto-complete 3) interaction debugging Visual Studio doesn't do any of these things, and it doesn't seem that RenderMonkey or FX Composer do…
ThePhantasm
8
votes
1 answer

Outer Glow as HLSL shader

I'm still working on an image processing project that makes use of HLSL shaders to add Photoshop-esque filters like drop shadow, bevel and so on. Now I'm searching for an approach to implement an outer glow effect in HLSL. I'm currently…
barnacleboy
  • 539
  • 8
  • 18
7
votes
1 answer

Octree raycasting/raytracing - best ray/leaf intersection without recursion

Could anyone provide a short & sweet explanation (or suggest a good tutorial) on how to cast a ray against a voxel octree without recursion? I have a complex model baked into an octree, and I need to find the best/closest leaf that intersects a…
3Dave
  • 28,657
  • 18
  • 88
  • 151
7
votes
1 answer

Unity Shader - How to efficiently recolor specific coordinates?

First, please allow me to explain what I've got and then I'll go over what I'm trying to figure out next. What I've got I've got a textured custom mesh with some edges that exactly align with integer world coordinates in Unity. To the mesh I've…
Mir
  • 305
  • 8
  • 24
7
votes
1 answer

Translating C to C# and HLSL: will this be possible?

I've taken on quite a daunting challenge for myself. In my XNA game, I want to implement Blargg's NTSC filter. This is a C library that transforms a bitmap to make it look like it was output on a CRT TV with the NTSC standard. It's quite accurate,…
Tesserex
  • 17,166
  • 5
  • 66
  • 106
7
votes
2 answers

Greenish image with BGRA to YUV444 conversion using DirectX11 pixel shader

  I'm new to HLSL. I am trying to convert color space of an image captured using DXGI Desktop Duplication API from BGRA to YUV444 using texture as render target.   I have set my pixel shader to perform the required transformation. And taking the…
7
votes
3 answers

Error: Invalid vs_2_0 output semantic

Its says: Invalid vs_2_0 output semantic SV_Target. So for some reason Visual Studio 2017 is compiling my pixel shader as if it is a vertex shader. But in the properties panel I specified it to be a ps_5_0. Is there something I'm missing that should…
Kay Verbruggen
  • 111
  • 1
  • 1
  • 9
7
votes
2 answers

How to compile hlsl shader file in Visual Studio C# project

I would like to compile a hlsl shader file in my C# project in Visual Studio 2015. With a C++ project I immediately get the correct properties if I add an hlsl file like the picture below: However when I want to do this in my C# project (with…
N Jacobs
  • 341
  • 2
  • 16
7
votes
1 answer

Rendering to a full 3D Render Target in one pass

Using DirectX 11, I created a 3D volume texture that can be bound as a render target: D3D11_TEXTURE3D_DESC texDesc3d; // ... texDesc3d.Usage = D3D11_USAGE_DEFAULT; texDesc3d.BindFlags = D3D11_BIND_RENDER_TARGET; // Create volume texture and…
Daerst
  • 954
  • 7
  • 24
7
votes
1 answer

Unexpected sizes of arrays in a HLSL Constant Buffer

I have not yet used more complicated CBs like this here but, from what I understand, my C++ alignment and packing has to match what HLSL expects. So I'm trying to figure out the rules so I can predictably lay out the C++ struct to match what HLSL…
CodeAngry
  • 12,760
  • 3
  • 50
  • 57
7
votes
1 answer

GLSL/HLSL - Multiple single line conditional statements as opposed to single block

Doing some research into antialiasing methods, I stumbled upon this piece of code (grabbed from Nvidia's FXAA shader): if(!pairN) lumaN = lumaS; if(!pairN) gradientN = gradientS; if(!pairN) lengthSign *= -1.0; Is there a good reason it's not…
Fault
  • 420
  • 3
  • 17
7
votes
1 answer

Preventing pixelshader overdraw for a single ERG

Background Using gluTess to build a triangle list in Direct3D9 from a GDI+ DrawString(..) path: A pixel shader (v3.0) is then used to fill in the shape. When painting with opaque values, everything looks fine: The problem At certain font sizes, if…
Sichbo
  • 438
  • 4
  • 8
7
votes
1 answer

HLSL Normal Mapping Matrix Multiplication

I'm currently working in directx9 and have the following code for my normal mapping: (Vertex Shader): float4x4 gWorldMatrix; float4x4 gWorldViewProjectionMatrix; float4 gWorldLightPosition; float4 gWorldCameraPosition; struct VS_INPUT { float4…
dk123
  • 18,684
  • 20
  • 70
  • 77
7
votes
3 answers

Passing colors through a pixel shader in HLSL

I have have a pixel shader that should simply pass the input color through, but instead I am getting a constant result. I think my syntax might be the problem. Here is the shader: struct PixelShaderInput { float3 color : COLOR; }; struct…
Justin R.
  • 23,435
  • 23
  • 108
  • 157