Skip to content

Instantly share code, notes, and snippets.

@gaborpapp
Last active December 4, 2016 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaborpapp/0279a9050e39be4428aed98acaf11343 to your computer and use it in GitHub Desktop.
Save gaborpapp/0279a9050e39be4428aed98acaf11343 to your computer and use it in GitHub Desktop.
lightness build errors
bundle.js?v=0:1 ChristmasXP💥❄️
🎅Oh Oh Oh!🎄
2.bundle.js:1 travel to : Experiments
vendors.js:150 THREE.WebGLRenderer 82
vendors.js:74 THREE.WebGLProgram: gl.getProgramInfoLog() WARNING: Output of vertex shader 'uvs' not read by fragment shader
rf @ vendors.js:74
2vendors.js:58 THREE.WebGLShader: Shader couldn't compile.se @ vendors.js:58
vendors.js:74 THREE.WebGLProgram: shader error: 0 gl.VALIDATE_STATUS false gl.getProgramInfoLog rf @ vendors.js:74
vendors.js:137 WebGL: INVALID_OPERATION: useProgram: program not validt @ vendors.js:137
2vendors.js:58 THREE.WebGLShader: Shader couldn't compile.se @ vendors.js:58
vendors.js:74 THREE.WebGLProgram: shader error: 1282 gl.VALIDATE_STATUS false gl.getProgramInfoLog rf @ vendors.js:74
vendors.js:137 WebGL: INVALID_OPERATION: useProgram: program not validt @ vendors.js:137
2vendors.js:58 THREE.WebGLShader: Shader couldn't compile.se @ vendors.js:58
vendors.js:74 THREE.WebGLProgram: shader error: 1282 gl.VALIDATE_STATUS false gl.getProgramInfoLog rf @ vendors.js:74
vendors.js:137 WebGL: INVALID_OPERATION: useProgram: program not validt @ vendors.js:137
christmasexperiments.com/:1 WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost
vendors.js:58 THREE.WebGLShader: gl.getShaderInfoLog() vertex null 1: precision highp float;
2: precision highp int;
3: #define SHADER_NAME PointsMaterial
4: #define VERTEX_TEXTURES
5: #define GAMMA_FACTOR 2
6: #define MAX_BONES 251
7: #define USE_MAP
8: #define NUM_CLIPPING_PLANES 0
9: #define USE_SIZEATTENUATION
10: uniform mat4 modelMatrix;
11: uniform mat4 modelViewMatrix;
12: uniform mat4 projectionMatrix;
13: uniform mat4 viewMatrix;
14: uniform mat3 normalMatrix;
15: uniform vec3 cameraPosition;
16: attribute vec3 position;
17: attribute vec3 normal;
18: attribute vec2 uv;
19: #ifdef USE_COLOR
20: attribute vec3 color;
21: #endif
22: #ifdef USE_MORPHTARGETS
23: attribute vec3 morphTarget0;
24: attribute vec3 morphTarget1;
25: attribute vec3 morphTarget2;
26: attribute vec3 morphTarget3;
27: #ifdef USE_MORPHNORMALS
28: attribute vec3 morphNormal0;
29: attribute vec3 morphNormal1;
30: attribute vec3 morphNormal2;
31: attribute vec3 morphNormal3;
32: #else
33: attribute vec3 morphTarget4;
34: attribute vec3 morphTarget5;
35: attribute vec3 morphTarget6;
36: attribute vec3 morphTarget7;
37: #endif
38: #endif
39: #ifdef USE_SKINNING
40: attribute vec4 skinIndex;
41: attribute vec4 skinWeight;
42: #endif
43:
44: uniform float size;
45: uniform float scale;
46: #define PI 3.14159265359
47: #define PI2 6.28318530718
48: #define RECIPROCAL_PI 0.31830988618
49: #define RECIPROCAL_PI2 0.15915494
50: #define LOG2 1.442695
51: #define EPSILON 1e-6
52: #define saturate(a) clamp( a, 0.0, 1.0 )
53: #define whiteCompliment(a) ( 1.0 - saturate( a ) )
54: float pow2( const in float x ) { return x*x; }
55: float pow3( const in float x ) { return x*x*x; }
56: float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
57: float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
58: highp float rand( const in vec2 uv ) {
59: const highp float a = 12.9898, b = 78.233, c = 43758.5453;
60: highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
61: return fract(sin(sn) * c);
62: }
63: struct IncidentLight {
64: vec3 color;
65: vec3 direction;
66: bool visible;
67: };
68: struct ReflectedLight {
69: vec3 directDiffuse;
70: vec3 directSpecular;
71: vec3 indirectDiffuse;
72: vec3 indirectSpecular;
73: };
74: struct GeometricContext {
75: vec3 position;
76: vec3 normal;
77: vec3 viewDir;
78: };
79: vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
80: return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
81: }
82: vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
83: return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
84: }
85: vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
86: float distance = dot( planeNormal, point - pointOnPlane );
87: return - distance * planeNormal + point;
88: }
89: float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
90: return sign( dot( point - pointOnPlane, planeNormal ) );
91: }
92: vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {
93: return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;
94: }
95:
96: #ifdef USE_COLOR
97: varying vec3 vColor;
98: #endif
99: #ifdef USE_SHADOWMAP
100: #if 0 > 0
101: uniform mat4 directionalShadowMatrix[ 0 ];
102: varying vec4 vDirectionalShadowCoord[ 0 ];
103: #endif
104: #if 2 > 0
105: uniform mat4 spotShadowMatrix[ 2 ];
106: varying vec4 vSpotShadowCoord[ 2 ];
107: #endif
108: #if 1 > 0
109: uniform mat4 pointShadowMatrix[ 1 ];
110: varying vec4 vPointShadowCoord[ 1 ];
111: #endif
112: #endif
113:
114: #ifdef USE_LOGDEPTHBUF
115: #ifdef USE_LOGDEPTHBUF_EXT
116: varying float vFragDepth;
117: #endif
118: uniform float logDepthBufFC;
119: #endif
120: #if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )
121: varying vec3 vViewPosition;
122: #endif
123:
124: void main() {
125: #ifdef USE_COLOR
126: vColor.xyz = color.xyz;
127: #endif
128:
129: vec3 transformed = vec3( position );
130:
131: #ifdef USE_SKINNING
132: vec4 mvPosition = modelViewMatrix * skinned;
133: #else
134: vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );
135: #endif
136: gl_Position = projectionMatrix * mvPosition;
137:
138: #ifdef USE_SIZEATTENUATION
139: gl_PointSize = size * ( scale / - mvPosition.z );
140: #else
141: gl_PointSize = size;
142: #endif
143: #ifdef USE_LOGDEPTHBUF
144: gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;
145: #ifdef USE_LOGDEPTHBUF_EXT
146: vFragDepth = 1.0 + gl_Position.w;
147: #else
148: gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;
149: #endif
150: #endif
151:
152: #if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )
153: vViewPosition = - mvPosition.xyz;
154: #endif
155:
156: #if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )
157: #ifdef USE_SKINNING
158: vec4 worldPosition = modelMatrix * skinned;
159: #else
160: vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );
161: #endif
162: #endif
163:
164: #ifdef USE_SHADOWMAP
165: #if 0 > 0
166:
167: #endif
168: #if 2 > 0
169:
170: vSpotShadowCoord[ 0 ] = spotShadowMatrix[ 0 ] * worldPosition;
171:
172: vSpotShadowCoord[ 1 ] = spotShadowMatrix[ 1 ] * worldPosition;
173:
174: #endif
175: #if 1 > 0
176:
177: vPointShadowCoord[ 0 ] = pointShadowMatrix[ 0 ] * worldPosition;
178:
179: #endif
180: #endif
181:
182: }
183: se @ vendors.js:58
vendors.js:58 THREE.WebGLShader: gl.getShaderInfoLog() fragment null 1: precision highp float;
2: precision highp int;
3: #define SHADER_NAME PointsMaterial
4: #define GAMMA_FACTOR 2
5: #define USE_FOG
6: #define USE_MAP
7: #define NUM_CLIPPING_PLANES 0
8: #define UNION_CLIPPING_PLANES 0
9: uniform mat4 viewMatrix;
10: uniform vec3 cameraPosition;
11: #define TONE_MAPPING
12: #define saturate(a) clamp( a, 0.0, 1.0 )
13: uniform float toneMappingExposure;
14: uniform float toneMappingWhitePoint;
15: vec3 LinearToneMapping( vec3 color ) {
16: return toneMappingExposure * color;
17: }
18: vec3 ReinhardToneMapping( vec3 color ) {
19: color *= toneMappingExposure;
20: return saturate( color / ( vec3( 1.0 ) + color ) );
21: }
22: #define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )
23: vec3 Uncharted2ToneMapping( vec3 color ) {
24: color *= toneMappingExposure;
25: return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
26: }
27: vec3 OptimizedCineonToneMapping( vec3 color ) {
28: color *= toneMappingExposure;
29: color = max( vec3( 0.0 ), color - 0.004 );
30: return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
31: }
32:
33: vec3 toneMapping( vec3 color ) { return LinearToneMapping( color ); }
34:
35: vec4 LinearToLinear( in vec4 value ) {
36: return value;
37: }
38: vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
39: return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );
40: }
41: vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
42: return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );
43: }
44: vec4 sRGBToLinear( in vec4 value ) {
45: return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );
46: }
47: vec4 LinearTosRGB( in vec4 value ) {
48: return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );
49: }
50: vec4 RGBEToLinear( in vec4 value ) {
51: return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
52: }
53: vec4 LinearToRGBE( in vec4 value ) {
54: float maxComponent = max( max( value.r, value.g ), value.b );
55: float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
56: return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
57: }
58: vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
59: return vec4( value.xyz * value.w * maxRange, 1.0 );
60: }
61: vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
62: float maxRGB = max( value.x, max( value.g, value.b ) );
63: float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
64: M = ceil( M * 255.0 ) / 255.0;
65: return vec4( value.rgb / ( M * maxRange ), M );
66: }
67: vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
68: return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
69: }
70: vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
71: float maxRGB = max( value.x, max( value.g, value.b ) );
72: float D = max( maxRange / maxRGB, 1.0 );
73: D = min( floor( D ) / 255.0, 1.0 );
74: return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
75: }
76: const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
77: vec4 LinearToLogLuv( in vec4 value ) {
78: vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;
79: Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));
80: vec4 vResult;
81: vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
82: float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
83: vResult.w = fract(Le);
84: vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;
85: return vResult;
86: }
87: const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
88: vec4 LogLuvToLinear( in vec4 value ) {
89: float Le = value.z * 255.0 + value.w;
90: vec3 Xp_Y_XYZp;
91: Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);
92: Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
93: Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
94: vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;
95: return vec4( max(vRGB, 0.0), 1.0 );
96: }
97:
98: vec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
99: vec4 envMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
100: vec4 emissiveMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
101: vec4 linearToOutputTexel( vec4 value ) { return LinearToLinear( value ); }
102:
103: uniform vec3 diffuse;
104: uniform float opacity;
105: #define PI 3.14159265359
106: #define PI2 6.28318530718
107: #define RECIPROCAL_PI 0.31830988618
108: #define RECIPROCAL_PI2 0.15915494
109: #define LOG2 1.442695
110: #define EPSILON 1e-6
111: #define saturate(a) clamp( a, 0.0, 1.0 )
112: #define whiteCompliment(a) ( 1.0 - saturate( a ) )
113: float pow2( const in float x ) { return x*x; }
114: float pow3( const in float x ) { return x*x*x; }
115: float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
116: float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
117: highp float rand( const in vec2 uv ) {
118: const highp float a = 12.9898, b = 78.233, c = 43758.5453;
119: highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
120: return fract(sin(sn) * c);
121: }
122: struct IncidentLight {
123: vec3 color;
124: vec3 direction;
125: bool visible;
126: };
127: struct ReflectedLight {
128: vec3 directDiffuse;
129: vec3 directSpecular;
130: vec3 indirectDiffuse;
131: vec3 indirectSpecular;
132: };
133: struct GeometricContext {
134: vec3 position;
135: vec3 normal;
136: vec3 viewDir;
137: };
138: vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
139: return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
140: }
141: vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
142: return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
143: }
144: vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
145: float distance = dot( planeNormal, point - pointOnPlane );
146: return - distance * planeNormal + point;
147: }
148: float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {
149: return sign( dot( point - pointOnPlane, planeNormal ) );
150: }
151: vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {
152: return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;
153: }
154:
155: vec3 packNormalToRGB( const in vec3 normal ) {
156: return normalize( normal ) * 0.5 + 0.5;
157: }
158: vec3 unpackRGBToNormal( const in vec3 rgb ) {
159: return 1.0 - 2.0 * rgb.xyz;
160: }
161: const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
162: const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
163: const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
164: const float ShiftRight8 = 1. / 256.;
165: vec4 packDepthToRGBA( const in float v ) {
166: vec4 r = vec4( fract( v * PackFactors ), v );
167: r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
168: }
169: float unpackRGBAToDepth( const in vec4 v ) {
170: return dot( v, UnpackFactors );
171: }
172: float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
173: return ( viewZ + near ) / ( near - far );
174: }
175: float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
176: return linearClipZ * ( near - far ) - near;
177: }
178: float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
179: return (( near + viewZ ) * far ) / (( far - near ) * viewZ );
180: }
181: float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
182: return ( near * far ) / ( ( far - near ) * invClipZ - far );
183: }
184:
185: #ifdef USE_COLOR
186: varying vec3 vColor;
187: #endif
188:
189: #ifdef USE_MAP
190: uniform vec4 offsetRepeat;
191: uniform sampler2D map;
192: #endif
193:
194: #ifdef USE_FOG
195: uniform vec3 fogColor;
196: #ifdef FOG_EXP2
197: uniform float fogDensity;
198: #else
199: uniform float fogNear;
200: uniform float fogFar;
201: #endif
202: #endif
203: #ifdef USE_SHADOWMAP
204: #if 0 > 0
205: uniform sampler2D directionalShadowMap[ 0 ];
206: varying vec4 vDirectionalShadowCoord[ 0 ];
207: #endif
208: #if 2 > 0
209: uniform sampler2D spotShadowMap[ 2 ];
210: varying vec4 vSpotShadowCoord[ 2 ];
211: #endif
212: #if 1 > 0
213: uniform sampler2D pointShadowMap[ 1 ];
214: varying vec4 vPointShadowCoord[ 1 ];
215: #endif
216: float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
217: return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
218: }
219: float texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {
220: const vec2 offset = vec2( 0.0, 1.0 );
221: vec2 texelSize = vec2( 1.0 ) / size;
222: vec2 centroidUV = floor( uv * size + 0.5 ) / size;
223: float lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );
224: float lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );
225: float rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );
226: float rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );
227: vec2 f = fract( uv * size + 0.5 );
228: float a = mix( lb, lt, f.y );
229: float b = mix( rb, rt, f.y );
230: float c = mix( a, b, f.x );
231: return c;
232: }
233: float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
234: shadowCoord.xyz /= shadowCoord.w;
235: shadowCoord.z += shadowBias;
236: bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
237: bool inFrustum = all( inFrustumVec );
238: bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
239: bool frustumTest = all( frustumTestVec );
240: if ( frustumTest ) {
241: #if defined( SHADOWMAP_TYPE_PCF )
242: vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
243: float dx0 = - texelSize.x * shadowRadius;
244: float dy0 = - texelSize.y * shadowRadius;
245: float dx1 = + texelSize.x * shadowRadius;
246: float dy1 = + texelSize.y * shadowRadius;
247: return (
248: texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
249: texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
250: texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
251: texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
252: texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
253: texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
254: texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
255: texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
256: texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
257: ) * ( 1.0 / 9.0 );
258: #elif defined( SHADOWMAP_TYPE_PCF_SOFT )
259: vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
260: float dx0 = - texelSize.x * shadowRadius;
261: float dy0 = - texelSize.y * shadowRadius;
262: float dx1 = + texelSize.x * shadowRadius;
263: float dy1 = + texelSize.y * shadowRadius;
264: return (
265: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
266: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
267: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
268: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
269: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +
270: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
271: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
272: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
273: texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
274: ) * ( 1.0 / 9.0 );
275: #else
276: return texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
277: #endif
278: }
279: return 1.0;
280: }
281: vec2 cubeToUV( vec3 v, float texelSizeY ) {
282: vec3 absV = abs( v );
283: float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
284: absV *= scaleToCube;
285: v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
286: vec2 planar = v.xy;
287: float almostATexel = 1.5 * texelSizeY;
288: float almostOne = 1.0 - almostATexel;
289: if ( absV.z >= almostOne ) {
290: if ( v.z > 0.0 )
291: planar.x = 4.0 - v.x;
292: } else if ( absV.x >= almostOne ) {
293: float signX = sign( v.x );
294: planar.x = v.z * signX + 2.0 * signX;
295: } else if ( absV.y >= almostOne ) {
296: float signY = sign( v.y );
297: planar.x = v.x + 2.0 * signY + 2.0;
298: planar.y = v.z * signY - 2.0;
299: }
300: return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
301: }
302: float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
303: vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
304: vec3 lightToPosition = shadowCoord.xyz;
305: vec3 bd3D = normalize( lightToPosition );
306: float dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;
307: #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )
308: vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
309: return (
310: texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
311: texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
312: texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
313: texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
314: texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
315: texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
316: texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
317: texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
318: texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
319: ) * ( 1.0 / 9.0 );
320: #else
321: return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
322: #endif
323: }
324: #endif
325:
326: #ifdef USE_LOGDEPTHBUF
327: uniform float logDepthBufFC;
328: #ifdef USE_LOGDEPTHBUF_EXT
329: varying float vFragDepth;
330: #endif
331: #endif
332:
333: #if NUM_CLIPPING_PLANES > 0
334: #if ! defined( PHYSICAL ) && ! defined( PHONG )
335: varying vec3 vViewPosition;
336: #endif
337: uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
338: #endif
339:
340: void main() {
341: #if NUM_CLIPPING_PLANES > 0
342: for ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {
343: vec4 plane = clippingPlanes[ i ];
344: if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;
345: }
346:
347: #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
348: bool clipped = true;
349: for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {
350: vec4 plane = clippingPlanes[ i ];
351: clipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;
352: }
353: if ( clipped ) discard;
354:
355: #endif
356: #endif
357:
358: vec3 outgoingLight = vec3( 0.0 );
359: vec4 diffuseColor = vec4( diffuse, opacity );
360: #if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)
361: gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;
362: #endif
363: #ifdef USE_MAP
364: vec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );
365: diffuseColor *= mapTexelToLinear( mapTexel );
366: #endif
367:
368: #ifdef USE_COLOR
369: diffuseColor.rgb *= vColor;
370: #endif
371: #ifdef ALPHATEST
372: if ( diffuseColor.a < ALPHATEST ) discard;
373: #endif
374:
375: outgoingLight = diffuseColor.rgb;
376: gl_FragColor = vec4( outgoingLight, diffuseColor.a );
377: #ifdef PREMULTIPLIED_ALPHA
378: gl_FragColor.rgb *= gl_FragColor.a;
379: #endif
380:
381: #if defined( TONE_MAPPING )
382: gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
383: #endif
384:
385: gl_FragColor = linearToOutputTexel( gl_FragColor );
386:
387: #ifdef USE_FOG
388: #ifdef USE_LOGDEPTHBUF_EXT
389: float depth = gl_FragDepthEXT / gl_FragCoord.w;
390: #else
391: float depth = gl_FragCoord.z / gl_FragCoord.w;
392: #endif
393: #ifdef FOG_EXP2
394: float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );
395: #else
396: float fogFactor = smoothstep( fogNear, fogFar, depth );
397: #endif
398: gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
399: #endif
400:
401: }
402: se @ vendors.js:58
vendors.js:74 THREE.WebGLProgram: gl.getProgramInfoLog() nullrf @ vendors.js:74
vendors.js:11 Uncaught TypeError: Cannot read property 'name' of null(…)
[Warning] Invalid CSS property declaration at: * (main.css, line 1)
[Warning] Invalid CSS property declaration at: * (main.css, line 1)
[Log] ChristmasXP💥❄️ (bundle.js, line 1)
🎅Oh Oh Oh!🎄
[Log] travel to : – "Experiments" (2.bundle.js, line 1)
[Warning] Invalid CSS property declaration at: * (build.css, line 102)
[Warning] Invalid CSS property declaration at: * (build.css, line 166)
[Log] THREE.WebGLRenderer – "82" (vendors.js, line 150)
[Error] ReferenceError: Can't find variable: performance
start (vendors.js:756:161)
getDelta (vendors.js:756:402)
value (build.js:3:12499)
value (build.js:3:16228)
value (build.js:3:20523)
(anonymous function)
value (build.js:3:19210)
t (build.js:3:17883)
(anonymous function) (build.js:3:21251)
o (build.js:1:259)
e (build.js:1:423)
global code (build.js:1:439)
[Error] TypeError: this.points.slice is not a function. (In 'this.points.slice(0,this.pointIndex)', 'this.points.slice' is undefined)
value (build.js:3:9451)
(anonymous function) (build.js:3:7854)
dispatchEvent
value (build.js:3:28560)
value (build.js:2:17975)
(anonymous function)
value (build.js:2:17588)
(anonymous function)
[Error] TypeError: this.points.slice is not a function. (In 'this.points.slice(0,this.pointIndex)', 'this.points.slice' is undefined)
value (build.js:3:10161)
(anonymous function) (build.js:3:7939)
dispatchEvent
value (build.js:3:28560)
value (build.js:2:18132)
(anonymous function)
value (build.js:2:17663)
(anonymous function)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment