2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
|
|
|
|
2021-02-02 21:25:06 +00:00
|
|
|
#include "shared.effect"
|
|
|
|
#include "lut.effect"
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Uniforms
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
uniform texture2d image;
|
|
|
|
uniform texture2d lut;
|
|
|
|
uniform int4 lut_params_0; // [size, grid_size, texture_size, 0]
|
|
|
|
uniform float4 lut_params_1; // [inverse_size, inverse_grid_size, inverse_texture_size, half_texel]
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Functionality
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
float4 PSConsumeLUT(VertexData vtx) : TARGET {
|
|
|
|
float4 c = image.Sample(LinearClampSampler, vtx.uv);
|
|
|
|
return float4(sample_lut2(c.rgb, lut, lut_params_0, lut_params_1), c.a);
|
|
|
|
};
|
|
|
|
|
|
|
|
technique Draw {
|
|
|
|
pass {
|
|
|
|
vertex_shader = DefaultVertexShader(vtx);
|
|
|
|
pixel_shader = PSConsumeLUT(vtx);
|
|
|
|
}
|
|
|
|
}
|