Skip to content

Instantly share code, notes, and snippets.

@gerwang
gerwang / calculate_chamfer_distance.ipynb
Created September 26, 2022 08:00
Caculate chamfer distance on the DiLiGent-MV dataset.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gerwang
gerwang / align_diligentmv_psnerf.ipynb
Created September 26, 2022 04:55
Obtain the transformation matrix from data in PSNeRF's space to the original DiLiGent-MV space
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#version 430 core
layout(location = 0) in vec3 in_position;
layout(location = 1) in vec2 in_tex_pos;
layout(location = 2) in vec3 in_normal;
out vec3 fs_normal;
out vec2 fs_tex_pos;
uniform mat4 mvpMat;
#version 430 core
in vec3 fs_normal;
in vec2 fs_tex_pos;
uniform float sh[9];
uniform sampler2D corresTexture;
layout(location = 0) out vec4 out_color;
layout(location = 1) out vec4 out_shading;
@gerwang
gerwang / sh.py
Last active October 10, 2019 10:05
python code to compute spherical harmonics
import numpy as np
sh = np.zeros(9)
sh[0] = 1 / np.sqrt(4 * np.pi)
sh[1:4] = 2 * np.pi / 3 * np.sqrt(3 / (4 * np.pi))
sh[4] = np.pi / 8 * np.sqrt(5 / (4 * np.pi))
sh[5:8] = 3 * np.pi / 4 * np.sqrt(5 / (12 * np.pi))
sh[8] = 3 * np.pi / 8 * np.sqrt(5 / (12 * np.pi))
def calc_sh_light(x, y, z):
@gerwang
gerwang / gist:0ecd264cff529588b769883aa0fe6ba2
Last active August 4, 2019 17:49
Error log when making OpenBLAS
make[1]: Entering directory '/mnt/Data2/jingwang/git-task/vcpkg/downloads/OpenBLAS-0.3.6/interface'
${HOME}/Data/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -O2 -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_G77 -fPIC -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=40 -DMAX_PARALLEL_NUMBER=1 -DVERSION=\"0.3.6\" -mavx2 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I. -O2 -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_G77 -fPIC -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=40 -DMAX_PARALLEL_NUMBER=1 -DVERSION=\"0.3.6\" -mavx2 -DASMNAME=saxpy -DASMFNAME=saxpy_ -DNAME=saxpy_ -DCNAME=saxpy -DCHAR_NAME=\"saxpy_\" -DCHAR_CNAME=\"saxpy\" -DNO_AFFINITY -I.. -I. -UDOUBLE -UCOMPLEX -c axpy.c -o saxpy.o
${HOME}/Data/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-section