Skip to content

Instantly share code, notes, and snippets.

Claudia Doppioslash doppioslash

Block or report user

Report or block doppioslash

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
pxv8270 /
Last active Feb 22, 2020
Useful Resources for Rendering Volumetric Clouds
JarkkoPFC / sphere_screen_extents.h
Last active Jan 31, 2020
Calculates view space 3D sphere extents on the screen
View sphere_screen_extents.h
struct vec3f {float x, y, z;};
struct vec4f {float x, y, z, w;};
struct mat44f {vec4f x, y, z, w;};
// sphere_screen_extents
// Calculates the exact screen extents xyzw=[left, bottom, right, top] in
// normalized screen coordinates [-1, 1] for a sphere in view space. For
// performance, the projection matrix (v2p) is assumed to be setup so that
rngtm / DomainWarpingNode.cs
Last active Sep 28, 2019
ドメインワーピング( ) をシェーダーグラフで使うためにカスタムノード化したものです
View DomainWarpingNode.cs
using UnityEngine;
using UnityEditor.ShaderGraph;
using System.Reflection;
/// <summary>
/// ドメインワーピング(
/// </summary>
[Title("Custom", "Domain Warping(@iquilezles)")]
public class DomainWarpingNode : CodeFunctionNode
paniq /
Last active Jun 17, 2019
Borrow Inference

Borrow Inference

by Leonard Ritter, Duangle GbR

This is a description of borrow inference, an alternative to borrow checking that requires no declarative annotations to support proper management of unique values and borrowed references at compile time.

We are trying to infer whether a value is borrowed or has to be unique, applying this constraint going backwards through the function, as we also need to prevent

sketchpunk / Bezier3D.js
Last active Nov 22, 2018
Bezier Spline and Arc Length
View Bezier3D.js
import Vec3 from "/fungi/maths/Vec3.js";
class Bezier{
static get(p0, p1, p2, p3, t, out){
let i = 1 - t,
ii = i * i,
iii = ii * i,
tt = t * t,
ttt = tt * t,
iit3 = 3 * ii * t,
rxwei /
Last active Nov 4, 2019
First-Class Automatic Differentiation in Swift: A Manifesto
phi-lira / PhysicallyBasedExample.shader
Last active Mar 27, 2019
Physically Based Example shader that works with Lightweight Render Pipeline (LWRP) 4.X.X-preview
View PhysicallyBasedExample.shader
Use instead.
sebbbi / ConeTraceAnalytic.txt
Created Aug 27, 2018
Cone trace analytic solution
View ConeTraceAnalytic.txt
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
randomPoison / UnitySystem.cs
Created Jul 16, 2018
Comparison of writing a system with Unity's new ECS vs writing one in Amethyst.
View UnitySystem.cs
using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;
using Unity.Transforms2D;
namespace TwoStickPureExample
public class PlayerMoveSystem : ComponentSystem
public struct Data
View gist:8df6d6c29369a1188e4e76df686024af
Lets pretend we have a 1d function f defined on x in [0,1] that we don't quite know, but we have a feeling for the general shape.
For x<0.5 it is often small, below 0.1. For x>0.5 it is higher, often close to 1.0.
Now we can break f into two functions on A=[0,0.5] and B=[0.5,1] and integrate them one at the time.
The sum of the two will be the integral of the entire range.
How many samples should we take for each of those two?
A key observation here is that if we get the integral on A 5% wrong that will be way worse than if we get the integral on B 5% wrong. Why? This is due to the fact that the integral over A will be much smaller than the integral over B, so it will contribute less to the full integral. If we place more samples in A or B we must compensate since they will have a different N-factor that we
divide with when we do the averaging.
You can’t perform that action at this time.