View 2048_playground.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <cassert> | |
#include <string> | |
void print_tab(int t) | |
{ | |
for (int i = 0; i < t; i++) | |
{ | |
std::cout << "\t"; |
View compiletime-autodiff.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#define F_INLINE __forceinline constexpr | |
template <int VarIndex> | |
struct Var | |
{ | |
template<int OtherVarIndex> | |
static F_INLINE float eval(const Var<OtherVarIndex> & var, const float v) | |
{ |
View runtime-autodiff.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <cassert> | |
#include <memory> | |
enum class Op | |
{ | |
cnst, | |
var, | |
add, |
View lightcuts.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "lightcuts.hpp" | |
template <class PointLightType, class PointLightNodeType> | |
class PointLightTree | |
{ | |
public: | |
Spectrum samplePosition(Vec3 * wi, bool * isVisible, const Intersection & isect, const Scene & scene, const Sampler & sampler) const { assert(false && "unimplemented"); return Spectrum(0.0); }; | |
Spectrum sampleDirection(Vec3 * wi, Vec3 * position, const Sampler & sampler) const { assert(false && "unimplemented"); return Spectrum(0.0); } |
View vrl.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <memory> | |
#include "vrl.h" | |
#include "ir.h" | |
#include "parallel.h" | |
#include "scene.h" | |
#include "imageio.h" | |
#include "spectrum.h" |
View qbvh.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <iostream> | |
#include <vector> | |
#include "common\reflectcuts.h" | |
#include "common\accel.h" | |
// require linearbvhnode | |
#include "accels\linearbvh.h" |
View blackbody_approx.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://portsmouth.github.io/Trinity/ | |
// Approximate map from temperature in Kelvin to blackbody emission color. | |
// Valid from 1000 to 40000 K (and additionally 0 for pure full white) | |
vec3 colorTemperatureToRGB(const in float temperature) | |
{ | |
mat3 m = (temperature <= 6500.0) ? mat3(vec3(0.0, -2902.1955373783176, -8257.7997278925690), | |
vec3(0.0, 1669.5803561666639, 2575.2827530017594), | |
vec3(1.0, 1.3302673723350029, 1.8993753891711275)) : | |
mat3(vec3(1745.0425298314172, 1216.6168361476490, -8257.7997278925690), |
View pfm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import re | |
import sys | |
import matplotlib.pyplot as plt | |
def flip(m, axis): | |
if not hasattr(m, 'ndim'): | |
m = np.asarray(m) | |
indexer = [slice(None)] * m.ndim | |
try: |
View mybvh.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <cassert> | |
#include <vector> | |
#include "common\intersection.h" | |
#include "common\reflectcuts.h" | |
#include "common\accel.h" | |
#include "math\ray.h" | |
#include "math\math.h" |
View cuda-gltexture-interop.cu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This software contains source code provided by NVIDIA Corporation. | |
#include "cuda_runtime.h" | |
#include "cuda_surface_types.h" | |
#include "surface_functions.h" | |
// must include in this order :( | |
#include "GL\glew.h" | |
#include "cuda_gl_interop.h" | |
#include "GLFW\glfw3.h" |
NewerOlder