Skip to content

Commit

Permalink
Fixes AO hash function for random angle for high display resolutions.
Browse files Browse the repository at this point in the history
  • Loading branch information
tebjan authored and xen2 committed Oct 19, 2021
1 parent 98f02a4 commit 679b86c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ namespace Stride.Rendering.Images
// Hash function used in the HPG12 AlchemyAO paper
int linearDepthInt = (int)linearDepth;
//float randomPatternRotationAngle = (3 * screenPosition.x ^ screenPosition.y + screenPosition.x * screenPosition.y) * 10;
float randomPatternRotationAngle = (15 * linearDepthInt + 3 * screenPosition.x ^ 2 * screenPosition.y + screenPosition.x * screenPosition.y) * 10;
float randomPatternRotationAngle = ((15 * linearDepthInt + 3 * screenPosition.x ^ 2 * screenPosition.y + screenPosition.x * screenPosition.y) & 0x0000FFFF) * 10;

//*****************************
// Choose a sample radius proportional to the projected area of the half-sphere
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <auto-generated>
// <auto-generated>
// Do not edit this file yourself!
//
// This code was generated by Stride Shader Mixin Code Generator.
Expand Down

0 comments on commit 679b86c

Please sign in to comment.