private static readonly int _ColorFilter | Shader property id for _ColorFilter. |
private static readonly int _FinalResults | Shader property id for _FinalResults. |
private static readonly int _Input | Shader property id for _Input. |
private static readonly int _MaxTotalDarkness | Shader property id for _MaxTotalDarkness. |
private static readonly int _MaxValue | Shader property id for _MaxValue. |
private static readonly int _ResultsCount | Shader property id for _ResultsCount. |
private static readonly int _ResultsSum | Shader property id for _ResultsSum. |
private static readonly int _TempRT | Shader property id for _TempRT. Not used. |
private int BufferClearKernel | Kernel index that clears the result buffers. |
private CommandBuffer cameraBuffer | Command buffer that copies the camera image to samplingRT. |
private ComputeShader computeShader | The darkness compute shader from the reader settings. |
private int DarknessReadKernel | Kernel index that samples the image into per-group sums and counts. |
private int DarknessResultKernel | Kernel index that reduces the sums to one value. |
private ComputeBuffer finalResultBuffer | One-value buffer with the final darkness result. |
private int height | Sample texture height, the camera height scaled by DownSampleScale. |
private ComputeBuffer resultCountBuffer | Buffer of 256 per-group sample counts. |
private ComputeBuffer resultSumBuffer | Buffer of 256 per-group darkness sums. |
private RenderTexture samplingRT | Down-scaled temporary copy of the camera image. |
private Camera targetCamera | The player's camera. |
private static readonly CameraEvent targetCameraEvent | Camera event the copy runs at, after opaque image effects. |
private int width | Sample texture width, twice the scaled camera width. |