浏览代码
HDRenderLoop: Add builtin data structure + add velocity buffer
HDRenderLoop: Add builtin data structure + add velocity buffer
- Add velocity buffer as an experiment for the design - Split surface data into surface data and builtin data (engine side for lightmap etc...)/main
sebastienlagarde
8 年前
当前提交
36c50926
共有 18 个文件被更改,包括 516 次插入 和 172 次删除
-
40Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/DisneyGGX.shader
-
7Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred.shader
-
3Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward.hlsl
-
114Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/DisneyGGX.hlsl
-
151Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Material.hlsl
-
108Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/TemplateDisneyGGX.hlsl
-
2Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl
-
89Assets/TestScenes/HDTest/HDRenderLoopTest.unity
-
28Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/test.mat
-
11Assets/TestScenes/HDTest/Rock/rcgRock012/Materials/rcgRock012Material.mat
-
32Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/BuiltinData.hlsl
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/BuiltinData.hlsl.meta
-
30Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit.hlsl
-
9Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit.hlsl.meta
-
7Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderConfig.cs
-
12Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderConfig.cs.meta
-
28Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/CommonMaterial.hlsl
-
8Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/CommonMaterial.hlsl.meta
|
|||
#ifndef UNITY_BUILTIN_DATA_INCLUDED |
|||
#define UNITY_BUILTIN_DATA_INCLUDED |
|||
|
|||
//----------------------------------------------------------------------------- |
|||
// BuiltinData |
|||
// This structure include common data that should be present in all material |
|||
// and are independent from the BSDF parametrization. |
|||
// Note: These parameters can be store in GBuffer if the writer wants |
|||
//----------------------------------------------------------------------------- |
|||
|
|||
struct BuiltinData |
|||
{ |
|||
float opacity; |
|||
|
|||
// These are lighting data. |
|||
// We would prefer to split lighting and material information but for performance reasons, |
|||
// those lighting information are fill |
|||
// at the same time than material information. |
|||
float3 bakeDiffuseLighting; // This is the result of sampling lightmap/lightprobe/proxyvolume |
|||
|
|||
float3 emissiveColor; |
|||
float emissiveIntensity; |
|||
|
|||
// These is required for motion blur and temporalAA |
|||
float2 velocity; |
|||
|
|||
// Distortion |
|||
float2 distortion; |
|||
float distortionBlur; // Define the color buffer mipmap level to use |
|||
}; |
|||
|
|||
#endif // UNITY_BUILTIN_DATA_INCLUDED |
|
|||
fileFormatVersion: 2 |
|||
guid: 82161f939b9c88745950020764de18c9 |
|||
timeCreated: 1475658936 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifndef UNITY_UNLIT_INCLUDED |
|||
#define UNITY_UNLIT_INCLUDED |
|||
|
|||
struct SurfaceData |
|||
{ |
|||
float3 color; |
|||
BuiltinData builtin; |
|||
}; |
|||
|
|||
struct BSDFData |
|||
{ |
|||
float3 color; |
|||
}; |
|||
|
|||
//----------------------------------------------------------------------------- |
|||
// conversion function for forward |
|||
//----------------------------------------------------------------------------- |
|||
|
|||
BSDFData ConvertSurfaceDataToBSDFData(SurfaceData data) |
|||
{ |
|||
BSDFData output; |
|||
output.color = data.color; |
|||
} |
|||
|
|||
//----------------------------------------------------------------------------- |
|||
// No light evaluation, this is unlit |
|||
//----------------------------------------------------------------------------- |
|||
|
|||
|
|||
#endif // UNITY_UNLIT_INCLUDED |
|
|||
fileFormatVersion: 2 |
|||
guid: 00f37057845073e4880c18942abfb094 |
|||
timeCreated: 1475742185 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//-----------------------------------------------------------------------------
|
|||
// Configuration
|
|||
//-----------------------------------------------------------------------------
|
|||
|
|||
// #define DIFFUSE_LAMBERT_BRDF
|
|||
// #define VELOCITY_IN_GBUFFER
|
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 4c02a0bb722d0214696c302f8fe1688e |
|||
timeCreated: 1475742183 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#ifndef UNITY_COMMON_MATERIAL_INCLUDED |
|||
#define UNITY_COMMON_MATERIAL_INCLUDED |
|||
|
|||
//----------------------------------------------------------------------------- |
|||
// Parametrization function helpers |
|||
//----------------------------------------------------------------------------- |
|||
|
|||
float PerceptualRoughnessToRoughness(float perceptualRoughness) |
|||
{ |
|||
return perceptualRoughness * perceptualRoughness; |
|||
} |
|||
|
|||
float RoughnessToPerceptualRoughness(float roughness) |
|||
{ |
|||
return sqrt(roughness); |
|||
} |
|||
|
|||
float PerceptualSmoothnessToRoughness(float perceptualSmoothness) |
|||
{ |
|||
return (1 - perceptualSmoothness) * (1 - perceptualSmoothness); |
|||
} |
|||
|
|||
float PerceptualSmoothnessToPerceptualRoughness(float perceptualSmoothness) |
|||
{ |
|||
return (1 - perceptualSmoothness); |
|||
} |
|||
|
|||
#endif // UNITY_COMMON_MATERIAL_INCLUDED |
|
|||
fileFormatVersion: 2 |
|||
guid: 71aa77c8ecebcc942b7914328d88f7d1 |
|||
timeCreated: 1474465931 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue