Skip to content

Instantly share code, notes, and snippets.

@mattdesl
mattdesl / IceMaterial.js
Last active December 12, 2022 00:58
fast subsurface scattering in ThreeJS PBR material — see "TRANSLUCENCY" in the frag shader
const glslify = require('glslify');
const path = require('path');
const assign = require('object-assign');
const defined = require('defined');
// This is the original source, we will copy + paste it for our own GLSL
// const vertexShader = THREE.ShaderChunk.meshphysical_vert;
// const fragmentShader = THREE.ShaderChunk.meshphysical_frag;
// Our custom shaders