Skip to content

Instantly share code, notes, and snippets.

View skwerner's full-sized avatar

Stefan Werner skwerner

View GitHub Profile
@pixnblox
pixnblox / shading_position.hlsl
Last active May 14, 2024 08:43
Address the shadow terminator problem by computing a new shading position
// Projects the specified position (point) onto the plane with the specified origin and normal.
float3 projectOnPlane(float3 position, float3 origin, float3 normal)
{
return position - dot(position - origin, normal) * normal;
}
// Computes the shading position of the specified geometric position and vertex positions and
// normals. For a triangle with normals describing a convex surface, this point will be slightly
// above the surface. For a concave surface, the geometry position is used directly.
// NOTE: The difference between the shading position and geometry position is significant when
@syoyo
syoyo / gist:831c4b1926aa88c0da9221211723da2d
Created December 17, 2018 13:12
C++ implementaion of "A simple method to construct isotropic quasirandom blue noise point sequences"
//
// C++ implementaion of "A simple method to construct isotropic quasirandom blue
// noise point sequences"
//
// http://extremelearning.com.au/a-simple-method-to-construct-isotropic-quasirandom-blue-noise-point-sequences/
//
// Assume 0 <= x
static double myfmod(double x) { return x - std::floor(x); }
@alirobe
alirobe / reclaimWindows10.ps1
Last active June 23, 2024 22:08
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###