Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
46 views

This is a bit of a slog so bare with me. I'm currently writing a 3D S(moothed) P(article) H(ydrodynamics) simulation in Unity with a parallel HLSL backend. It's a Lagrangian method of fluid simulation,...
Ben Williams's user avatar
-1 votes
0 answers
53 views

Unity provides their PBR lighting function with UniversalFragmentPBR, and UniversalFragmentBlinnPhong, but for me, it doesn't seem to render the light. I have been following a couple of books on ...
LoneRanger17's user avatar
0 votes
0 answers
68 views

I want to achieve something like this with fxc shader in a WPF application. So far, with the below hlsl (High-Level Shading Language) code, I managed to produced this picture: The problem is that I ...
Blazej's user avatar
  • 1
0 votes
0 answers
100 views

So let's just say I have: // HLSL layout (set = 0, binding = 4) StructuredBuffer<T> my_buffer; And compare it with: // HLSL layout (set = 0, binding = 4) StructuredBuffer<T> my_buffers[]; ...
Zebrafish's user avatar
  • 16.3k
0 votes
0 answers
31 views

Call Texture2DArray.Load(int4), and pass non-zero value to the third component of vector. It always returns float(0, 0, 0, 1) Part of shader: float4 sample_source(int sourceIndex, float2 texcoord) { ...
SlimeNull's user avatar
1 vote
0 answers
74 views

The title says it all. There seem to be no plugins and no native support for proper HLSL highlighting. Native support results in just keywords getting highlighted, my current workaround is that I put *...
tommybazar's user avatar
0 votes
0 answers
136 views

I am currently learning how to write shaders in Unity, as the Unity environemt is most comfortable for me to use. I want to create a procedural terrain, and currently trying to light it using ...
Kacper Kaliszczak's user avatar
1 vote
0 answers
45 views

Cuda has https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#warp-shuffle-functions Warp Shuffle Functions __shfl_sync, __shfl_up_sync, __shfl_down_sync, and __shfl_xor_sync exchange a ...
Tom Huntington's user avatar
1 vote
1 answer
137 views

The cooperative vectors feature seems a bit magical to me. Before each thread owned it's local variables. Now vector<float, 8> MulRes seems to be shared across the threads (i.e. the first 8 ...
Tom Huntington's user avatar
1 vote
0 answers
66 views

I finally managed to add realistic realtime rendering to my software. Now I am facing some "banding" artifacts when performing the actual shading. The test scene is straightforward. It ...
TheChamp's user avatar
0 votes
0 answers
62 views

I'm using a noise algorithm from here, the code is highp vec3 mod289(highp vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } highp vec4 mod289(highp vec4 x) { ...
OtakuFitness's user avatar
0 votes
2 answers
181 views

I've got a RWStructeredBuffer<float> tau I'm writing to in a ray generation shader rayGen. The DispatchRays dimension are (tauWidth, tauHeight, 1) and tau has exactly tauWidth * tauHeight ...
0xbadf00d's user avatar
  • 18.4k
1 vote
1 answer
134 views

Good evening! I want to implement volumetric fog in HLSL on DirectX 11. But I can't find a mathematical summary anywhere. Can someone provide the code in hlsl in what order and what variables I need ...
HardCoder's user avatar
0 votes
1 answer
63 views

I'm working on a screen-space outline effect for a low-res, cartoony game idea. I'm very new to HLSL programming and fullscreen Shader Graphs, but by looking at tutorials, I've mostly gotten the depth-...
TT87's user avatar
  • 39
1 vote
1 answer
148 views

Following these slides https://www.nvidia.com/content/GTC-2010/pdfs/2260_GTC2010.pdf when doing a parallel reduction you should avoid GroupMemoryBarrierWithGroupSync when reducing the last 2*...
Tom Huntington's user avatar
2 votes
0 answers
68 views

I'm very new to shader programming, so forgive me for any knowledge gaps or mistakes I've made. I am currently following a technique discussed in Nvidia's GPU Gems: https://developer.nvidia.com/...
Ryan Xu's user avatar
  • 63
0 votes
1 answer
92 views

I am trying to use 16 bit floating point data in my directx 11 buffer but the data always comes back wrong are there special options i need to set on the data to pack it and read it correctly? this is ...
yo76yo's user avatar
  • 166
2 votes
0 answers
108 views

Here's my C++ code that converts HLSL to GLSL: const shaderc::Compiler scompiler; shaderc::CompileOptions soptions; soptions.SetSourceLanguage(shaderc_source_language_hlsl); soptions....
Sarathi's user avatar
  • 1,051
0 votes
0 answers
40 views

I have a HLSL shader I am using in unity and the idea is to take a 2D image and a depth map of that image, and rotate them based on an euler input. Right now it's rotating exactly how I want it to, ...
Ross Gauld's user avatar
-3 votes
1 answer
133 views

What is the result of this hlsl/glsl code (and are they different)? float2x2 m2x2 = { a, b, c, d }; float2 xy = { x, y }; float2 result = mul( m2x2, xy ); Is it result = float2( a*x + b*y, c*x + ...
mitch prater's user avatar
0 votes
1 answer
111 views

In Unity's Editor Scene view, the grid is not visible through an object with the default Lit URP shader, but an object with my custom simple shader appears transparent to this grid. I don’t understand ...
Sonic Slonik's user avatar
1 vote
1 answer
213 views

In my GLSL code in my vertex shader I have: layout(location = 2) out flat uint out_uniform_index; layout(location = 3) out vec2 out_pos_in_chamfer_box; layout(location = 4) out flat vec2 ...
Zebrafish's user avatar
  • 16.3k
0 votes
1 answer
211 views

I cant seem to get any HLSL shader model above 6.6 working in VS22 even though Nvidia tells me that the GPU (RTX 3090) supports shader model 6.8. With SM 6.8 MS recommended windows be placed into dev ...
MeshingAround 's user avatar
0 votes
1 answer
122 views

I've recently been introduced to a new rendering system which uses the bindings from Vulkan and I've created a system where I bind a lot of textures from a vector. This causes an issue that everytime ...
Ing's user avatar
  • 3
1 vote
0 answers
170 views

I implemented an algorithm to fill the RWTexture3D with density values according to y coordinate of the value using compute shader. Basically, density[id] = id.y * 0.01 - 0.5. So my densities are in a ...
AndrewSargin's user avatar
1 vote
1 answer
140 views

I am creating my Colour and Depth textures using a sample description of count 8. When rendering geometry the MSAA appears to be working nicely. However, in my sprite based shaders, where I render ...
jessejbweld's user avatar
-1 votes
1 answer
132 views

I'm writing a compute shader in unity and am writing various HLSL scripts which will be referenced in the compute shader using #include. I have a struct called Move, in a script called MoveC.hlsl. I ...
Frank's user avatar
  • 21
0 votes
0 answers
84 views

In HLSL, I want to make a shader that blends my sprites so that the outline only appears in the borders of the blended shape and not in the interior, like in the image above. I've been trying to use ...
Daniel's user avatar
  • 7,800
0 votes
0 answers
32 views

I have a compute shader that culls object triangles against frustums. For culling, I use a huge vertex and index buffer and a pair of (offset, count) to identify the range of vertices for a single ...
Raildex's user avatar
  • 5,428
0 votes
0 answers
86 views

what will happen if the shader access an array with error index in hlsl? where can find dx spec about this? I wanna know the right behavior that the driver should execute in this situation, such as ...
Yuhang's user avatar
  • 11
2 votes
1 answer
186 views

I am currently learning D3D12 and decided to change from using HLSL 5.0 to 6.0 to be able to use dynamic indexing. The problem is that D3DCompile and D3DCompile2 seen to only support up until HLSL 5.0,...
SegFault The Third's user avatar
0 votes
1 answer
484 views

i recently started working with shaders, and i’d like to avoid using a switch statement. it keeps getting longer and i’m wondering if there are alternative approaches or patterns i can use. below is ...
barry's user avatar
  • 23
2 votes
1 answer
211 views

I am trying to get the shader signature for my vertex shader in HLSL using DirectX 12 and I cannot figure out how to get the data types out of the parameters. vs.hlsl #include "rootsig.hlsl" ...
Flapitys's user avatar
1 vote
0 answers
44 views

I'm unable to properly calculate the normals for gertner waves following the Nvidia article vec3 get_wave(vec4 wave, vec2 direction,vec3 vtx) { // x = SPEED, y = WAVELENGTH, z = AMPLITUDE, w = ...
E F's user avatar
  • 11
1 vote
0 answers
95 views

My vertex shader use cbuffer 'A' it get assign to register b0. At the same time, my pixel shader use cbuffer 'B' and after compilation it get assign to the same register b0. As i can see, in order to ...
Tima Tcvetkov's user avatar
2 votes
0 answers
98 views

Is it possible to store Texture3D resources (preferably of different resolutions) in a BVH or cluster grid, and dynamically index them in a shader at runtime? I'm building a custom volumetric ...
Voxxy's user avatar
  • 21
1 vote
1 answer
58 views

When enabling conservative rasterization, there are lots of fragments generated from edges. How to skip fragments generated from edges shared between two triangles?
carnot's user avatar
  • 301
-1 votes
1 answer
94 views

i don’t have any knowledge about Shaders script. I want to have a float in my shader and rotate my texture with that value on UV. how can i add this option to my Shader? I don't want to use Shader ...
g4me club's user avatar
1 vote
0 answers
441 views

I’m working on a project in Unity where I’m using a compute shader to render grass. The rendering path is Forward+, and I’m trying to make the additional lights affect the grass. I want to achieve ...
user16287208's user avatar
0 votes
0 answers
118 views

I came across this quote on the Outerra blog: using log2 instead of log: in shaders, log function is implemented using the log2 instruction, so it's better to use log2 directly, avoiding an extra ...
Pershing's user avatar
  • 428
1 vote
1 answer
135 views

I'm trying to unpack SNorm16 values in HLSL compute shader. Since SNorm16x4 = 8 bytes total, and Load/Store functions can only read/write 4 bytes I'm trying to get two 4 bytes values as packed to 1 ...
user3169894's user avatar
0 votes
1 answer
427 views

I'm working on a grass instancer using compute shaders. Each grass blade shall be rotated to the ground normal. The problem: I can't use Unity functions like Quaternion.FromToRotation and they musst ...
Buttermilch's user avatar
0 votes
1 answer
98 views

I have this brick wall in a project that I am working on. I modelled the wall itself in Blender: its a whole bunch of bricks which stick out a little from a cube that is meant to be the "mortar&...
JoshGoodwin's user avatar
-1 votes
1 answer
39 views

Let's say we have few function overrides in CG/HLSL, and this functions need some big and almost the same documentation, so how to get it for each override without repeating the same text? /** * Long ...
danliukuri's user avatar
0 votes
0 answers
74 views

I am working on the Unity Learn 3D Game Kit. But in URP project, shaders are not working as expected. So i have to convert them to URP.Below code is from 3D Game Kit shader. I am not good at shader ...
L T R's user avatar
  • 13
2 votes
0 answers
95 views

When I learn the system value SV_PrimitiveID,I have a question. In my realize,SV_PrimitiveID will give each primitive an id.But if I add GS to pipeline and the GS adds new primitive.I want to know if ...
YaoYaoPig's user avatar
1 vote
1 answer
91 views

I am trying to modify this shader code which adds a phosphor effect in the form of "phosphor trails" much like an old CRT monitor. This code is part of MAME emulation software package. Can ...
vespworks's user avatar
1 vote
1 answer
77 views

I try to render a simple 2d quad using DirectX12, but somehow my perspective camera is not displaying the quad, orthographic camera works though. The reason of the perspective camera is to prepare for ...
user15137953's user avatar
0 votes
1 answer
94 views

I am following vkguide but not exactly. I am struggling getting a triangle to appear. When looking at render doc, it seems the vertices are drawn correctly according the the mesh viewer, but nothing ...
CyberFlow's user avatar
1 vote
0 answers
49 views

In unity I'm constructing a mesh on the GPU. Currently, I have to write the vertices / indices back to the CPU before setting them again in the mesh. This is very inefficient and takes about 90% of ...
Jimmy Diddler's user avatar

1
2 3 4 5
34