I see that HSLS has float and a number after float (1-4) and a lot of fields (r, rr, rrrr, arar,...) (I see these fields with the help of HLSL Tool Thanks to Tim Jones :D - I can't imagine (for now) how can we programming HSLS without this tool).
I try to find references about this data type and its field but I can't find anything about it(why the number 1-4 and the meanings of its fields. In C++ float is just float number, here, what is float)
Below is my progress so far:
According to this article
float - 32-bit floating point value.
For example, here is a 4-component signed-normalized float-variable declaration.
snorm float4 fourComponentIEEEFloat;
It doesn't answer my question: What does this code mean
RWTexture2D<float4> testTexture : register(u0);
[numthreads(@value( threads_per_group_x ), @value( threads_per_group_y ), @value( threads_per_group_z ))]
void main
(
uint3 gl_LocalInvocationID : SV_GroupThreadID,
uint3 gl_GlobalInvocationID : SV_DispatchThreadId
)
{
testTexture[gl_GlobalInvocationID.xy].xyzw = float4( float2(gl_LocalInvocationID.xy) / 16.0f, 0.0f, 1.0f );
}
I may slightly understand that float2(gl_LocalInvocationID.xy) is 2 float
testTexture[gl_GlobalInvocationID.xy].xyzw = float4( float2(gl_LocalInvocationID.xy) / 16.0f, 0.0f, 1.0f );
is equal
testTexture[gl_GlobalInvocationID.xy].xyzw = float4(gl_LocalInvocationID.x / 16.0f, gl_LocalInvocationID.y / 16.0f, 0.0f, 1.0f);
But I don't know if it's right, beside, how about fields r, rr, rrrr, arar,... I mention earlier.
Thanks for reading.