42 lines
874 B
HLSL
42 lines
874 B
HLSL
#include "bindless_structs.hlsli"
|
|
|
|
struct CameraData
|
|
{
|
|
float4x4 View;
|
|
float4x4 Projection;
|
|
float4x4 InvView;
|
|
float4x4 InvProjection;
|
|
float4 Position;
|
|
};
|
|
|
|
struct Block
|
|
{
|
|
uint VertexBufferHandle;
|
|
uint VertexDataHandle;
|
|
uint MaterialBufferHandle;
|
|
uint NodeBufferHandle;
|
|
uint EnvCubeHandle;
|
|
uint DiffuseIrradianceHandle;
|
|
uint LightHandle;
|
|
uint PointLightIndexer;
|
|
uint DirectionalLightIndexer;
|
|
int MaterialIdx;
|
|
uint NodeIdx;
|
|
};
|
|
|
|
[[vk::binding(0, 1)]] ConstantBuffer<CameraData> Camera;
|
|
|
|
[[vk::push_constant]]
|
|
Block PushConstant;
|
|
|
|
float3 Uncharted2Tonemap(float3 color)
|
|
{
|
|
float A = 0.15f;
|
|
float B = 0.50f;
|
|
float C = 0.10f;
|
|
float D = 0.20f;
|
|
float E = 0.02f;
|
|
float F = 0.30f;
|
|
float W = 11.2f;
|
|
return ((color * (A * color + C * B) + D * E) / (color * (A * color + B) + D * F)) - E / F;
|
|
} |