hi,
IceMaterial.js
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
This file has been truncated. show original
ice.frag
#define USE_TRANSLUCENCY
#ifdef USE_TRANSLUCENCY
uniform sampler2D thicknessMap;
uniform float thicknessPower;
uniform float thicknessScale;
uniform float thicknessDistortion;
uniform float thicknessAmbient;
uniform vec2 thicknessRepeat;
#endif
This file has been truncated. show original
I found pbr-based sss by @mattdesl and as you can see, there is only a fragment shader.
so, I tried to use it with extended MeshStandardMaterial. but it does not work at all.
I assume that the shader is a bit old so it doesn’t match with the latest version of MeshStandardMaterial’s vertex shader.
Do you have any example of sss with standard material?
thank you!
gui
April 19, 2022, 9:59am
2
You may have seen this threejs example, but just in case: three.js examples
Also, I’ve extracted that SSS part of the code and made it into a node for Polygonjs , making it easier to setup. And you can always copy the GLSL code into your own project (from the right panel in the video).
live link: subsurface_scattering_example
3 Likes