Skip to content

Commit

Permalink
com.unity.render-pipelines.core@4.8.0-preview
Browse files Browse the repository at this point in the history
## [4.8.0-preview] - 2018-01-16

## [4.7.0-preview] - 2018-01-13
  • Loading branch information
Unity Technologies committed Jan 15, 2018
1 parent b061042 commit 9b9b1b9
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.8.0-preview] - 2018-01-16

## [4.7.0-preview] - 2018-01-13

## [4.6.0-preview] - 2018-12-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Volume/VolumeProfile.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ShaderLibrary/API/GLCore.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
#define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias)
#endif
#define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3)
#define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod)

#define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z)
#define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z)
Expand Down
3 changes: 3 additions & 0 deletions ShaderLibrary/API/Switch.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#define CBUFFER_START(name) cbuffer name {
#define CBUFFER_END };

#define PLATFORM_SUPPORTS_EXPLICIT_BINDING 1
#define PLATFORM_NEEDS_UNORM_UAV_SPECIFIER 1

// flow control attributes
#define UNITY_BRANCH [branch]
#define UNITY_FLATTEN [flatten]
Expand Down
20 changes: 20 additions & 0 deletions ShaderLibrary/BSDF.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ real D_GGX(real NdotH, real roughness)
}

// Ref: Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs, p. 19, 29.
// p. 84 (37/60)
real G_MaskingSmithGGX(real NdotV, real roughness)
{
// G1(V, H) = HeavisideStep(VdotH) / (1 + Λ(V)).
Expand Down Expand Up @@ -335,6 +336,25 @@ real DV_SmithJointGGXAniso(real TdotH, real BdotH, real NdotH,
roughnessT, roughnessB, partLambdaV);
}

// Get projected roughness for a certain normalized direction V in tangent space
// and an anisotropic roughness
// Ref: Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs, Heitz 2014, pp. 86, 88 - 39/60, 41/60
float GetProjectedRoughness(float TdotV, float BdotV, float NdotV, float roughnessT, float roughnessB)
{
float2 roughness = float2(roughnessT, roughnessB);
float sinTheta2 = max((1 - Sq(NdotV)), FLT_MIN);
// if sinTheta^2 = 0, NdotV = 1, TdotV = BdotV = 0 and roughness is arbitrary, no real azimuth
// as there's a breakdown of the spherical parameterization, so we clamp under by FLT_MIN in any case
// for safe division
// Note:
// sin(thetaV)^2 * cos(phiV)^2 = (TdotV)^2
// sin(thetaV)^2 * sin(phiV)^2 = (BdotV)^2
float2 vProj2 = Sq(float2(TdotV, BdotV)) * rcp(sinTheta2);
// vProj2 = (cos^2(phi), sin^2(phi))
float projRoughness = sqrt(dot(vProj2, roughness*roughness));
return projRoughness;
}

//-----------------------------------------------------------------------------
// Diffuse BRDF - diffuseColor is expected to be multiply by the caller
//-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion ShaderLibrary/CommonLighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ real SphericalCapIntersectionSolidArea(real cosC1, real cosC2, real cosB)
{
real diff = abs(r1 - r2);
real den = r1 + r2 - diff;
real x = 1.0 - saturate((rd - diff) / den);
real x = 1.0 - saturate((rd - diff) / max(den, 0.0001));
area = smoothstep(0.0, 1.0, x);
area *= TWO_PI - TWO_PI * max(cosC1, cosC2);
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"name": "com.unity.render-pipelines.core",
"repoPackagePath": "com.unity.render-pipelines.core",
"repository": {
"revision": "529ebad8bdc2c75e2b90d30f210e71f2dab0adba",
"revision": "2af273f1d8ddb6e0b8a77363916782df7e4990be",
"type": "git",
"url": "ssh://git@github.com/Unity-Technologies/ScriptableRenderLoop.git"
},
"unity": "2018.3",
"version": "4.6.0-preview"
"version": "4.8.0-preview"
}

0 comments on commit 9b9b1b9

Please sign in to comment.