Commit 95a767d4 authored by Leona Kirchem's avatar Leona Kirchem

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	Assets/PostProcessing.meta
parents 69016d8c 417c3168
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8a3bdb2cd68f901469e7cc149151eb49, type: 3}
m_Name: CC
m_EditorClassIdentifier:
debugViews:
m_Enabled: 1
m_Settings:
mode: 0
depth:
scale: 1
motionVectors:
sourceOpacity: 1
motionImageOpacity: 0
motionImageAmplitude: 16
motionVectorsOpacity: 1
motionVectorsResolution: 24
motionVectorsAmplitude: 64
fog:
m_Enabled: 1
m_Settings:
excludeSkybox: 1
antialiasing:
m_Enabled: 1
m_Settings:
method: 0
fxaaSettings:
preset: 2
taaSettings:
jitterSpread: 0.75
sharpen: 0.3
stationaryBlending: 0.95
motionBlending: 0.85
ambientOcclusion:
m_Enabled: 1
m_Settings:
intensity: 1
radius: 0.3
sampleCount: 10
downsampling: 1
forceForwardCompatibility: 0
ambientOnly: 0
highPrecision: 0
screenSpaceReflection:
m_Enabled: 0
m_Settings:
reflection:
blendType: 0
reflectionQuality: 2
maxDistance: 100
iterationCount: 256
stepSize: 3
widthModifier: 0.5
reflectionBlur: 1
reflectBackfaces: 0
intensity:
reflectionMultiplier: 1
fadeDistance: 100
fresnelFade: 1
fresnelFadePower: 1
screenEdgeMask:
intensity: 0.03
depthOfField:
m_Enabled: 0
m_Settings:
focusDistance: 10
aperture: 5.6
focalLength: 50
useCameraFov: 0
kernelSize: 1
motionBlur:
m_Enabled: 1
m_Settings:
shutterAngle: 270
sampleCount: 10
frameBlending: 0
eyeAdaptation:
m_Enabled: 0
m_Settings:
lowPercent: 45
highPercent: 95
minLuminance: -5
maxLuminance: 1
keyValue: 0.25
dynamicKeyValue: 1
adaptationType: 0
speedUp: 2
speedDown: 1
logMin: -8
logMax: 4
bloom:
m_Enabled: 1
m_Settings:
bloom:
intensity: 0.5
threshold: 1.1
softKnee: 0.5
radius: 4
antiFlicker: 0
lensDirt:
texture: {fileID: 0}
intensity: 3
colorGrading:
m_Enabled: 1
m_Settings:
tonemapping:
tonemapper: 2
neutralBlackIn: 0.02
neutralWhiteIn: 10
neutralBlackOut: 0
neutralWhiteOut: 10
neutralWhiteLevel: 5.3
neutralWhiteClip: 10
basic:
postExposure: 0
temperature: 0
tint: 0
hueShift: 0
saturation: 1
contrast: 1
channelMixer:
red: {x: 1, y: 0, z: 0}
green: {x: 0, y: 1, z: 0}
blue: {x: 0, y: 0, z: 1}
currentEditingChannel: 0
colorWheels:
mode: 1
log:
slope: {r: 0, g: 1, b: 0.3695724, a: 0}
power: {r: 1, g: 0.03421221, b: 0, a: 0}
offset: {r: 0.1237998, g: 0, b: 1, a: 0}
linear:
lift: {r: 0, g: 0, b: 0, a: 0}
gamma: {r: 0, g: 0, b: 0, a: 0}
gain: {r: 0, g: 0, b: 0, a: 0}
curves:
master:
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0
m_Range: 1
red:
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0
m_Range: 1
green:
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0
m_Range: 1
blue:
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0
m_Range: 1
hueVShue:
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 1
m_ZeroValue: 0.5
m_Range: 1
hueVSsat:
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 1
m_ZeroValue: 0.5
m_Range: 1
satVSsat:
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0.5
m_Range: 1
lumVSsat:
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0.5
m_Range: 1
e_CurrentEditingCurve: 0
e_CurveY: 1
e_CurveR: 0
e_CurveG: 0
e_CurveB: 0
userLut:
m_Enabled: 0
m_Settings:
lut: {fileID: 0}
contribution: 1
chromaticAberration:
m_Enabled: 0
m_Settings:
spectralTexture: {fileID: 0}
intensity: 0.1
grain:
m_Enabled: 0
m_Settings:
colored: 1
intensity: 0.5
size: 1
luminanceContribution: 0.8
vignette:
m_Enabled: 0
m_Settings:
mode: 0
color: {r: 0, g: 0, b: 0, a: 1}
center: {x: 0.5, y: 0.5}
intensity: 0.45
smoothness: 0.2
roundness: 1
mask: {fileID: 0}
opacity: 1
rounded: 0
dithering:
m_Enabled: 0
monitors:
currentMonitorID: 0
refreshOnPlay: 0
histogramMode: 3
waveformExposure: 0.12
waveformY: 0
waveformR: 1
waveformG: 1
waveformB: 1
paradeExposure: 0.12
vectorscopeExposure: 0.12
vectorscopeShowBackground: 1
fileFormatVersion: 2
guid: c14e2441969e44f4c86d448399deffde
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8e6292b2c06870d4495f009f912b9600, type: 3}
m_Name: Main Camera Profile
m_EditorClassIdentifier:
settings: []
fileFormatVersion: 2
guid: 7180d951eba35ee468019736ee6bcf6b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ab3b315892c69f249afd16fb70e48fe4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 83715878d3a8db441aa5636641db69a3
folderAsset: yes
timeCreated: 1476176392
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e7358848dd8737c459f4636f1c075835
folderAsset: yes
timeCreated: 1460361782
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
#include "UnityCG.cginc"
RWStructuredBuffer<uint4> _Histogram;
Texture2D<float4> _Source;
CBUFFER_START (Params)
uint _IsLinear;
float4 _Res;
uint4 _Channels;
CBUFFER_END
groupshared uint4 gs_histogram[256];
#define GROUP_SIZE 16
#pragma kernel KHistogramGather
[numthreads(GROUP_SIZE, GROUP_SIZE,1)]
void KHistogramGather(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupThreadId : SV_GroupThreadID)
{
const uint localThreadId = groupThreadId.y * GROUP_SIZE + groupThreadId.x;
if (localThreadId < 256)
gs_histogram[localThreadId] = uint4(0, 0, 0, 0);
GroupMemoryBarrierWithGroupSync();
if (dispatchThreadId.x < (uint)_Res.x && dispatchThreadId.y < (uint)_Res.y)
{
// We want a gamma histogram (like Photoshop & all)
float3 color = saturate(_Source[dispatchThreadId].xyz);
if (_IsLinear > 0)
color = LinearToGammaSpace(color);
// Convert color & luminance to histogram bin
uint3 idx_c = (uint3)(round(color * 255.0));
uint idx_l = (uint)(round(dot(color.rgb, float3(0.2125, 0.7154, 0.0721)) * 255.0));
// Fill the group shared histogram
if (_Channels.x > 0u) InterlockedAdd(gs_histogram[idx_c.x].x, 1); // Red
if (_Channels.y > 0u) InterlockedAdd(gs_histogram[idx_c.y].y, 1); // Green
if (_Channels.z > 0u) InterlockedAdd(gs_histogram[idx_c.z].z, 1); // Blue
if (_Channels.w > 0u) InterlockedAdd(gs_histogram[idx_l].w, 1); // Luminance
}
GroupMemoryBarrierWithGroupSync();
// Merge
if (localThreadId < 256)
{
uint4 h = gs_histogram[localThreadId];
if (_Channels.x > 0u && h.x > 0) InterlockedAdd(_Histogram[localThreadId].x, h.x); // Red
if (_Channels.y > 0u && h.y > 0) InterlockedAdd(_Histogram[localThreadId].y, h.y); // Green
if (_Channels.z > 0u && h.z > 0) InterlockedAdd(_Histogram[localThreadId].z, h.z); // Blue
if (_Channels.w > 0u && h.w > 0) InterlockedAdd(_Histogram[localThreadId].w, h.w); // Luminance
}
}
// Scaling pass
groupshared uint4 gs_pyramid[256];
#pragma kernel KHistogramScale
[numthreads(16,16,1)]
void KHistogramScale(uint2 groupThreadId : SV_GroupThreadID)
{
const uint localThreadId = groupThreadId.y * 16 + groupThreadId.x;
gs_pyramid[localThreadId] = _Histogram[localThreadId];
GroupMemoryBarrierWithGroupSync();
// Parallel reduction to find the max value
UNITY_UNROLL
for(uint i = 256 >> 1; i > 0; i >>= 1)
{
if(localThreadId < i)
gs_pyramid[localThreadId] = max(gs_pyramid[localThreadId], gs_pyramid[localThreadId + i]);
GroupMemoryBarrierWithGroupSync();
}
// Actual scaling
float4 factor = _Res.y / (float4)gs_pyramid[0];