- Bluenoise in the game INSIDE (dithering, raymarching, reflections)
- Dithering, Ray marching, shadows etc
- A Survery of Blue Noise and Its Applications
- Moments In Graphics (void-and-cluster)
- Bart Wronski Implementation of Solid Angle algorithm
Spherical cap cone analytic solution is a 1d problem, since the cone cap sphere slides along the ray. The intersection point to empty space sphere is always on the ray. | |
S : radius of cone cap sphere at t=1 | |
r(d) : cone cap sphere radius at distance d | |
r(d) = d*S | |
p = distance of current SDF sample | |
SDF(p) = sdf function result at location p | |
x = distance after conservative step |
// half->float variants. | |
// by Fabian "ryg" Giesen. | |
// | |
// I hereby place this code in the public domain. | |
// | |
// half_to_float_fast: table based | |
// tables could be done in a more compact fashion (in particular, can store tab2 in low word of tab1!) | |
// but something of a dead end since not very SIMD-friendly. pretty much abandoned at this point. | |
// | |
// half_to_float_fast2: use FP adder hardware to deal with denormals. |
/// <summary> | |
/// Implementation of Mersenne Twister random number generator | |
/// </summary> | |
public class MersennePrimeRandom | |
{ | |
private readonly uint[] _matrix = new uint[624]; | |
private int _index = 0; | |
public MersennePrimeRandom() : this((uint)(0xFFFFFFFF & DateTime.Now.Ticks)) { } |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.
Imagine a long-running development branch periodically merges from master. The
git log --graph --all --topo-order
is not as simple as it could be, as of git version 1.7.10.4.
It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.
/* | |
The MIT License (MIT) | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in | |
all copies or substantial portions of the Software. |
#extension GL_EXT_shader_texture_lod : enable | |
uniform samplerCube uRadianceMap; | |
uniform samplerCube uIrradianceMap; | |
#define saturate(x) clamp(x, 0.0, 1.0) | |
#define PI 3.1415926535897932384626433832795 | |
const float A = 0.15; |
Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.
In C++20 we will hopefully get bit_cast see the proposal and reference implementation. This utility should give a simple and safe way to type pun.
The one issue I ran into is that is requires the size of the To and From type to be the same, as well as checking To and From are trivially copyable, the static_assert version is below:
# define BIT_CAST_STATIC_ASSERTS(TO, FROM) do { \
static_assert(sizeof(TO) == sizeof(FROM)); \
static_assert(std::is_trivially_copyable<TO>::value); \
static_assert(std::is_trivially_copyable<FROM>::value); \
} while (false)