EDIT: Changed kernal params to ‘uint3 groupID : SV_DispatchThreadID’ because google says this is “per-pixel”
So i have this simple Compute shader i was trying to develop to learn the stack, and… Am i doing something wrong? When developing it i noticed that only the reds were being implemented, and i messed around with it and maybe i’m just missing something? I knew a lot and used Unity Compute shaders a lot but this seems different so i don’t know if i’m doing something wrong or not.
Red = (1.0, 0.0, 0.0)
Green = (0.0, 1.0, 0.0)
Blue = (0.0, 0.0, 1.0)
Here is the shader:
#include "./Flax/Common.hlsl"
// Input texture to blur and the output texture to write to
Texture2D Input : register(t0);
RWTexture2D<float4> Output : register(u0);
META_CB_BEGIN(0, Data)
float3 Red;
float3 Green;
float3 Blue;
META_CB_END
// Compute shader blur function for horizontal pass
META_CS(true, FEATURE_LEVEL_SM5)
[numthreads(32, 32, 1)]
void CS_ColorShift(uint3 groupID : SV_DispatchThreadID)
{
float3 TempColor = float3(0.0, 0.0, 0.0);
//Add new Red in intensity of input red
TempColor.rgb += (Red * Input[groupID.xy].r);
//Add new Green in intensity of input green
TempColor.rgb += (Green * Input[groupID.xy].g);
//Add new Blue in intensity of input blue
TempColor.rgb += (Blue * Input[groupID.xy].b);
Output[groupID.xy] = float4(TempColor.rgb, 1.0);
}
And here is what is happening:
Why is it just red.



