hlsl Questions

1

I'm in the process of learning C++ and DirectX, and I'm noticing a lot of duplication in trying to keep structs in my HLSL shaders and C++ code in sync. I'd like to share the structs, since both la...
Fictive asked 19/1, 2016 at 20:37

2

Solved

In a surface shader, given the world's up axis (and the others too), a world space position and a normal in world space, how can we rotate the worldspace position into the space of the normal? Tha...
Amah asked 27/8, 2015 at 18:54

1

Solved

I've just started using the Compute shader stage in DirectX 11 and encountered some unwanted behaviour when writing to an output resource in the Compute shader. I seem to get only zeroes as output ...
Penton asked 17/8, 2015 at 11:50

2

Solved

I have a shader where I want to move half of the vertices in the vertex shader. I'm trying to decide the best way to do this from a performance standpoint, because we're dealing with well over 100,...
Silky asked 17/9, 2012 at 13:47

1

Solved

I'm just at the very very beginning of learning shaders/hlsl etc., so please excuse the probably stupid question. I'm following Microsoft's DirectX Tutorials (Tutorial (link) , Code (link) ). As f...
Sprightly asked 19/4, 2015 at 10:1

1

Solved

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...
Closeup asked 18/3, 2015 at 14:24

3

Solved

I'm trying to understand how passing parameters is implemented in shader languages. I've read several articles and documentation, but still I have some doubts. In particular I'm trying to understan...
Beadruby asked 15/2, 2015 at 15:22

1

I've read numerous descriptions of the behavior of dFdX(n) and dFdY(n) and do believe I still have a handle on partial derivatives from school. What I don't follow is where does 'n' come from in th...
Kero asked 30/1, 2015 at 23:39

1

Solved

I'am trying to understand specular reflection in HLSL and DirectX11 cbuffer ConstantBuffer : register( b0 ) { matrix World; // Матрица мира matrix View; // Матрица вида matrix Projection; // М...
Marsipobranch asked 29/10, 2014 at 19:53

1

I'm absolutely stumped as well as my instructors/lab-assistants. For some reason, the following HLSL code is returning this in the output window: error X8000 : D3D11 Internal Compiler error : Inv...
Storehouse asked 24/10, 2014 at 0:15

1

Solved

I am trying to create a normal map from a height map in HLSL. I followed this https://stackoverflow.com/a/5284527/451136 which is for GLSL. Here is how I translated GLSL to HLSL: GLSL: uniform s...
Desultory asked 25/9, 2014 at 18:24

1

Solved

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 pred...
Flagwaving asked 18/6, 2014 at 3:3

1

Solved

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) length...
Lanettelaney asked 7/1, 2014 at 21:30

2

Solved

I'm working with DX9/SM3 at the moment, and the MSDN documentation on HLSL samplers seems to be sorely lacking in explaining how to use the different sampler types. What's worse is they try to cove...
Scapegoat asked 19/8, 2009 at 17:37

1

Solved

I'm trying to add bump mapping functionality to my application but I'm getting very faceted models: The reason it is happening is because I'm calculating tangent, binormal and normal on per face...
Tramline asked 13/2, 2014 at 22:10

1

I am new to HLSL and shaders. I can't seem to replace the color I retrieve. It's for use in 2D text, i.e. subtitles. The problem is if I set osd_color outside main() it doesn't display anything. I ...
Moira asked 15/10, 2012 at 11:43

6

Solved

I'm kind of stuck here, I guess it's a bit of a brain teaser. If I have numbers in the range between 0.5 to 1 how can I normalize it to be between 0 to 1? Thanks for any help, maybe I'm just a bit...
Electromechanical asked 24/9, 2009 at 12:27

2

Solved

I am trying to make an HDR rendering pass in my 3D app. I understand that in order to get the average light on a scene, you'd need to downsample the render output down to 1x1 texture. This is whe...
Coacher asked 22/12, 2013 at 5:30

1

Solved

I have a problem with array indexing on GPU in Compute Shader and I'm stuck with it for weeks. I'm trying to use the x value of SV_DispatchThreadID as the index of my particle array (as it is show...
Osteoplastic asked 22/12, 2013 at 11:11

1

Solved

I'm starting to learn Shaders now (HLSL, GLSL) and I saw a lot of tutorials where there weren't many variables created and that made reading harder. I was wondering if the creation of new variables...
Amandaamandi asked 22/12, 2013 at 6:7

1

Solved

I'm just wondering how I can use Texture2DArray in HLSL. I am trying to implement a model loader where models have different amount of textures. At the moment my HLSL uses Texture2D with a size o...
Amazonas asked 21/12, 2013 at 17:40

1

Solved

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, everyt...
Vast asked 21/12, 2013 at 15:51

1

Solved

I have a compute shader and the C# script which goes with it used to modify an array of vertices on the y axis simple enough to be clear. But despite the fact that it runs fine the shader seems to...
Discriminator asked 17/12, 2013 at 9:47

2

Solved

The parameters for HLSL's mul( x, y) indicated here: say that if x is a vector, it is treated as a row vector. if y is a vector, it is treated as a column vector. Does this then follow through ...
Interfluve asked 16/5, 2013 at 3:57

2

Solved

The document: http://msdn.microsoft.com/en-us/library/dd607349(v=vs.85).aspx states that #include "foobar.fx" will look for that file in the same directory as the current effect file. It doesn't ...
Yorke asked 12/3, 2011 at 14:43

© 2022 - 2024 — McMap. All rights reserved.