Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_ALPHAMAP

diffuseColor.a *= texture2D( alphaMap, vUv ).g;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_ALPHAMAP

uniform sampler2D alphaMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef ALPHATEST

if ( diffuseColor.a < ALPHATEST ) discard;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_AOMAP

// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_AOMAP

uniform sampler2D aoMap;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/begin_vertex.glsl.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default `
export default /* glsl */`
vec3 transformed = vec3( position );
`;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default `
export default /* glsl */`
vec3 objectNormal = vec3( normal );
`;
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/bsdfs.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {

#if defined ( PHYSICALLY_CORRECT_LIGHTS )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_BUMPMAP

uniform sampler2D bumpMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if NUM_CLIPPING_PLANES > 0

vec4 plane;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if NUM_CLIPPING_PLANES > 0

#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )
varying vec3 vViewPosition;
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )
vViewPosition = - mvPosition.xyz;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/color_fragment.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_COLOR

diffuseColor.rgb *= vColor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_COLOR

varying vec3 vColor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_COLOR

varying vec3 vColor;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/color_vertex.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_COLOR

vColor.xyz = color.xyz;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/common.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#define PI 3.14159265359
#define PI2 6.28318530718
#define PI_HALF 1.5707963267949
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef ENVMAP_TYPE_CUBE_UV

#define cubeUV_textureSize (1024.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
vec3 transformedNormal = normalMatrix * objectNormal;

#ifdef FLIP_SIDED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_DISPLACEMENTMAP

uniform sampler2D displacementMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_DISPLACEMENTMAP

transformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if defined( DITHERING )

gl_FragColor.rgb = dithering( gl_FragColor.rgb );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if defined( DITHERING )

// based on https://www.shadertoy.com/view/MslGR8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_EMISSIVEMAP

vec4 emissiveColor = texture2D( emissiveMap, vUv );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_EMISSIVEMAP

uniform sampler2D emissiveMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default `
export default /* glsl */`
gl_FragColor = linearToOutputTexel( gl_FragColor );
`;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/

vec4 LinearToLinear( in vec4 value ) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_ENVMAP

#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if defined( USE_ENVMAP ) || defined( PHYSICAL )
uniform float reflectivity;
uniform float envMapIntensity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_ENVMAP

#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if defined( USE_ENVMAP ) && defined( PHYSICAL )

vec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_ENVMAP

#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/fog_fragment.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_FOG

#ifdef FOG_EXP2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_FOG

uniform vec3 fogColor;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/fog_pars_vertex.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_FOG

varying float fogDepth;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/fog_vertex.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_FOG

fogDepth = -mvPosition.z;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef TOON

uniform sampler2D gradientMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_LIGHTMAP

reflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_LIGHTMAP

uniform sampler2D lightMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
/**
* This is a template that can be used to light a material, it uses pluggable
* RenderEquations (RE)for specific lighting scenarios.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if defined( RE_IndirectDiffuse )

RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if defined( RE_IndirectDiffuse )

#ifdef USE_LIGHTMAP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
vec3 diffuse = vec3( 1.0 );

GeometricContext geometry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
uniform vec3 ambientLightColor;

vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
varying vec3 vViewPosition;

#ifndef FLAT_SHADED
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
struct PhysicalMaterial {

vec3 diffuseColor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )

gl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )

uniform float logDepthBufFC;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_LOGDEPTHBUF

#ifdef USE_LOGDEPTHBUF_EXT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_LOGDEPTHBUF

#ifdef USE_LOGDEPTHBUF_EXT
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/map_fragment.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_MAP

vec4 texelColor = texture2D( map, vUv );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_MAP

uniform sampler2D map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_MAP

vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_MAP

uniform mat3 uvTransform;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
float metalnessFactor = metalness;

#ifdef USE_METALNESSMAP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_METALNESSMAP

uniform sampler2D metalnessMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_MORPHNORMALS

objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_MORPHTARGETS

#ifndef USE_MORPHNORMALS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_MORPHTARGETS

transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef FLAT_SHADED

// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_NORMALMAP

#ifdef OBJECTSPACE_NORMALMAP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef USE_NORMALMAP

uniform sampler2D normalMap;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/packing.glsl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
vec3 packNormalToRGB( const in vec3 normal ) {
return normalize( normal ) * 0.5 + 0.5;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default `
export default /* glsl */`
#ifdef PREMULTIPLIED_ALPHA

// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.
Expand Down
Loading