Advertisement
emilg

Untitled

Jan 11th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.70 KB | None | 0 0
  1. TypeError: this.sink is null[Learn More] network-monitor.js:527:5
  2. THREE.WebGLRenderer 89 three.js:21220
  3. THREE.WebGLShader: gl.getShaderInfoLog() vertex 0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in vertex shader
  4. 1: precision highp float;
  5. 2: precision highp int;
  6. 3: #define SHADER_NAME ShaderMaterial
  7. 4: #define resolution vec2( 32.0, 32.0 )
  8. 5: #define VERTEX_TEXTURES
  9. 6: #define GAMMA_FACTOR 2
  10. 7: #define MAX_BONES 0
  11. 8: #define BONE_TEXTURE
  12. 9: #define NUM_CLIPPING_PLANES 0
  13. 10: uniform mat4 modelMatrix;
  14. 11: uniform mat4 modelViewMatrix;
  15. 12: uniform mat4 projectionMatrix;
  16. 13: uniform mat4 viewMatrix;
  17. 14: uniform mat3 normalMatrix;
  18. 15: uniform vec3 cameraPosition;
  19. 16: attribute vec3 position;
  20. 17: attribute vec3 normal;
  21. 18: attribute vec2 uv;
  22. 19: #ifdef USE_COLOR
  23. 20: attribute vec3 color;
  24. 21: #endif
  25. 22: #ifdef USE_MORPHTARGETS
  26. 23: attribute vec3 morphTarget0;
  27. 24: attribute vec3 morphTarget1;
  28. 25: attribute vec3 morphTarget2;
  29. 26: attribute vec3 morphTarget3;
  30. 27: #ifdef USE_MORPHNORMALS
  31. 28: attribute vec3 morphNormal0;
  32. 29: attribute vec3 morphNormal1;
  33. 30: attribute vec3 morphNormal2;
  34. 31: attribute vec3 morphNormal3;
  35. 32: #else
  36. 33: attribute vec3 morphTarget4;
  37. 34: attribute vec3 morphTarget5;
  38. 35: attribute vec3 morphTarget6;
  39. 36: attribute vec3 morphTarget7;
  40. 37: #endif
  41. 38: #endif
  42. 39: #ifdef USE_SKINNING
  43. 40: attribute vec4 skinIndex;
  44. 41: attribute vec4 skinWeight;
  45. 42: #endif
  46. 43:
  47. 44: void main() {
  48. 45:
  49. 46: gl_Position = vec4( position, 1.0 );
  50. 47:
  51. 48: }
  52. 49: three.js:17491
  53. THREE.WebGLShader: gl.getShaderInfoLog() fragment 0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in fragment shader
  54. 1: precision highp float;
  55. 2: precision highp int;
  56. 3: #define SHADER_NAME ShaderMaterial
  57. 4: #define resolution vec2( 32.0, 32.0 )
  58. 5: #define GAMMA_FACTOR 2
  59. 6: #define NUM_CLIPPING_PLANES 0
  60. 7: #define UNION_CLIPPING_PLANES 0
  61. 8: uniform mat4 viewMatrix;
  62. 9: uniform vec3 cameraPosition;
  63. 10: #define TONE_MAPPING
  64. 11: #ifndef saturate
  65. 12: #define saturate(a) clamp( a, 0.0, 1.0 )
  66. 13: #endif
  67. 14: uniform float toneMappingExposure;
  68. 15: uniform float toneMappingWhitePoint;
  69. 16: vec3 LinearToneMapping( vec3 color ) {
  70. 17: return toneMappingExposure * color;
  71. 18: }
  72. 19: vec3 ReinhardToneMapping( vec3 color ) {
  73. 20: color *= toneMappingExposure;
  74. 21: return saturate( color / ( vec3( 1.0 ) + color ) );
  75. 22: }
  76. 23: #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 ) )
  77. 24: vec3 Uncharted2ToneMapping( vec3 color ) {
  78. 25: color *= toneMappingExposure;
  79. 26: return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
  80. 27: }
  81. 28: vec3 OptimizedCineonToneMapping( vec3 color ) {
  82. 29: color *= toneMappingExposure;
  83. 30: color = max( vec3( 0.0 ), color - 0.004 );
  84. 31: return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
  85. 32: }
  86. 33:
  87. 34: vec3 toneMapping( vec3 color ) { return LinearToneMapping( color ); }
  88. 35:
  89. 36: vec4 LinearToLinear( in vec4 value ) {
  90. 37: return value;
  91. 38: }
  92. 39: vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
  93. 40: return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );
  94. 41: }
  95. 42: vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
  96. 43: return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );
  97. 44: }
  98. 45: vec4 sRGBToLinear( in vec4 value ) {
  99. 46: 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 );
  100. 47: }
  101. 48: vec4 LinearTosRGB( in vec4 value ) {
  102. 49: 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 );
  103. 50: }
  104. 51: vec4 RGBEToLinear( in vec4 value ) {
  105. 52: return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
  106. 53: }
  107. 54: vec4 LinearToRGBE( in vec4 value ) {
  108. 55: float maxComponent = max( max( value.r, value.g ), value.b );
  109. 56: float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
  110. 57: return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
  111. 58: }
  112. 59: vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
  113. 60: return vec4( value.xyz * value.w * maxRange, 1.0 );
  114. 61: }
  115. 62: vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
  116. 63: float maxRGB = max( value.x, max( value.g, value.b ) );
  117. 64: float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
  118. 65: M = ceil( M * 255.0 ) / 255.0;
  119. 66: return vec4( value.rgb / ( M * maxRange ), M );
  120. 67: }
  121. 68: vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
  122. 69: return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
  123. 70: }
  124. 71: vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
  125. 72: float maxRGB = max( value.x, max( value.g, value.b ) );
  126. 73: float D = max( maxRange / maxRGB, 1.0 );
  127. 74: D = min( floor( D ) / 255.0, 1.0 );
  128. 75: return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
  129. 76: }
  130. 77: const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
  131. 78: vec4 LinearToLogLuv( in vec4 value ) {
  132. 79: vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;
  133. 80: Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));
  134. 81: vec4 vResult;
  135. 82: vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
  136. 83: float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
  137. 84: vResult.w = fract(Le);
  138. 85: vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;
  139. 86: return vResult;
  140. 87: }
  141. 88: const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
  142. 89: vec4 LogLuvToLinear( in vec4 value ) {
  143. 90: float Le = value.z * 255.0 + value.w;
  144. 91: vec3 Xp_Y_XYZp;
  145. 92: Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);
  146. 93: Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
  147. 94: Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
  148. 95: vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;
  149. 96: return vec4( max(vRGB, 0.0), 1.0 );
  150. 97: }
  151. 98:
  152. 99: vec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  153. 100: vec4 envMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  154. 101: vec4 emissiveMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  155. 102: vec4 linearToOutputTexel( vec4 value ) { return LinearToLinear( value ); }
  156. 103:
  157. 104: uniform sampler2D texture;
  158. 105:
  159. 106: void main() {
  160. 107:
  161. 108: vec2 uv = gl_FragCoord.xy / resolution.xy;
  162. 109:
  163. 110: gl_FragColor = texture2D( texture, uv );
  164. 111:
  165. 112: }
  166. 113: three.js:17491
  167. THREE.WebGLShader: gl.getShaderInfoLog() vertex 0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in vertex shader
  168. 1: precision highp float;
  169. 2: precision highp int;
  170. 3: #define SHADER_NAME ShaderMaterial
  171. 4: #define resolution vec2( 32.0, 32.0 )
  172. 5: #define BOUNDS 800.00
  173. 6: #define VERTEX_TEXTURES
  174. 7: #define GAMMA_FACTOR 2
  175. 8: #define MAX_BONES 0
  176. 9: #define BONE_TEXTURE
  177. 10: #define NUM_CLIPPING_PLANES 0
  178. 11: uniform mat4 modelMatrix;
  179. 12: uniform mat4 modelViewMatrix;
  180. 13: uniform mat4 projectionMatrix;
  181. 14: uniform mat4 viewMatrix;
  182. 15: uniform mat3 normalMatrix;
  183. 16: uniform vec3 cameraPosition;
  184. 17: attribute vec3 position;
  185. 18: attribute vec3 normal;
  186. 19: attribute vec2 uv;
  187. 20: #ifdef USE_COLOR
  188. 21: attribute vec3 color;
  189. 22: #endif
  190. 23: #ifdef USE_MORPHTARGETS
  191. 24: attribute vec3 morphTarget0;
  192. 25: attribute vec3 morphTarget1;
  193. 26: attribute vec3 morphTarget2;
  194. 27: attribute vec3 morphTarget3;
  195. 28: #ifdef USE_MORPHNORMALS
  196. 29: attribute vec3 morphNormal0;
  197. 30: attribute vec3 morphNormal1;
  198. 31: attribute vec3 morphNormal2;
  199. 32: attribute vec3 morphNormal3;
  200. 33: #else
  201. 34: attribute vec3 morphTarget4;
  202. 35: attribute vec3 morphTarget5;
  203. 36: attribute vec3 morphTarget6;
  204. 37: attribute vec3 morphTarget7;
  205. 38: #endif
  206. 39: #endif
  207. 40: #ifdef USE_SKINNING
  208. 41: attribute vec4 skinIndex;
  209. 42: attribute vec4 skinWeight;
  210. 43: #endif
  211. 44:
  212. 45: void main() {
  213. 46:
  214. 47: gl_Position = vec4( position, 1.0 );
  215. 48:
  216. 49: }
  217. 50: three.js:17491
  218. THREE.WebGLShader: gl.getShaderInfoLog() fragment 0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in fragment shader
  219. 1: precision highp float;
  220. 2: precision highp int;
  221. 3: #define SHADER_NAME ShaderMaterial
  222. 4: #define resolution vec2( 32.0, 32.0 )
  223. 5: #define BOUNDS 800.00
  224. 6: #define GAMMA_FACTOR 2
  225. 7: #define NUM_CLIPPING_PLANES 0
  226. 8: #define UNION_CLIPPING_PLANES 0
  227. 9: uniform mat4 viewMatrix;
  228. 10: uniform vec3 cameraPosition;
  229. 11: #define TONE_MAPPING
  230. 12: #ifndef saturate
  231. 13: #define saturate(a) clamp( a, 0.0, 1.0 )
  232. 14: #endif
  233. 15: uniform float toneMappingExposure;
  234. 16: uniform float toneMappingWhitePoint;
  235. 17: vec3 LinearToneMapping( vec3 color ) {
  236. 18: return toneMappingExposure * color;
  237. 19: }
  238. 20: vec3 ReinhardToneMapping( vec3 color ) {
  239. 21: color *= toneMappingExposure;
  240. 22: return saturate( color / ( vec3( 1.0 ) + color ) );
  241. 23: }
  242. 24: #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 ) )
  243. 25: vec3 Uncharted2ToneMapping( vec3 color ) {
  244. 26: color *= toneMappingExposure;
  245. 27: return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
  246. 28: }
  247. 29: vec3 OptimizedCineonToneMapping( vec3 color ) {
  248. 30: color *= toneMappingExposure;
  249. 31: color = max( vec3( 0.0 ), color - 0.004 );
  250. 32: return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
  251. 33: }
  252. 34:
  253. 35: vec3 toneMapping( vec3 color ) { return LinearToneMapping( color ); }
  254. 36:
  255. 37: vec4 LinearToLinear( in vec4 value ) {
  256. 38: return value;
  257. 39: }
  258. 40: vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
  259. 41: return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );
  260. 42: }
  261. 43: vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
  262. 44: return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );
  263. 45: }
  264. 46: vec4 sRGBToLinear( in vec4 value ) {
  265. 47: 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 );
  266. 48: }
  267. 49: vec4 LinearTosRGB( in vec4 value ) {
  268. 50: 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 );
  269. 51: }
  270. 52: vec4 RGBEToLinear( in vec4 value ) {
  271. 53: return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
  272. 54: }
  273. 55: vec4 LinearToRGBE( in vec4 value ) {
  274. 56: float maxComponent = max( max( value.r, value.g ), value.b );
  275. 57: float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
  276. 58: return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
  277. 59: }
  278. 60: vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
  279. 61: return vec4( value.xyz * value.w * maxRange, 1.0 );
  280. 62: }
  281. 63: vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
  282. 64: float maxRGB = max( value.x, max( value.g, value.b ) );
  283. 65: float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
  284. 66: M = ceil( M * 255.0 ) / 255.0;
  285. 67: return vec4( value.rgb / ( M * maxRange ), M );
  286. 68: }
  287. 69: vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
  288. 70: return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
  289. 71: }
  290. 72: vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
  291. 73: float maxRGB = max( value.x, max( value.g, value.b ) );
  292. 74: float D = max( maxRange / maxRGB, 1.0 );
  293. 75: D = min( floor( D ) / 255.0, 1.0 );
  294. 76: return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
  295. 77: }
  296. 78: const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
  297. 79: vec4 LinearToLogLuv( in vec4 value ) {
  298. 80: vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;
  299. 81: Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));
  300. 82: vec4 vResult;
  301. 83: vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
  302. 84: float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
  303. 85: vResult.w = fract(Le);
  304. 86: vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;
  305. 87: return vResult;
  306. 88: }
  307. 89: const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
  308. 90: vec4 LogLuvToLinear( in vec4 value ) {
  309. 91: float Le = value.z * 255.0 + value.w;
  310. 92: vec3 Xp_Y_XYZp;
  311. 93: Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);
  312. 94: Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
  313. 95: Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
  314. 96: vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;
  315. 97: return vec4( max(vRGB, 0.0), 1.0 );
  316. 98: }
  317. 99:
  318. 100: vec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  319. 101: vec4 envMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  320. 102: vec4 emissiveMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  321. 103: vec4 linearToOutputTexel( vec4 value ) { return LinearToLinear( value ); }
  322. 104:
  323. 105:
  324. 106: uniform sampler2D textureVelocity;
  325. 107:
  326. 108: uniform sampler2D texturePosition;
  327. 109:
  328. 110:
  329. 111: uniform float time;
  330. 112: uniform float testing;
  331. 113: uniform float delta; // about 0.016
  332. 114: uniform float seperationDistance; // 20
  333. 115: uniform float alignmentDistance; // 40
  334. 116: uniform float cohesionDistance; //
  335. 117: uniform float freedomFactor;
  336. 118: uniform vec3 predator;
  337. 119:
  338. 120: const float width = resolution.x;
  339. 121: const float height = resolution.y;
  340. 122:
  341. 123: const float PI = 3.141592653589793;
  342. 124: const float PI_2 = PI * 2.0;
  343. 125: // const float VISION = PI * 0.55;
  344. 126:
  345. 127: float zoneRadius = 40.0;
  346. 128: float zoneRadiusSquared = 1600.0;
  347. 129:
  348. 130: float separationThresh = 0.45;
  349. 131: float alignmentThresh = 0.65;
  350. 132:
  351. 133: const float UPPER_BOUNDS = BOUNDS;
  352. 134: const float LOWER_BOUNDS = -UPPER_BOUNDS;
  353. 135:
  354. 136: const float SPEED_LIMIT = 9.0;
  355. 137:
  356. 138: float rand(vec2 co){
  357. 139: return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
  358. 140: }
  359. 141:
  360. 142: void main() {
  361. 143:
  362. 144: zoneRadius = seperationDistance + alignmentDistance + cohesionDistance;
  363. 145: separationThresh = seperationDistance / zoneRadius;
  364. 146: alignmentThresh = ( seperationDistance + alignmentDistance ) / zoneRadius;
  365. 147: zoneRadiusSquared = zoneRadius * zoneRadius;
  366. 148:
  367. 149:
  368. 150: vec2 uv = gl_FragCoord.xy / resolution.xy;
  369. 151: vec3 birdPosition, birdVelocity;
  370. 152:
  371. 153: vec3 selfPosition = texture2D( texturePosition, uv ).xyz;
  372. 154: vec3 selfVelocity = texture2D( textureVelocity, uv ).xyz;
  373. 155:
  374. 156: float dist;
  375. 157: vec3 dir; // direction
  376. 158: float distSquared;
  377. 159:
  378. 160: float seperationSquared = seperationDistance * seperationDistance;
  379. 161: float cohesionSquared = cohesionDistance * cohesionDistance;
  380. 162:
  381. 163: float f;
  382. 164: float percent;
  383. 165:
  384. 166: vec3 velocity = selfVelocity;
  385. 167:
  386. 168: float limit = SPEED_LIMIT;
  387. 169:
  388. 170: dir = predator * UPPER_BOUNDS - selfPosition;
  389. 171: dir.z = 0.;
  390. 172: // dir.z *= 0.6;
  391. 173: dist = length( dir );
  392. 174: distSquared = dist * dist;
  393. 175:
  394. 176: float preyRadius = 150.0;
  395. 177: float preyRadiusSq = preyRadius * preyRadius;
  396. 178:
  397. 179:
  398. 180: // move birds away from predator
  399. 181: if (dist < preyRadius) {
  400. 182:
  401. 183: f = ( distSquared / preyRadiusSq - 1.0 ) * delta * 100.;
  402. 184: velocity += normalize( dir ) * f;
  403. 185: limit += 5.0;
  404. 186: }
  405. 187:
  406. 188:
  407. 189: // if (testing == 0.0) {}
  408. 190: // if ( rand( uv + time ) < freedomFactor ) {}
  409. 191:
  410. 192:
  411. 193: // Attract flocks to the center
  412. 194: vec3 central = vec3( 0., 0., 0. );
  413. 195: dir = selfPosition - central;
  414. 196: dist = length( dir );
  415. 197:
  416. 198: dir.y *= 2.5;
  417. 199: velocity -= normalize( dir ) * delta * 5.;
  418. 200:
  419. 201: for (float y=0.0;y<height;y++) {
  420. 202: for (float x=0.0;x<width;x++) {
  421. 203:
  422. 204: vec2 ref = vec2( x + 0.5, y + 0.5 ) / resolution.xy;
  423. 205: birdPosition = texture2D( texturePosition, ref ).xyz;
  424. 206:
  425. 207: dir = birdPosition - selfPosition;
  426. 208: dist = length(dir);
  427. 209:
  428. 210: if (dist < 0.0001) continue;
  429. 211:
  430. 212: distSquared = dist * dist;
  431. 213:
  432. 214: if (distSquared > zoneRadiusSquared ) continue;
  433. 215:
  434. 216: percent = distSquared / zoneRadiusSquared;
  435. 217:
  436. 218: if ( percent < separationThresh ) { // low
  437. 219:
  438. 220: // Separation - Move apart for comfort
  439. 221: f = (separationThresh / percent - 1.0) * delta;
  440. 222: velocity -= normalize(dir) * f;
  441. 223:
  442. 224: } else if ( percent < alignmentThresh ) { // high
  443. 225:
  444. 226: // Alignment - fly the same direction
  445. 227: float threshDelta = alignmentThresh - separationThresh;
  446. 228: float adjustedPercent = ( percent - separationThresh ) / threshDelta;
  447. 229:
  448. 230: birdVelocity = texture2D( textureVelocity, ref ).xyz;
  449. 231:
  450. 232: f = ( 0.5 - cos( adjustedPercent * PI_2 ) * 0.5 + 0.5 ) * delta;
  451. 233: velocity += normalize(birdVelocity) * f;
  452. 234:
  453. 235: } else {
  454. 236:
  455. 237: // Attraction / Cohesion - move closer
  456. 238: float threshDelta = 1.0 - alignmentThresh;
  457. 239: float adjustedPercent = ( percent - alignmentThresh ) / threshDelta;
  458. 240:
  459. 241: f = ( 0.5 - ( cos( adjustedPercent * PI_2 ) * -0.5 + 0.5 ) ) * delta;
  460. 242:
  461. 243: velocity += normalize(dir) * f;
  462. 244:
  463. 245: }
  464. 246:
  465. 247: }
  466. 248:
  467. 249: }
  468. 250:
  469. 251:
  470. 252:
  471. 253: // this make tends to fly around than down or up
  472. 254: // if (velocity.y > 0.) velocity.y *= (1. - 0.2 * delta);
  473. 255:
  474. 256: // Speed Limits
  475. 257: if ( length( velocity ) > limit ) {
  476. 258: velocity = normalize( velocity ) * limit;
  477. 259: }
  478. 260:
  479. 261: gl_FragColor = vec4( velocity, 1.0 );
  480. 262:
  481. 263: }
  482. 264:
  483. 265: three.js:17491
  484. THREE.WebGLShader: gl.getShaderInfoLog() vertex 0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in vertex shader
  485. 1: precision highp float;
  486. 2: precision highp int;
  487. 3: #define SHADER_NAME ShaderMaterial
  488. 4: #define resolution vec2( 32.0, 32.0 )
  489. 5: #define VERTEX_TEXTURES
  490. 6: #define GAMMA_FACTOR 2
  491. 7: #define MAX_BONES 0
  492. 8: #define BONE_TEXTURE
  493. 9: #define NUM_CLIPPING_PLANES 0
  494. 10: uniform mat4 modelMatrix;
  495. 11: uniform mat4 modelViewMatrix;
  496. 12: uniform mat4 projectionMatrix;
  497. 13: uniform mat4 viewMatrix;
  498. 14: uniform mat3 normalMatrix;
  499. 15: uniform vec3 cameraPosition;
  500. 16: attribute vec3 position;
  501. 17: attribute vec3 normal;
  502. 18: attribute vec2 uv;
  503. 19: #ifdef USE_COLOR
  504. 20: attribute vec3 color;
  505. 21: #endif
  506. 22: #ifdef USE_MORPHTARGETS
  507. 23: attribute vec3 morphTarget0;
  508. 24: attribute vec3 morphTarget1;
  509. 25: attribute vec3 morphTarget2;
  510. 26: attribute vec3 morphTarget3;
  511. 27: #ifdef USE_MORPHNORMALS
  512. 28: attribute vec3 morphNormal0;
  513. 29: attribute vec3 morphNormal1;
  514. 30: attribute vec3 morphNormal2;
  515. 31: attribute vec3 morphNormal3;
  516. 32: #else
  517. 33: attribute vec3 morphTarget4;
  518. 34: attribute vec3 morphTarget5;
  519. 35: attribute vec3 morphTarget6;
  520. 36: attribute vec3 morphTarget7;
  521. 37: #endif
  522. 38: #endif
  523. 39: #ifdef USE_SKINNING
  524. 40: attribute vec4 skinIndex;
  525. 41: attribute vec4 skinWeight;
  526. 42: #endif
  527. 43:
  528. 44: void main() {
  529. 45:
  530. 46: gl_Position = vec4( position, 1.0 );
  531. 47:
  532. 48: }
  533. 49: three.js:17491
  534. THREE.WebGLShader: gl.getShaderInfoLog() fragment 0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in fragment shader
  535. 1: precision highp float;
  536. 2: precision highp int;
  537. 3: #define SHADER_NAME ShaderMaterial
  538. 4: #define resolution vec2( 32.0, 32.0 )
  539. 5: #define GAMMA_FACTOR 2
  540. 6: #define NUM_CLIPPING_PLANES 0
  541. 7: #define UNION_CLIPPING_PLANES 0
  542. 8: uniform mat4 viewMatrix;
  543. 9: uniform vec3 cameraPosition;
  544. 10: #define TONE_MAPPING
  545. 11: #ifndef saturate
  546. 12: #define saturate(a) clamp( a, 0.0, 1.0 )
  547. 13: #endif
  548. 14: uniform float toneMappingExposure;
  549. 15: uniform float toneMappingWhitePoint;
  550. 16: vec3 LinearToneMapping( vec3 color ) {
  551. 17: return toneMappingExposure * color;
  552. 18: }
  553. 19: vec3 ReinhardToneMapping( vec3 color ) {
  554. 20: color *= toneMappingExposure;
  555. 21: return saturate( color / ( vec3( 1.0 ) + color ) );
  556. 22: }
  557. 23: #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 ) )
  558. 24: vec3 Uncharted2ToneMapping( vec3 color ) {
  559. 25: color *= toneMappingExposure;
  560. 26: return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
  561. 27: }
  562. 28: vec3 OptimizedCineonToneMapping( vec3 color ) {
  563. 29: color *= toneMappingExposure;
  564. 30: color = max( vec3( 0.0 ), color - 0.004 );
  565. 31: return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
  566. 32: }
  567. 33:
  568. 34: vec3 toneMapping( vec3 color ) { return LinearToneMapping( color ); }
  569. 35:
  570. 36: vec4 LinearToLinear( in vec4 value ) {
  571. 37: return value;
  572. 38: }
  573. 39: vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
  574. 40: return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );
  575. 41: }
  576. 42: vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
  577. 43: return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );
  578. 44: }
  579. 45: vec4 sRGBToLinear( in vec4 value ) {
  580. 46: 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 );
  581. 47: }
  582. 48: vec4 LinearTosRGB( in vec4 value ) {
  583. 49: 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 );
  584. 50: }
  585. 51: vec4 RGBEToLinear( in vec4 value ) {
  586. 52: return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
  587. 53: }
  588. 54: vec4 LinearToRGBE( in vec4 value ) {
  589. 55: float maxComponent = max( max( value.r, value.g ), value.b );
  590. 56: float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
  591. 57: return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
  592. 58: }
  593. 59: vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
  594. 60: return vec4( value.xyz * value.w * maxRange, 1.0 );
  595. 61: }
  596. 62: vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
  597. 63: float maxRGB = max( value.x, max( value.g, value.b ) );
  598. 64: float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
  599. 65: M = ceil( M * 255.0 ) / 255.0;
  600. 66: return vec4( value.rgb / ( M * maxRange ), M );
  601. 67: }
  602. 68: vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
  603. 69: return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
  604. 70: }
  605. 71: vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
  606. 72: float maxRGB = max( value.x, max( value.g, value.b ) );
  607. 73: float D = max( maxRange / maxRGB, 1.0 );
  608. 74: D = min( floor( D ) / 255.0, 1.0 );
  609. 75: return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
  610. 76: }
  611. 77: const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
  612. 78: vec4 LinearToLogLuv( in vec4 value ) {
  613. 79: vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;
  614. 80: Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));
  615. 81: vec4 vResult;
  616. 82: vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
  617. 83: float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
  618. 84: vResult.w = fract(Le);
  619. 85: vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;
  620. 86: return vResult;
  621. 87: }
  622. 88: const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
  623. 89: vec4 LogLuvToLinear( in vec4 value ) {
  624. 90: float Le = value.z * 255.0 + value.w;
  625. 91: vec3 Xp_Y_XYZp;
  626. 92: Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);
  627. 93: Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
  628. 94: Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
  629. 95: vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;
  630. 96: return vec4( max(vRGB, 0.0), 1.0 );
  631. 97: }
  632. 98:
  633. 99: vec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  634. 100: vec4 envMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  635. 101: vec4 emissiveMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  636. 102: vec4 linearToOutputTexel( vec4 value ) { return LinearToLinear( value ); }
  637. 103:
  638. 104:
  639. 105: uniform sampler2D textureVelocity;
  640. 106:
  641. 107: uniform sampler2D texturePosition;
  642. 108:
  643. 109:
  644. 110: uniform float time;
  645. 111: uniform float delta;
  646. 112:
  647. 113: void main() {
  648. 114:
  649. 115: vec2 uv = gl_FragCoord.xy / resolution.xy;
  650. 116: vec4 tmpPos = texture2D( texturePosition, uv );
  651. 117: vec3 position = tmpPos.xyz;
  652. 118: vec3 velocity = texture2D( textureVelocity, uv ).xyz;
  653. 119:
  654. 120: float phase = tmpPos.w;
  655. 121:
  656. 122: phase = mod( ( phase + delta +
  657. 123: length( velocity.xz ) * delta * 3. +
  658. 124: max( velocity.y, 0.0 ) * delta * 6. ), 62.83 );
  659. 125:
  660. 126: gl_FragColor = vec4( position + velocity * delta * 15. , phase );
  661. 127:
  662. 128: }
  663. 129:
  664. 130: three.js:17491
  665. THREE.WebGLShader: gl.getShaderInfoLog() vertex 0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in vertex shader
  666. 1: precision highp float;
  667. 2: precision highp int;
  668. 3: #define SHADER_NAME ShaderMaterial
  669. 4: #define VERTEX_TEXTURES
  670. 5: #define GAMMA_FACTOR 2
  671. 6: #define MAX_BONES 0
  672. 7: #define BONE_TEXTURE
  673. 8: #define DOUBLE_SIDED
  674. 9: #define NUM_CLIPPING_PLANES 0
  675. 10: uniform mat4 modelMatrix;
  676. 11: uniform mat4 modelViewMatrix;
  677. 12: uniform mat4 projectionMatrix;
  678. 13: uniform mat4 viewMatrix;
  679. 14: uniform mat3 normalMatrix;
  680. 15: uniform vec3 cameraPosition;
  681. 16: attribute vec3 position;
  682. 17: attribute vec3 normal;
  683. 18: attribute vec2 uv;
  684. 19: #ifdef USE_COLOR
  685. 20: attribute vec3 color;
  686. 21: #endif
  687. 22: #ifdef USE_MORPHTARGETS
  688. 23: attribute vec3 morphTarget0;
  689. 24: attribute vec3 morphTarget1;
  690. 25: attribute vec3 morphTarget2;
  691. 26: attribute vec3 morphTarget3;
  692. 27: #ifdef USE_MORPHNORMALS
  693. 28: attribute vec3 morphNormal0;
  694. 29: attribute vec3 morphNormal1;
  695. 30: attribute vec3 morphNormal2;
  696. 31: attribute vec3 morphNormal3;
  697. 32: #else
  698. 33: attribute vec3 morphTarget4;
  699. 34: attribute vec3 morphTarget5;
  700. 35: attribute vec3 morphTarget6;
  701. 36: attribute vec3 morphTarget7;
  702. 37: #endif
  703. 38: #endif
  704. 39: #ifdef USE_SKINNING
  705. 40: attribute vec4 skinIndex;
  706. 41: attribute vec4 skinWeight;
  707. 42: #endif
  708. 43:
  709. 44:
  710. 45:
  711. 46: attribute vec2 reference;
  712. 47: attribute float birdVertex;
  713. 48:
  714. 49: attribute vec3 birdColor;
  715. 50:
  716. 51: uniform sampler2D texturePosition;
  717. 52: uniform sampler2D textureVelocity;
  718. 53:
  719. 54: varying vec4 vColor;
  720. 55: varying float z;
  721. 56:
  722. 57: uniform float time;
  723. 58:
  724. 59: void main() {
  725. 60:
  726. 61: vec4 tmpPos = texture2D( texturePosition, reference );
  727. 62: vec3 pos = tmpPos.xyz;
  728. 63: vec3 velocity = normalize(texture2D( textureVelocity, reference ).xyz);
  729. 64:
  730. 65: vec3 newPosition = position;
  731. 66:
  732. 67: if ( birdVertex == 4.0 || birdVertex == 7.0 ) {
  733. 68: // flap wings
  734. 69: newPosition.y = sin( tmpPos.w ) * 5.;
  735. 70: }
  736. 71:
  737. 72: newPosition = mat3( modelMatrix ) * newPosition;
  738. 73:
  739. 74:
  740. 75: velocity.z *= -1.;
  741. 76: float xz = length( velocity.xz );
  742. 77: float xyz = 1.;
  743. 78: float x = sqrt( 1. - velocity.y * velocity.y );
  744. 79:
  745. 80: float cosry = velocity.x / xz;
  746. 81: float sinry = velocity.z / xz;
  747. 82:
  748. 83: float cosrz = x / xyz;
  749. 84: float sinrz = velocity.y / xyz;
  750. 85:
  751. 86: mat3 maty = mat3(
  752. 87: cosry, 0, -sinry,
  753. 88: 0 , 1, 0 ,
  754. 89: sinry, 0, cosry
  755. 90:
  756. 91: );
  757. 92:
  758. 93: mat3 matz = mat3(
  759. 94: cosrz , sinrz, 0,
  760. 95: -sinrz, cosrz, 0,
  761. 96: 0 , 0 , 1
  762. 97: );
  763. 98:
  764. 99: newPosition = maty * matz * newPosition;
  765. 100: newPosition += pos;
  766. 101:
  767. 102: z = newPosition.z;
  768. 103:
  769. 104: vColor = vec4( birdColor, 1.0 );
  770. 105: gl_Position = projectionMatrix * viewMatrix * vec4( newPosition, 1.0 );
  771. 106: }
  772. 107:
  773. 108: three.js:17491
  774. THREE.WebGLShader: gl.getShaderInfoLog() fragment 0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in fragment shader
  775. 1: precision highp float;
  776. 2: precision highp int;
  777. 3: #define SHADER_NAME ShaderMaterial
  778. 4: #define GAMMA_FACTOR 2
  779. 5: #define DOUBLE_SIDED
  780. 6: #define NUM_CLIPPING_PLANES 0
  781. 7: #define UNION_CLIPPING_PLANES 0
  782. 8: uniform mat4 viewMatrix;
  783. 9: uniform vec3 cameraPosition;
  784. 10: #define TONE_MAPPING
  785. 11: #ifndef saturate
  786. 12: #define saturate(a) clamp( a, 0.0, 1.0 )
  787. 13: #endif
  788. 14: uniform float toneMappingExposure;
  789. 15: uniform float toneMappingWhitePoint;
  790. 16: vec3 LinearToneMapping( vec3 color ) {
  791. 17: return toneMappingExposure * color;
  792. 18: }
  793. 19: vec3 ReinhardToneMapping( vec3 color ) {
  794. 20: color *= toneMappingExposure;
  795. 21: return saturate( color / ( vec3( 1.0 ) + color ) );
  796. 22: }
  797. 23: #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 ) )
  798. 24: vec3 Uncharted2ToneMapping( vec3 color ) {
  799. 25: color *= toneMappingExposure;
  800. 26: return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );
  801. 27: }
  802. 28: vec3 OptimizedCineonToneMapping( vec3 color ) {
  803. 29: color *= toneMappingExposure;
  804. 30: color = max( vec3( 0.0 ), color - 0.004 );
  805. 31: return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
  806. 32: }
  807. 33:
  808. 34: vec3 toneMapping( vec3 color ) { return LinearToneMapping( color ); }
  809. 35:
  810. 36: vec4 LinearToLinear( in vec4 value ) {
  811. 37: return value;
  812. 38: }
  813. 39: vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
  814. 40: return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );
  815. 41: }
  816. 42: vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
  817. 43: return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );
  818. 44: }
  819. 45: vec4 sRGBToLinear( in vec4 value ) {
  820. 46: 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 );
  821. 47: }
  822. 48: vec4 LinearTosRGB( in vec4 value ) {
  823. 49: 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 );
  824. 50: }
  825. 51: vec4 RGBEToLinear( in vec4 value ) {
  826. 52: return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );
  827. 53: }
  828. 54: vec4 LinearToRGBE( in vec4 value ) {
  829. 55: float maxComponent = max( max( value.r, value.g ), value.b );
  830. 56: float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );
  831. 57: return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );
  832. 58: }
  833. 59: vec4 RGBMToLinear( in vec4 value, in float maxRange ) {
  834. 60: return vec4( value.xyz * value.w * maxRange, 1.0 );
  835. 61: }
  836. 62: vec4 LinearToRGBM( in vec4 value, in float maxRange ) {
  837. 63: float maxRGB = max( value.x, max( value.g, value.b ) );
  838. 64: float M = clamp( maxRGB / maxRange, 0.0, 1.0 );
  839. 65: M = ceil( M * 255.0 ) / 255.0;
  840. 66: return vec4( value.rgb / ( M * maxRange ), M );
  841. 67: }
  842. 68: vec4 RGBDToLinear( in vec4 value, in float maxRange ) {
  843. 69: return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );
  844. 70: }
  845. 71: vec4 LinearToRGBD( in vec4 value, in float maxRange ) {
  846. 72: float maxRGB = max( value.x, max( value.g, value.b ) );
  847. 73: float D = max( maxRange / maxRGB, 1.0 );
  848. 74: D = min( floor( D ) / 255.0, 1.0 );
  849. 75: return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );
  850. 76: }
  851. 77: const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );
  852. 78: vec4 LinearToLogLuv( in vec4 value ) {
  853. 79: vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;
  854. 80: Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));
  855. 81: vec4 vResult;
  856. 82: vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
  857. 83: float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;
  858. 84: vResult.w = fract(Le);
  859. 85: vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;
  860. 86: return vResult;
  861. 87: }
  862. 88: const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );
  863. 89: vec4 LogLuvToLinear( in vec4 value ) {
  864. 90: float Le = value.z * 255.0 + value.w;
  865. 91: vec3 Xp_Y_XYZp;
  866. 92: Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);
  867. 93: Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;
  868. 94: Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;
  869. 95: vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;
  870. 96: return vec4( max(vRGB, 0.0), 1.0 );
  871. 97: }
  872. 98:
  873. 99: vec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  874. 100: vec4 envMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  875. 101: vec4 emissiveMapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }
  876. 102: vec4 linearToOutputTexel( vec4 value ) { return LinearToLinear( value ); }
  877. 103:
  878. 104:
  879. 105:
  880. 106: varying vec4 vColor;
  881. 107: varying float z;
  882. 108:
  883. 109: uniform vec3 color;
  884. 110:
  885. 111: void main() {
  886. 112: // Fake colors for now
  887. 113: float z2 = 0.2 + ( 1000. - z ) / 1000. * vColor.x;
  888. 114: gl_FragColor = vec4( z2, z2, z2, 1. );
  889. 115:
  890. 116: }
  891. 117:
  892. 118: three.js:17491
  893. Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:21652:4
  894. Error: WebGL warning: clear: Framebuffer must be complete. three.js:21652:4
  895. Error: WebGL warning: drawElements: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:16789:4
  896. Error: WebGL warning: drawElements: Framebuffer must be complete. three.js:16789:4
  897. Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:21652:4
  898. Error: WebGL warning: clear: Framebuffer must be complete. three.js:21652:4
  899. Error: WebGL warning: drawElements: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:16789:4
  900. Error: WebGL warning: drawElements: Framebuffer must be complete. three.js:16789:4
  901. Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:21652:4
  902. Error: WebGL warning: clear: Framebuffer must be complete. three.js:21652:4
  903. Error: WebGL warning: drawElements: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:16789:4
  904. Error: WebGL warning: drawElements: Framebuffer must be complete. three.js:16789:4
  905. Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:21652:4
  906. Error: WebGL warning: clear: Framebuffer must be complete. three.js:21652:4
  907. Error: WebGL warning: drawElements: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:16789:4
  908. Error: WebGL warning: drawElements: Framebuffer must be complete. three.js:16789:4
  909. Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:21652:4
  910. Error: WebGL warning: clear: Framebuffer must be complete. three.js:21652:4
  911. Error: WebGL warning: drawElements: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:16789:4
  912. Error: WebGL warning: drawElements: Framebuffer must be complete. three.js:16789:4
  913. Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:21652:4
  914. Error: WebGL warning: clear: Framebuffer must be complete. three.js:21652:4
  915. Error: WebGL warning: drawElements: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:16789:4
  916. Error: WebGL warning: drawElements: Framebuffer must be complete. three.js:16789:4
  917. Error: WebGL warning: drawArrays: This operation requires zeroing texture data. This is slow. three.js:16845:4
  918. Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:21652:4
  919. Error: WebGL warning: clear: Framebuffer must be complete. three.js:21652:4
  920. Error: WebGL warning: drawElements: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:16789:4
  921. Error: WebGL warning: drawElements: Framebuffer must be complete. three.js:16789:4
  922. Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0 has an effective format of RGBA32F, which is not renderable three.js:21652:4
  923. Error: WebGL warning: clear: Framebuffer must be complete. three.js:21652:4
  924. Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings) three.js:21652:4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement