hlsl Questions
2
I have a RWTexture2D<float4> which was filled by a ray generation shader. I need to scale every pixel by a common constant value, which is only known after the ray generation shader has finis...
Proliferation asked 3/4 at 20:10
4
Solved
I'm trying to write a very simple shader that adds random sparkle to applicable objects. The way I'd like to do this is by adding a random shade of white (R = G = B) to the pixel value within the p...
Kaikaia asked 1/3, 2011 at 1:25
3
I'm writing a shader (HLSL), and I need to pack a color value into the R32 format. I've found various pieces of code for packing a float into the R8G8B8A8 format, but none of them seem to work in r...
1
In HLSL I have two arrays:
int arr1[2];
int arr2[2];
I need to copy contents of arr1 to arr2.
Should I iterate through every element?
arr2[0] = arr1[0];
arr2[1] = arr1[1];
Is there any spe...
Dulaney asked 4/1, 2019 at 15:21
2
Solved
I am learning HLSL for DirectX 11, and I was wondering what exactly is the SV_POSITION that is the output for a Vertex Shader, and the input for a Pixel Shader.
1: Is this x,y,z of every pixel on ...
Bigler asked 2/10, 2017 at 14:25
5
Solved
I was studying the rendering pipeline and when I got to the clipping stage it was explained that from the view (eye or camera) space we have to pass to the clip space, also called normalized device...
3
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...
Nicobarese asked 31/7, 2017 at 18:19
4
Solved
I am following an example book called: Introduction to 3D Game Programming with DirectX 11
It is all written in VS2010. I would like to try using VS2013... It is an example project for Windows De...
Thrombo asked 3/12, 2013 at 22:53
2
Solved
Both seems to be HLSL shader language, but what is the difference between them?
Does it matter to change .hlsl extension to .hlsli, or vise versa?
One of the article I found says that .hlsli file...
3
In HLSL I must use semantics to pass info from a vertex shader to a fragment shader. In GLSL no semantics are needed. What is an objective benefit of semantics?
Example: GLSL
vertex shader
vary...
2
Solved
Hypothetically, say I wanted to use a compute shader to run Kernel_X using thread dimensions of (8, 1, 1).
I could set it up as:
In Script:
Shader.Dispatch(Kernel_X, 8, 1, 1);
In Shader:
[numthrea...
Volscian asked 22/7, 2020 at 12:45
1
Solved
I've been attempting to encode 4 uints (8-bit) into one float so that I can easily store them in a texture along with a depth value. My code wasn't working, and ultimately I found that the issue bo...
Forejudge asked 1/2, 2020 at 18:32
2
Solved
I'm writing CG shaders for advanced lighting calculation for game based on Unity. Sometimes it is needed to sum all vector components. There are two ways to do it:
Just write something like:
flo...
Kowalski asked 5/9, 2019 at 11:20
1
Solved
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 in...
Words asked 29/8, 2019 at 4:52
1
Solved
I have a common method in hlsli
/// RendererShaderTypes.hlsli
///
static inline float4 OverlayColor(float2 texOverlay, float4 videoColor)
{
float4 texColor = float4(imageMixTexture[4].Sample(ima...
Decuple asked 20/2, 2019 at 7:33
1
I'm attempting to SLERP from GLSL (HLSL would also be okay as I'm targeting Unity3D)
I've found this page: http://www.geeks3d.com/20140205/glsl-simple-morph-target-animation-opengl-glslhacker-demo...
Subservient asked 21/5, 2014 at 21:0
1
Solved
Currently I have this code in my vertex shader class:
cbuffer MatrixBuffer {
matrix worldMatrix;
matrix viewMatrix;
matrix projectionMatrix; };
I don't know why I need to wrap those variables in...
2
I have a compiled fxo shader which I'm trying to edit slightly (just adjusting some constants).
Using fxdis (https://code.google.com/archive/p/fxdis-d3d1x/) I can disassemble this shader, this is ...
2
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 s...
Wolfram asked 14/11, 2017 at 12:15
1
I'm really new to DirectCompute technologies, and have been attempting to learn from the documentation on the msdn website, which is.. dense, to say the least.
I'd like to make a basic hlsl file t...
Wendish asked 12/9, 2012 at 20:51
4
Gaussian, box, radial, directional, motion blur, zoom blur, etc.
I read that Gaussian blur can be broken down in passes that could be implemented in pixel shaders, but couldn't find any samples.
...
Periwinkle asked 1/7, 2012 at 13:32
1
Solved
I'm using Visual Studio, C#, XAML, WPF.
In my program I have XAML buttons with white png icons.
I want to have it so you can switch to a theme with black icons by choosing the theme from a Comb...
Auschwitz asked 14/7, 2017 at 1:54
2
Solved
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:
Howev...
5
Solved
Are there any free components out there that will give highlighting and/or intellisense for HLSL?
I've seen mentions of something called "InteliSense.Net," but the author's site is down and I can'...
Swanky asked 24/11, 2010 at 17:21
2
Solved
I want to know if "if-statements" inside shaders (vertex / fragment / pixel...) are really slowing down the shader performance. For example:
Is it better to use this:
vec3 output;
output = input*...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.