January 2014
Intermediate to advanced
430 pages
9h 51m
English
In this recipe we will explore using a compute shader to gather characteristics from the source image and output to a buffer. The characteristic that we will be determining is the image's luminance histogram, that is, how many texels are there within the texture for each luminance value (mapped from 0.0-1.0 to 0-255).
We will also cover how to retrieve the data from the GPU and load it into an array that is accessible from the CPU.
We'll begin with the HLSL code necessary to calculate the histogram.
Texture2D SRV; however, this time our output UAV will be RWByteAddressBuffer.Texture2D<float4> input : register(t0);
RWByteAddressBuffer outputByteBuffer : register(u0); ...Read now
Unlock full access