jax 0.0.0.9 → 0.0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (426) hide show
  1. data/CHANGELOG +6 -0
  2. data/jax.gemspec +6 -2
  3. data/lib/jax/generators/app/templates/public/javascripts/jax.js +1 -1
  4. data/lib/jax/version.rb +1 -1
  5. metadata +3 -533
  6. data/guides/assets/images/book_icon.gif +0 -0
  7. data/guides/assets/images/bullet.gif +0 -0
  8. data/guides/assets/images/chapters_icon.gif +0 -0
  9. data/guides/assets/images/check_bullet.gif +0 -0
  10. data/guides/assets/images/credits_pic_blank.gif +0 -0
  11. data/guides/assets/images/edge_badge.png +0 -0
  12. data/guides/assets/images/feature_tile.gif +0 -0
  13. data/guides/assets/images/footer_tile.gif +0 -0
  14. data/guides/assets/images/getting_started/clean_passing_jasmine_suite.png +0 -0
  15. data/guides/assets/images/getting_started/dungeon-complete.png +0 -0
  16. data/guides/assets/images/getting_started/dungeon-normal-map.png +0 -0
  17. data/guides/assets/images/getting_started/dungeon-rainbow-textured.png +0 -0
  18. data/guides/assets/images/getting_started/dungeon-rainbow.png +0 -0
  19. data/guides/assets/images/getting_started/dungeon-textured-lighting.png +0 -0
  20. data/guides/assets/images/getting_started/dungeon-textured.png +0 -0
  21. data/guides/assets/images/getting_started/rock.png +0 -0
  22. data/guides/assets/images/getting_started/rock_normal.png +0 -0
  23. data/guides/assets/images/getting_started/teapot-red-directional-point.png +0 -0
  24. data/guides/assets/images/getting_started/teapot-red-directional.png +0 -0
  25. data/guides/assets/images/getting_started/teapot-red-nolight.png +0 -0
  26. data/guides/assets/images/getting_started/teapot-red-spot-point-directional.png +0 -0
  27. data/guides/assets/images/getting_started/teapot-white.png +0 -0
  28. data/guides/assets/images/getting_started/teapot-with-model.png +0 -0
  29. data/guides/assets/images/grey_bullet.gif +0 -0
  30. data/guides/assets/images/header_backdrop.png +0 -0
  31. data/guides/assets/images/header_tile.gif +0 -0
  32. data/guides/assets/images/icons/README +0 -5
  33. data/guides/assets/images/icons/callouts/1.png +0 -0
  34. data/guides/assets/images/icons/callouts/10.png +0 -0
  35. data/guides/assets/images/icons/callouts/11.png +0 -0
  36. data/guides/assets/images/icons/callouts/12.png +0 -0
  37. data/guides/assets/images/icons/callouts/13.png +0 -0
  38. data/guides/assets/images/icons/callouts/14.png +0 -0
  39. data/guides/assets/images/icons/callouts/15.png +0 -0
  40. data/guides/assets/images/icons/callouts/2.png +0 -0
  41. data/guides/assets/images/icons/callouts/3.png +0 -0
  42. data/guides/assets/images/icons/callouts/4.png +0 -0
  43. data/guides/assets/images/icons/callouts/5.png +0 -0
  44. data/guides/assets/images/icons/callouts/6.png +0 -0
  45. data/guides/assets/images/icons/callouts/7.png +0 -0
  46. data/guides/assets/images/icons/callouts/8.png +0 -0
  47. data/guides/assets/images/icons/callouts/9.png +0 -0
  48. data/guides/assets/images/icons/caution.png +0 -0
  49. data/guides/assets/images/icons/example.png +0 -0
  50. data/guides/assets/images/icons/home.png +0 -0
  51. data/guides/assets/images/icons/important.png +0 -0
  52. data/guides/assets/images/icons/next.png +0 -0
  53. data/guides/assets/images/icons/note.png +0 -0
  54. data/guides/assets/images/icons/prev.png +0 -0
  55. data/guides/assets/images/icons/tip.png +0 -0
  56. data/guides/assets/images/icons/up.png +0 -0
  57. data/guides/assets/images/icons/warning.png +0 -0
  58. data/guides/assets/images/nav_arrow.gif +0 -0
  59. data/guides/assets/images/tab_grey.gif +0 -0
  60. data/guides/assets/images/tab_info.gif +0 -0
  61. data/guides/assets/images/tab_note.gif +0 -0
  62. data/guides/assets/images/tab_red.gif +0 -0
  63. data/guides/assets/images/tab_yellow.gif +0 -0
  64. data/guides/assets/images/tab_yellow.png +0 -0
  65. data/guides/assets/javascripts/guides.js +0 -7
  66. data/guides/assets/javascripts/syntaxhighlighter/shBrushAS3.js +0 -59
  67. data/guides/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js +0 -75
  68. data/guides/assets/javascripts/syntaxhighlighter/shBrushBash.js +0 -59
  69. data/guides/assets/javascripts/syntaxhighlighter/shBrushCSharp.js +0 -65
  70. data/guides/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js +0 -100
  71. data/guides/assets/javascripts/syntaxhighlighter/shBrushCpp.js +0 -125
  72. data/guides/assets/javascripts/syntaxhighlighter/shBrushCss.js +0 -91
  73. data/guides/assets/javascripts/syntaxhighlighter/shBrushDelphi.js +0 -55
  74. data/guides/assets/javascripts/syntaxhighlighter/shBrushDiff.js +0 -41
  75. data/guides/assets/javascripts/syntaxhighlighter/shBrushErlang.js +0 -52
  76. data/guides/assets/javascripts/syntaxhighlighter/shBrushGroovy.js +0 -67
  77. data/guides/assets/javascripts/syntaxhighlighter/shBrushJScript.js +0 -52
  78. data/guides/assets/javascripts/syntaxhighlighter/shBrushJava.js +0 -57
  79. data/guides/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js +0 -58
  80. data/guides/assets/javascripts/syntaxhighlighter/shBrushPerl.js +0 -72
  81. data/guides/assets/javascripts/syntaxhighlighter/shBrushPhp.js +0 -88
  82. data/guides/assets/javascripts/syntaxhighlighter/shBrushPlain.js +0 -33
  83. data/guides/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js +0 -74
  84. data/guides/assets/javascripts/syntaxhighlighter/shBrushPython.js +0 -64
  85. data/guides/assets/javascripts/syntaxhighlighter/shBrushRuby.js +0 -55
  86. data/guides/assets/javascripts/syntaxhighlighter/shBrushSass.js +0 -94
  87. data/guides/assets/javascripts/syntaxhighlighter/shBrushScala.js +0 -51
  88. data/guides/assets/javascripts/syntaxhighlighter/shBrushSql.js +0 -66
  89. data/guides/assets/javascripts/syntaxhighlighter/shBrushVb.js +0 -56
  90. data/guides/assets/javascripts/syntaxhighlighter/shBrushXml.js +0 -69
  91. data/guides/assets/javascripts/syntaxhighlighter/shCore.js +0 -17
  92. data/guides/assets/stylesheets/fixes.css +0 -16
  93. data/guides/assets/stylesheets/main.css +0 -445
  94. data/guides/assets/stylesheets/print.css +0 -52
  95. data/guides/assets/stylesheets/reset.css +0 -43
  96. data/guides/assets/stylesheets/style.css +0 -13
  97. data/guides/assets/stylesheets/syntaxhighlighter/shCore.css +0 -226
  98. data/guides/assets/stylesheets/syntaxhighlighter/shCoreDefault.css +0 -328
  99. data/guides/assets/stylesheets/syntaxhighlighter/shCoreDjango.css +0 -331
  100. data/guides/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css +0 -339
  101. data/guides/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css +0 -324
  102. data/guides/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +0 -328
  103. data/guides/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css +0 -324
  104. data/guides/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css +0 -324
  105. data/guides/assets/stylesheets/syntaxhighlighter/shCoreRDark.css +0 -324
  106. data/guides/assets/stylesheets/syntaxhighlighter/shThemeDefault.css +0 -117
  107. data/guides/assets/stylesheets/syntaxhighlighter/shThemeDjango.css +0 -120
  108. data/guides/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css +0 -128
  109. data/guides/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css +0 -113
  110. data/guides/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +0 -117
  111. data/guides/assets/stylesheets/syntaxhighlighter/shThemeJaxGuides.css +0 -116
  112. data/guides/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css +0 -113
  113. data/guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css +0 -113
  114. data/guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css +0 -113
  115. data/guides/jax_guides.rb +0 -41
  116. data/guides/jax_guides/common.rb +0 -7
  117. data/guides/jax_guides/generator.rb +0 -287
  118. data/guides/jax_guides/helpers.rb +0 -29
  119. data/guides/jax_guides/indexer.rb +0 -69
  120. data/guides/jax_guides/levenshtein.rb +0 -31
  121. data/guides/jax_guides/textile_extensions.rb +0 -61
  122. data/guides/partials/_top_nav.html.erb +0 -17
  123. data/guides/source/getting_started.textile +0 -1210
  124. data/guides/source/index.html.erb +0 -61
  125. data/guides/source/layout.html.erb +0 -147
  126. data/guides/source/lighting.textile +0 -5
  127. data/guides/source/materials.textile +0 -5
  128. data/guides/source/matrices.textile +0 -5
  129. data/guides/source/shaders.textile +0 -499
  130. data/guides/source/testing.textile +0 -5
  131. data/guides/w3c_validator.rb +0 -91
  132. data/public/images/brickwall.jpg +0 -0
  133. data/public/images/jacks.jpg +0 -0
  134. data/public/images/normal_map.jpg +0 -0
  135. data/public/images/rock.png +0 -0
  136. data/public/images/rockNormal.png +0 -0
  137. data/public/images/rss.png +0 -0
  138. data/public/webgl_not_supported.html +0 -26
  139. data/spec/example_app/Gemfile +0 -1
  140. data/spec/example_app/Rakefile +0 -15
  141. data/spec/example_app/app/controllers/application_controller.js +0 -5
  142. data/spec/example_app/app/controllers/courthouse_controller.js +0 -24
  143. data/spec/example_app/app/controllers/lighting_controller.js +0 -67
  144. data/spec/example_app/app/controllers/noise_controller.js +0 -50
  145. data/spec/example_app/app/controllers/picking_controller.js +0 -32
  146. data/spec/example_app/app/controllers/shadows_controller.js +0 -130
  147. data/spec/example_app/app/controllers/textures_controller.js +0 -52
  148. data/spec/example_app/app/helpers/application_helper.js +0 -3
  149. data/spec/example_app/app/helpers/noise_helper.js +0 -3
  150. data/spec/example_app/app/helpers/picking_helper.js +0 -3
  151. data/spec/example_app/app/helpers/textures_helper.js +0 -3
  152. data/spec/example_app/app/models/blob.js +0 -38
  153. data/spec/example_app/app/models/character.js +0 -23
  154. data/spec/example_app/app/models/door.js +0 -10
  155. data/spec/example_app/app/models/scene.js +0 -19
  156. data/spec/example_app/app/resources/blobs/default.yml +0 -2
  157. data/spec/example_app/app/resources/characters/judge.yml +0 -3
  158. data/spec/example_app/app/resources/doors/courthouse_door.yml +0 -5
  159. data/spec/example_app/app/resources/light_sources/directional_light.yml +0 -13
  160. data/spec/example_app/app/resources/light_sources/point_light.yml +0 -31
  161. data/spec/example_app/app/resources/light_sources/spot_light.yml +0 -15
  162. data/spec/example_app/app/resources/light_sources/sun.yml +0 -7
  163. data/spec/example_app/app/resources/light_sources/textures_point.yml +0 -34
  164. data/spec/example_app/app/resources/materials/blob.yml +0 -28
  165. data/spec/example_app/app/resources/materials/bricks.yml +0 -36
  166. data/spec/example_app/app/resources/materials/lighting_with_shadows.yml +0 -27
  167. data/spec/example_app/app/resources/scenes/courthouse.yml +0 -4
  168. data/spec/example_app/app/shaders/blob/common.ejs +0 -13
  169. data/spec/example_app/app/shaders/blob/fragment.ejs +0 -8
  170. data/spec/example_app/app/shaders/blob/manifest.yml +0 -15
  171. data/spec/example_app/app/shaders/blob/material.js +0 -51
  172. data/spec/example_app/app/shaders/blob/vertex.ejs +0 -40
  173. data/spec/example_app/app/views/courthouse/index.js +0 -4
  174. data/spec/example_app/app/views/lighting/index.js +0 -4
  175. data/spec/example_app/app/views/noise/index.js +0 -4
  176. data/spec/example_app/app/views/picking/index.js +0 -4
  177. data/spec/example_app/app/views/shadows/index.js +0 -6
  178. data/spec/example_app/app/views/textures/index.js +0 -4
  179. data/spec/example_app/config/application.rb +0 -6
  180. data/spec/example_app/config/boot.rb +0 -13
  181. data/spec/example_app/config/routes.rb +0 -8
  182. data/spec/example_app/public/images/185__normalmap.png +0 -0
  183. data/spec/example_app/public/images/face_norm.jpg +0 -0
  184. data/spec/example_app/public/images/rock.png +0 -0
  185. data/spec/example_app/public/images/rockNormal.png +0 -0
  186. data/spec/example_app/public/images/rss.png +0 -0
  187. data/spec/example_app/public/webgl_not_supported.html +0 -26
  188. data/spec/example_app/script/jax +0 -7
  189. data/spec/example_app/spec/javascripts/controllers/noise_controller_spec.js +0 -11
  190. data/spec/example_app/spec/javascripts/controllers/picking_controller_spec.js +0 -11
  191. data/spec/example_app/spec/javascripts/controllers/textures_controller_spec.js +0 -11
  192. data/spec/example_app/spec/javascripts/helpers/application_helper_spec.js +0 -12
  193. data/spec/example_app/spec/javascripts/helpers/noise_helper_spec.js +0 -12
  194. data/spec/example_app/spec/javascripts/helpers/picking_helper_spec.js +0 -12
  195. data/spec/example_app/spec/javascripts/models/blob_spec.js +0 -11
  196. data/spec/example_app/spec/javascripts/resources/directional_light_spec.js +0 -16
  197. data/spec/example_app/spec/javascripts/resources/point_light_spec.js +0 -17
  198. data/spec/example_app/spec/javascripts/resources/spot_light_spec.js +0 -18
  199. data/spec/example_app/spec/javascripts/shaders/blob_spec.js +0 -27
  200. data/spec/example_app/spec/javascripts/support/jasmine.yml +0 -89
  201. data/spec/example_app/spec/javascripts/support/jasmine_runner.rb +0 -32
  202. data/spec/example_app/spec/javascripts/support/spec_helpers/jax_spec_environment_helper.js +0 -33
  203. data/spec/example_app/spec/javascripts/support/spec_helpers/jax_spec_helper.js +0 -93
  204. data/spec/example_app/spec/javascripts/support/spec_layout.html.erb +0 -111
  205. data/spec/javascripts/helpers/jax_spec_environment_helper.js +0 -33
  206. data/spec/javascripts/helpers/jax_spec_helper.js +0 -216
  207. data/spec/javascripts/jax/builtin/meshes/cube_spec.js +0 -10
  208. data/spec/javascripts/jax/builtin/meshes/plane_spec.js +0 -8
  209. data/spec/javascripts/jax/builtin/meshes/quad_spec.js +0 -8
  210. data/spec/javascripts/jax/builtin/meshes/sphere_spec.js +0 -8
  211. data/spec/javascripts/jax/builtin/meshes/teapot_spec.js +0 -8
  212. data/spec/javascripts/jax/builtin/meshes/torus_spec.js +0 -8
  213. data/spec/javascripts/jax/compatibility_spec.js +0 -50
  214. data/spec/javascripts/jax/context_spec.js +0 -82
  215. data/spec/javascripts/jax/controller_spec.js +0 -145
  216. data/spec/javascripts/jax/core/delegation_spec.js +0 -48
  217. data/spec/javascripts/jax/core/events_spec.js +0 -17
  218. data/spec/javascripts/jax/core/matrix_stack_spec.js +0 -28
  219. data/spec/javascripts/jax/core/utils_spec.js +0 -275
  220. data/spec/javascripts/jax/helper_spec.js +0 -33
  221. data/spec/javascripts/jax/model_spec.js +0 -97
  222. data/spec/javascripts/jax/optimizations/material_limitations_spec.js +0 -87
  223. data/spec/javascripts/jax/optimizations/shaders/basic_spec.js +0 -68
  224. data/spec/javascripts/jax/prototype/extensions_spec.js +0 -34
  225. data/spec/javascripts/jax/route_set_spec.js +0 -67
  226. data/spec/javascripts/jax/view_manager_spec.js +0 -17
  227. data/spec/javascripts/jax/webgl/camera_spec.js +0 -159
  228. data/spec/javascripts/jax/webgl/framebuffer_spec.js +0 -46
  229. data/spec/javascripts/jax/webgl/lighting_spec.js +0 -61
  230. data/spec/javascripts/jax/webgl/material_spec.js +0 -118
  231. data/spec/javascripts/jax/webgl/mesh_spec.js +0 -86
  232. data/spec/javascripts/jax/webgl/shader/manifest_spec.js +0 -60
  233. data/spec/javascripts/jax/webgl/shader_chain_spec.js +0 -192
  234. data/spec/javascripts/jax/webgl/shader_spec.js +0 -276
  235. data/spec/javascripts/jax/webgl/tangent_space_spec.js +0 -142
  236. data/spec/javascripts/jax/webgl/texture_spec.js +0 -162
  237. data/spec/javascripts/jax/webgl_spec.js +0 -5
  238. data/spec/javascripts/jax/world_spec.js +0 -161
  239. data/spec/javascripts/jax_spec.js +0 -27
  240. data/spec/javascripts/shaders/core_materials_spec.js +0 -42
  241. data/spec/javascripts/shaders/fog_spec.js +0 -19
  242. data/spec/javascripts/shaders/lighting_spec.js +0 -19
  243. data/spec/javascripts/shaders/normal_map_spec.js +0 -19
  244. data/spec/javascripts/shaders/paraboloid_spec.js +0 -37
  245. data/spec/javascripts/shaders/preprocessor_spec.js +0 -50
  246. data/spec/javascripts/shaders/shadow_map_spec.js +0 -19
  247. data/spec/javascripts/shaders/texture_spec.js +0 -40
  248. data/src/constants.yml +0 -1
  249. data/src/constants.yml.erb +0 -1
  250. data/src/jax.js +0 -119
  251. data/src/jax/anim_frame.js +0 -51
  252. data/src/jax/builtin/all.js +0 -7
  253. data/src/jax/builtin/meshes/cube.js +0 -83
  254. data/src/jax/builtin/meshes/plane.js +0 -63
  255. data/src/jax/builtin/meshes/quad.js +0 -86
  256. data/src/jax/builtin/meshes/sphere.js +0 -65
  257. data/src/jax/builtin/meshes/teapot.js +0 -48
  258. data/src/jax/builtin/meshes/torus.js +0 -64
  259. data/src/jax/compatibility.js +0 -303
  260. data/src/jax/context.js +0 -420
  261. data/src/jax/core.js +0 -42
  262. data/src/jax/core/math.js +0 -55
  263. data/src/jax/core/matrix_stack.js +0 -311
  264. data/src/jax/core/util.js +0 -253
  265. data/src/jax/events.js +0 -234
  266. data/src/jax/geometry.js +0 -7
  267. data/src/jax/geometry/plane.js +0 -113
  268. data/src/jax/mvc/controller.js +0 -195
  269. data/src/jax/mvc/helper.js +0 -35
  270. data/src/jax/mvc/model.js +0 -302
  271. data/src/jax/mvc/route_set.js +0 -125
  272. data/src/jax/mvc/view.js +0 -43
  273. data/src/jax/mvc/view_manager.js +0 -47
  274. data/src/jax/noise.js +0 -206
  275. data/src/jax/prototype/class.js +0 -81
  276. data/src/jax/prototype/core.js +0 -112
  277. data/src/jax/prototype/extensions.js +0 -142
  278. data/src/jax/vendor/ejs.js +0 -4
  279. data/src/jax/vendor/glMatrix.js +0 -3
  280. data/src/jax/webgl.js +0 -98
  281. data/src/jax/webgl/camera.js +0 -526
  282. data/src/jax/webgl/core.js +0 -6
  283. data/src/jax/webgl/core/buffer.js +0 -161
  284. data/src/jax/webgl/core/edge.js +0 -6
  285. data/src/jax/webgl/core/events.js +0 -25
  286. data/src/jax/webgl/core/face.js +0 -8
  287. data/src/jax/webgl/core/framebuffer.js +0 -211
  288. data/src/jax/webgl/material.js +0 -392
  289. data/src/jax/webgl/mesh.js +0 -427
  290. data/src/jax/webgl/scene.js +0 -11
  291. data/src/jax/webgl/scene/frustum.js +0 -260
  292. data/src/jax/webgl/scene/light_manager.js +0 -136
  293. data/src/jax/webgl/scene/light_source.js +0 -294
  294. data/src/jax/webgl/shader.js +0 -296
  295. data/src/jax/webgl/shader/delegator.js +0 -13
  296. data/src/jax/webgl/shader/delegator/attribute.js +0 -53
  297. data/src/jax/webgl/shader/delegator/uniform.js +0 -71
  298. data/src/jax/webgl/shader/manifest.js +0 -64
  299. data/src/jax/webgl/shader/program.js +0 -140
  300. data/src/jax/webgl/shader_chain.js +0 -264
  301. data/src/jax/webgl/texture.js +0 -312
  302. data/src/jax/webgl/world.js +0 -240
  303. data/vendor/ejs/.svn/all-wcprops +0 -17
  304. data/vendor/ejs/.svn/entries +0 -114
  305. data/vendor/ejs/.svn/text-base/Eratta.txt.svn-base +0 -3
  306. data/vendor/ejs/.svn/text-base/license.txt.svn-base +0 -21
  307. data/vendor/ejs/Eratta.txt +0 -3
  308. data/vendor/ejs/example/.svn/all-wcprops +0 -29
  309. data/vendor/ejs/example/.svn/entries +0 -164
  310. data/vendor/ejs/example/.svn/prop-base/ejs.gif.svn-base +0 -5
  311. data/vendor/ejs/example/.svn/text-base/demo.html.svn-base +0 -54
  312. data/vendor/ejs/example/.svn/text-base/ejs.gif.svn-base +0 -0
  313. data/vendor/ejs/example/.svn/text-base/example.css.svn-base +0 -31
  314. data/vendor/ejs/example/.svn/text-base/example.js.svn-base +0 -88
  315. data/vendor/ejs/example/demo.html +0 -54
  316. data/vendor/ejs/example/ejs.gif +0 -0
  317. data/vendor/ejs/example/example.css +0 -31
  318. data/vendor/ejs/example/example.js +0 -88
  319. data/vendor/ejs/lib/.svn/all-wcprops +0 -11
  320. data/vendor/ejs/lib/.svn/entries +0 -62
  321. data/vendor/ejs/lib/.svn/text-base/ejs_fulljslint.js.svn-base +0 -3774
  322. data/vendor/ejs/lib/ejs_fulljslint.js +0 -3774
  323. data/vendor/ejs/license.txt +0 -21
  324. data/vendor/ejs/script/.svn/all-wcprops +0 -17
  325. data/vendor/ejs/script/.svn/entries +0 -96
  326. data/vendor/ejs/script/.svn/prop-base/yuicompressor-2.2.4.jar.svn-base +0 -5
  327. data/vendor/ejs/script/.svn/text-base/production.bat.svn-base +0 -4
  328. data/vendor/ejs/script/.svn/text-base/yuicompressor-2.2.4.jar.svn-base +0 -0
  329. data/vendor/ejs/script/production.bat +0 -4
  330. data/vendor/ejs/script/yuicompressor-2.2.4.jar +0 -0
  331. data/vendor/ejs/src/.svn/all-wcprops +0 -17
  332. data/vendor/ejs/src/.svn/entries +0 -96
  333. data/vendor/ejs/src/.svn/text-base/ejs.js.svn-base +0 -505
  334. data/vendor/ejs/src/.svn/text-base/view.js.svn-base +0 -200
  335. data/vendor/ejs/src/ejs.js +0 -505
  336. data/vendor/ejs/src/view.js +0 -200
  337. data/vendor/ejs/test/.svn/all-wcprops +0 -23
  338. data/vendor/ejs/test/.svn/entries +0 -139
  339. data/vendor/ejs/test/.svn/text-base/index.html.svn-base +0 -18
  340. data/vendor/ejs/test/.svn/text-base/setup_test.html.svn-base +0 -44
  341. data/vendor/ejs/test/.svn/text-base/sidebar.html.svn-base +0 -28
  342. data/vendor/ejs/test/included/.svn/all-wcprops +0 -23
  343. data/vendor/ejs/test/included/.svn/entries +0 -130
  344. data/vendor/ejs/test/included/.svn/text-base/prototype.js.svn-base +0 -4184
  345. data/vendor/ejs/test/included/.svn/text-base/test.css.svn-base +0 -44
  346. data/vendor/ejs/test/included/.svn/text-base/unittest.js.svn-base +0 -564
  347. data/vendor/ejs/test/included/prototype.js +0 -4184
  348. data/vendor/ejs/test/included/test.css +0 -44
  349. data/vendor/ejs/test/included/unittest.js +0 -564
  350. data/vendor/ejs/test/index.html +0 -18
  351. data/vendor/ejs/test/setup_test.html +0 -44
  352. data/vendor/ejs/test/sidebar.html +0 -28
  353. data/vendor/ejs/test/templates/.svn/all-wcprops +0 -11
  354. data/vendor/ejs/test/templates/.svn/entries +0 -62
  355. data/vendor/ejs/test/templates/.svn/text-base/test.ejs.svn-base +0 -3
  356. data/vendor/ejs/test/templates/test.ejs +0 -3
  357. data/vendor/ejs/test/tests/.svn/all-wcprops +0 -23
  358. data/vendor/ejs/test/tests/.svn/entries +0 -130
  359. data/vendor/ejs/test/tests/.svn/text-base/rendering.js.svn-base +0 -94
  360. data/vendor/ejs/test/tests/.svn/text-base/templating.js.svn-base +0 -43
  361. data/vendor/ejs/test/tests/.svn/text-base/views.js.svn-base +0 -100
  362. data/vendor/ejs/test/tests/rendering.js +0 -94
  363. data/vendor/ejs/test/tests/templating.js +0 -43
  364. data/vendor/ejs/test/tests/views.js +0 -100
  365. data/vendor/glmatrix/benchmark/js/CanvasMatrix.js +0 -722
  366. data/vendor/glmatrix/benchmark/js/EWGL_math.js +0 -742
  367. data/vendor/glmatrix/benchmark/js/mjs.js +0 -1230
  368. data/vendor/glmatrix/benchmark/matrix_benchmark.html +0 -419
  369. data/vendor/glmatrix/glMatrix-min.js +0 -32
  370. data/vendor/glmatrix/glMatrix.js +0 -1772
  371. data/vendor/glmatrix/unit tests/glMatrix-test.js +0 -74
  372. data/vendor/glmatrix/unit tests/qunit.css +0 -119
  373. data/vendor/glmatrix/unit tests/qunit.js +0 -1069
  374. data/vendor/glmatrix/unit tests/test_glMatrix.html +0 -21
  375. data/vendor/pdoc_template/html/assets/images/pdoc/alias.png +0 -0
  376. data/vendor/pdoc_template/html/assets/images/pdoc/class.png +0 -0
  377. data/vendor/pdoc_template/html/assets/images/pdoc/class_deprecated.png +0 -0
  378. data/vendor/pdoc_template/html/assets/images/pdoc/class_method.png +0 -0
  379. data/vendor/pdoc_template/html/assets/images/pdoc/class_property.png +0 -0
  380. data/vendor/pdoc_template/html/assets/images/pdoc/constant.png +0 -0
  381. data/vendor/pdoc_template/html/assets/images/pdoc/constructor.png +0 -0
  382. data/vendor/pdoc_template/html/assets/images/pdoc/deprecated.png +0 -0
  383. data/vendor/pdoc_template/html/assets/images/pdoc/description.png +0 -0
  384. data/vendor/pdoc_template/html/assets/images/pdoc/information.png +0 -0
  385. data/vendor/pdoc_template/html/assets/images/pdoc/instance_method.png +0 -0
  386. data/vendor/pdoc_template/html/assets/images/pdoc/instance_property.png +0 -0
  387. data/vendor/pdoc_template/html/assets/images/pdoc/method.png +0 -0
  388. data/vendor/pdoc_template/html/assets/images/pdoc/method_deprecated.png +0 -0
  389. data/vendor/pdoc_template/html/assets/images/pdoc/mixin.png +0 -0
  390. data/vendor/pdoc_template/html/assets/images/pdoc/namespace.png +0 -0
  391. data/vendor/pdoc_template/html/assets/images/pdoc/property.png +0 -0
  392. data/vendor/pdoc_template/html/assets/images/pdoc/related_to.png +0 -0
  393. data/vendor/pdoc_template/html/assets/images/pdoc/search-background.png +0 -0
  394. data/vendor/pdoc_template/html/assets/images/pdoc/section-background.png +0 -0
  395. data/vendor/pdoc_template/html/assets/images/pdoc/section.png +0 -0
  396. data/vendor/pdoc_template/html/assets/images/pdoc/selected-section-background.png +0 -0
  397. data/vendor/pdoc_template/html/assets/images/pdoc/subclass.png +0 -0
  398. data/vendor/pdoc_template/html/assets/images/pdoc/superclass.png +0 -0
  399. data/vendor/pdoc_template/html/assets/images/pdoc/utility.png +0 -0
  400. data/vendor/pdoc_template/html/assets/javascripts/pdoc/application.js +0 -478
  401. data/vendor/pdoc_template/html/assets/javascripts/pdoc/prototype.js +0 -4874
  402. data/vendor/pdoc_template/html/assets/javascripts/pdoc/tabs.js +0 -506
  403. data/vendor/pdoc_template/html/assets/stylesheets/jax.css +0 -30
  404. data/vendor/pdoc_template/html/assets/stylesheets/pdoc/api.css +0 -681
  405. data/vendor/pdoc_template/html/assets/stylesheets/pdoc/pygments.css +0 -62
  406. data/vendor/pdoc_template/html/helpers.rb +0 -35
  407. data/vendor/pdoc_template/html/index.erb +0 -18
  408. data/vendor/pdoc_template/html/item_index.js.erb +0 -6
  409. data/vendor/pdoc_template/html/layout.erb +0 -67
  410. data/vendor/pdoc_template/html/leaf.erb +0 -22
  411. data/vendor/pdoc_template/html/node.erb +0 -30
  412. data/vendor/pdoc_template/html/partials/class_relationships.erb +0 -19
  413. data/vendor/pdoc_template/html/partials/classes.erb +0 -7
  414. data/vendor/pdoc_template/html/partials/constructor.erb +0 -5
  415. data/vendor/pdoc_template/html/partials/description.erb +0 -5
  416. data/vendor/pdoc_template/html/partials/link_list.erb +0 -1
  417. data/vendor/pdoc_template/html/partials/method_signatures.erb +0 -14
  418. data/vendor/pdoc_template/html/partials/methodized_note.erb +0 -9
  419. data/vendor/pdoc_template/html/partials/mixins.erb +0 -7
  420. data/vendor/pdoc_template/html/partials/namespaces.erb +0 -7
  421. data/vendor/pdoc_template/html/partials/related_utilities.erb +0 -5
  422. data/vendor/pdoc_template/html/partials/relationships.erb +0 -11
  423. data/vendor/pdoc_template/html/partials/short_description_list.erb +0 -7
  424. data/vendor/pdoc_template/html/partials/title.erb +0 -24
  425. data/vendor/pdoc_template/html/section.erb +0 -18
  426. data/vendor/yuicompressor-2.4.2.jar +0 -0
@@ -1,6 +0,0 @@
1
- Jax.Core = {};
2
-
3
- //= require "core/face"
4
- //= require "core/edge"
5
- //= require "core/buffer"
6
- //= require "core/framebuffer"
@@ -1,161 +0,0 @@
1
- /**
2
- * class Jax.Buffer
3
- *
4
- * Root class of all WebGL buffer objects.
5
- *
6
- * Wrapper to manage JS and GL buffer (array) types. Automates context juggling by requiring the context to generate the
7
- * buffer for as an argument to #bind. If the context doesn't have a corresponding GL buffer for this data, it will be
8
- * created. Calling #refresh will regenerate the buffer data for all contexts.
9
- *
10
- **/
11
- Jax.Buffer = (function() {
12
- function each_gl_buffer(self, func)
13
- {
14
- for (var id in self.gl)
15
- func(self.gl[id].context, self.gl[id].buffer);
16
- }
17
-
18
- return Jax.Class.create({
19
- initialize: function(bufferType, classType, drawType, jsarr, itemSize) {
20
- if (jsarr.length == 0) throw new Error("No elements in array to be buffered!");
21
- if (!itemSize) throw new Error("Expected an itemSize - how many JS array elements represent a single buffered element?");
22
- this.classType = classType;
23
- this.itemSize = itemSize;
24
- this.js = jsarr;
25
- this.gl = {};
26
- this.numItems = this.length = jsarr.length / itemSize;
27
- this.bufferType = bufferType;
28
- this.drawType = drawType;
29
- },
30
-
31
- refresh: function() {
32
- var self = this;
33
- if (self.classTypeInstance)
34
- for (var i = 0; i < self.js.length; i++)
35
- self.classTypeInstance[i] = self.js[i];
36
- else
37
- self.classTypeInstance = new self.classType(self.js);
38
-
39
- self.numItems = self.length = self.js.length / self.itemSize;
40
- if (!self.gl) return;
41
-
42
- each_gl_buffer(self, function(context, buffer) {
43
- buffer.numItems = buffer.length = self.js.length;
44
- context.glBindBuffer(self.bufferType, buffer);
45
- context.glBufferData(self.bufferType, self.classTypeInstance, self.drawType);
46
- });
47
- },
48
-
49
- dispose: function() {
50
- var self = this;
51
- each_gl_buffer(this, function(context, buffer) {
52
- context.glDeleteBuffer(buffer);
53
- self.gl[context.id] = null;
54
- });
55
- self.gl = {};
56
- },
57
-
58
- isDisposed: function() { return !this.gl; },
59
-
60
- bind: function(context) { context.glBindBuffer(this.bufferType, this.getGLBuffer(context)); },
61
-
62
- getGLBuffer: function(context)
63
- {
64
- if (!context || typeof(context.id) == "undefined")
65
- throw new Error("Cannot build a buffer without a context!");
66
-
67
- if (!this.gl[context.id])
68
- {
69
- var buffer = context.glCreateBuffer();
70
- buffer.itemSize = this.itemSize;
71
- this.gl[context.id] = {context:context,buffer:buffer};
72
- this.refresh();
73
- }
74
- return this.gl[context.id].buffer;
75
- }
76
- });
77
- })();
78
-
79
- /**
80
- * class Jax.ElementArrayBuffer < Jax.Buffer
81
- *
82
- * A generic Int16 Array. Initialized with a standard JavaScript Array argument.
83
- * Its item size is 1, so each element in the array represents a separate datum,
84
- *
85
- * This type of buffer is commonly used for vertex indices, etc.
86
- *
87
- * Example:
88
- * var buf = new Jax.ElementArrayBuffer([...]);
89
- **/
90
- Jax.ElementArrayBuffer = Jax.Class.create(Jax.Buffer, {
91
- initialize: function($super, jsarr) {
92
- $super(GL_ELEMENT_ARRAY_BUFFER, Uint16Array, GL_STREAM_DRAW, jsarr, 1);
93
- }
94
- });
95
-
96
- /**
97
- * class Jax.FloatArrayBuffer < Jax.Buffer
98
- *
99
- * A generic Float Array. Initialized with a standard JavaScript Array argument,
100
- * and an item size. As the item size represents how many array elements represent
101
- * a single datum, the array must be divisible by this number.
102
- *
103
- * Unless you're implementing something Jax does not support by default, you're
104
- * most likely looking for one of the subclasses of Jax.FloatArrayBuffer.
105
- *
106
- * Example:
107
- * var buf = new Jax.FloatArrayBuffer([...], 3);
108
- **/
109
- Jax.FloatArrayBuffer = Jax.Class.create(Jax.Buffer, {
110
- initialize: function($super, jsarr, itemSize) {
111
- $super(GL_ARRAY_BUFFER, Float32Array, GL_STATIC_DRAW, jsarr, itemSize);
112
- }
113
- });
114
-
115
- /**
116
- * class Jax.VertexBuffer < Jax.FloatArrayBuffer
117
- *
118
- * Initialized with a standard JavaScript Array argument.
119
- *
120
- * Example:
121
- * var buf = new Jax.VertexBuffer([...]);
122
- **/
123
- Jax.VertexBuffer = Jax.Class.create(Jax.FloatArrayBuffer, {
124
- initialize: function($super, jsarr) { $super(jsarr, 3); }
125
- });
126
-
127
- /**
128
- * class Jax.ColorBuffer < Jax.FloatArrayBuffer
129
- *
130
- * Initialized with a standard JavaScript Array argument.
131
- *
132
- * Example:
133
- * var buf = new Jax.ColorBuffer([...]);
134
- **/
135
- Jax.ColorBuffer = Jax.Class.create(Jax.FloatArrayBuffer, {
136
- initialize: function($super, jsarr) { $super(jsarr, 4); }
137
- });
138
-
139
- /**
140
- * class Jax.TextureCoordsBuffer < Jax.FloatArrayBuffer
141
- *
142
- * Initialized with a standard JavaScript Array argument.
143
- *
144
- * Example:
145
- * var buf = new Jax.TextureCoordsBuffer([...]);
146
- **/
147
- Jax.TextureCoordsBuffer = Jax.Class.create(Jax.FloatArrayBuffer, {
148
- initialize: function($super, jsarr) { $super(jsarr, 2); }
149
- });
150
-
151
- /**
152
- * class Jax.NormalBuffer < Jax.FloatArrayBuffer
153
- *
154
- * Initialized with a standard JavaScript Array argument.
155
- *
156
- * Example:
157
- * var buf = new Jax.NormalBuffer([...]);
158
- **/
159
- Jax.NormalBuffer = Jax.Class.create(Jax.FloatArrayBuffer, {
160
- initialize: function($super, jsarr) { $super(jsarr, 3); }
161
- });
@@ -1,6 +0,0 @@
1
- Jax.Core.Edge = Jax.Class.create({
2
- initialize: function() {
3
- this.faceIndices = [];
4
- this.vertexIndices = [];
5
- }
6
- });
@@ -1,25 +0,0 @@
1
- Jax.Events = (function() {
2
- return {
3
- Methods: {
4
- getEventListeners: function(name) {
5
- this.event_listeners = this.event_listeners || {};
6
- return this.event_listeners[name] = this.event_listeners[name] || [];
7
- },
8
-
9
- addEventListener: function(name, callback) {
10
- this.getEventListeners(name).push(callback);
11
- return this.getEventListeners(name).length - 1;
12
- },
13
-
14
- removeEventListener: function(name, index) {
15
- this.getEventListeners(name).splice(index, 1);
16
- },
17
-
18
- fireEvent: function(name, event_object) {
19
- var listeners = this.getEventListeners(name);
20
- for (var i = 0; i < listeners.length; i++)
21
- listeners[i].call(this, event_object);
22
- }
23
- }
24
- };
25
- })();
@@ -1,8 +0,0 @@
1
- Jax.Core.Face = Jax.Class.create({
2
- initialize: function(vertexIndices) {
3
- if (arguments.length > 1)
4
- this.vertexIndices = vec3.create(arguments);
5
- else if (vertexIndices)
6
- this.vertexIndices = vec3.create(vertexIndices);
7
- }
8
- });
@@ -1,211 +0,0 @@
1
- /**
2
- * class Jax.Framebuffer
3
- *
4
- * Used for rendering images off-screen and capturing the result.
5
- **/
6
- Jax.Framebuffer = (function() {
7
- function build(context, self) {
8
- var handle = context.glCreateFramebuffer();
9
- var width = self.options.width, height = self.options.height;
10
-
11
- self.setHandle(context, handle);
12
- context.glBindFramebuffer(GL_FRAMEBUFFER, handle);
13
-
14
- // depth and stencil attachment
15
- if (self.options.depth && self.options.stencil) {
16
- handle.depthstencilbuffer = context.glCreateRenderbuffer();
17
- context.glBindRenderbuffer(GL_RENDERBUFFER, handle.depthstencilbuffer);
18
- context.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL, width, height);
19
- context.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, handle.depthstencilbuffer);
20
- context.glBindRenderbuffer(GL_RENDERBUFFER, null);
21
- }
22
-
23
- // depth attachment
24
- if (self.options.depth && !self.options.stencil) {
25
- handle.depthbuffer = context.glCreateRenderbuffer();
26
- context.glBindRenderbuffer(GL_RENDERBUFFER, handle.depthbuffer);
27
- context.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
28
- context.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, handle.depthbuffer);
29
- context.glBindRenderbuffer(GL_RENDERBUFFER, null);
30
- }
31
-
32
- // stencil attachment
33
- if (self.options.stencil && !self.options.depth) {
34
- handle.stencilbuffer = context.glCreateRenderbuffer();
35
- context.glBindRenderbuffer(GL_RENDERBUFFER, handle.stencilbuffer);
36
- context.glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, width, height);
37
- context.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, handle.stencilbuffer);
38
- context.glBindRenderbuffer(GL_RENDERBUFFER, null);
39
- }
40
-
41
- // texture attachments
42
- handle.textures = [];
43
- var attachment = GL_COLOR_ATTACHMENT0;
44
- for (var i = 0; i < self.options.colors.length; i++) {
45
- var format = self.options.colors[i];
46
- var texture_options = {
47
- format:GL_RGBA,
48
- width:width,
49
- height:height,
50
- min_filter:GL_LINEAR,
51
- mag_filter:GL_LINEAR,
52
- wrap_s:GL_CLAMP_TO_EDGE,
53
- wrap_t:GL_CLAMP_TO_EDGE,
54
- generate_mipmap:false
55
- };
56
- if (typeof(format) != "number") { texture_options = Jax.Util.normalizeOptions(format, texture_options); }
57
- else { texture_options.format = format; }
58
- handle.textures[i] = new Jax.Texture(texture_options);
59
-
60
- if (handle.textures[i].getTarget() == GL_TEXTURE_2D)
61
- context.glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, GL_TEXTURE_2D, handle.textures[i].getHandle(context), 0);
62
- else
63
- context.glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, GL_TEXTURE_CUBE_MAP_POSITIVE_X,
64
- handle.textures[i].getHandle(context), 0);
65
-
66
- attachment++;
67
- }
68
-
69
- checkStatus(context, self);
70
- }
71
-
72
- function checkStatus(context, self) {
73
- var status = context.glCheckFramebufferStatus(GL_FRAMEBUFFER);
74
- self.unbind(context);
75
- switch(status) {
76
- case GL_FRAMEBUFFER_COMPLETE:
77
- // success!
78
- break;
79
- case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
80
- throw new Error("Jax.Framebuffer: one or more attachments is incomplete. (GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)");
81
- case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
82
- throw new Error("Jax.Framebuffer: there are no images attached to the framebuffer. (GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)");
83
- case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
84
- throw new Error("Jax.Framebuffer: all attachments must have the same dimensions. (GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS)");
85
- case GL_FRAMEBUFFER_UNSUPPORTED:
86
- throw new Error("Jax.Framebuffer: the requested framebuffer layout is unsupported on this hardware. (GL_FRAMEBUFFER_UNSUPPORTED)");
87
- case (window['GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER'] || 0x8cdb):
88
- // a cryptic error that is not in the WebGL spec. Took me way too long to figure this out and I'm still not
89
- // sure why it happens...
90
- // but it seems to crop up primarily when no textures are attached.
91
- // from opengl (not webgl) spec: The value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT must not be NONE for any
92
- // color attachment point(s) named by DRAW_BUFFER.
93
- throw new Error("Jax.Framebuffer: make sure the framebuffer has at least 1 texture attachment. (GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER)");
94
- default:
95
- var which;
96
- for (which in context.gl)
97
- if (context.gl[which] == status)
98
- throw new Error("Jax.Framebuffer: an unknown error occurred. ("+status+" - "+which+")");
99
- throw new Error("Jax.Framebuffer: an unknown error occurred. ("+status+")");
100
- }
101
- }
102
-
103
- return Jax.Class.create({
104
- /**
105
- * new Jax.Framebuffer([options])
106
- * - options (Object): a generic object containing the following optional properties:
107
- *
108
- * * colors: an array of color formats such as GL_RGBA, GL_RGB, etc. The _colors_ array may
109
- * be empty if no color attachments are needed. Defaults to [GL_RGBA] unless _color_
110
- * is specified.
111
- *
112
- * Alternatively, an options object can be used. This object will be passed into
113
- * Jax.Texture().
114
- *
115
- * * color: optionally, in place of a colors array, a single color format as above. If both
116
- * _color_ and _colors_ are specified, _color_ is simply added to the _colors_ array.
117
- * * depth: true if a depth attachment is required, false otherwise. Defaults to false.
118
- * * stencil: true if a stencil attachment is required, false otherwise. Defaults to false.
119
- * * width: the width of the render and color buffers. All render and color buffers for a given
120
- * framebuffer must have the same width. Defaults to 512.
121
- * * height: the height of the render and color buffers. All render and color buffers for a given
122
- * framebuffer must have the same height. Defaults to 512.
123
- *
124
- **/
125
- initialize: function(options) {
126
- var defaults = {
127
- depth: false,
128
- stencil: false,
129
- width:512,
130
- height:512
131
- };
132
- if (!(options && (options.color || options.colors))) defaults.colors = [GL_RGBA];
133
-
134
- this.handles = {};
135
- this.options = options = Jax.Util.normalizeOptions(options, defaults);
136
- if (options.color != undefined) {
137
- if (options.colors != undefined) options.colors.push(options.color);
138
- else options.colors = [options.color];
139
- delete options.color;
140
- }
141
- },
142
-
143
- /**
144
- * Jax.Framebuffer#cubeFace(context, texIndex, faceEnum[, callback]) -> Jax.Framebuffer
145
- * - context (Jax.Context): a Jax context
146
- * - texIndex (number): the index of the cube map texture
147
- * - faceEnum (enum): the cube map face to bind
148
- * - callback (function): an optional callback. If given, the framebuffer will be automatically unbound
149
- * after the callback returns. Otherwise, the framebuffer will remain bound.
150
- *
151
- * For cube map framebuffers only, this will bind the specified cube map face to its color buffer position.
152
- * The faceEnum can be any of the following face enums:
153
- *
154
- * 0: GL_TEXTURE_CUBE_MAP_POSITIVE_X
155
- * 1: GL_TEXTURE_CUBE_MAP_NEGATIVE_X
156
- * 2: GL_TEXTURE_CUBE_MAP_POSITIVE_Y
157
- * 3: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
158
- * 4: GL_TEXTURE_CUBE_MAP_POSITIVE_Z
159
- * 5: GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
160
- *
161
- * Example:
162
- *
163
- * fb.bindCubeFace(context, 0, GL_TEXTURE_CUBE_MAP_POSITIVE_X, function() {
164
- * // render to +X cube face
165
- * });
166
- * fb.bindCubeFace(context, 0, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, function() {
167
- * // render to -Z cube face
168
- * });
169
- **/
170
- bindCubeFace: function(context, texIndex, faceEnum, callback) {
171
- if (!this.getHandle(context)) build(context, this);
172
- var texture = this.getHandle(context).textures[texIndex];
173
- if (texture.options.target != GL_TEXTURE_CUBE_MAP)
174
- throw new Error("Texture at index "+texIndex+" is not a cube map!");
175
-
176
- this.bind(context);
177
- context.glFramebufferTexture2D(GL_FRAMEBUFFER, window['GL_COLOR_ATTACHMENT'+texIndex],
178
- faceEnum, texture.getHandle(context), 0);
179
-
180
- if (callback) {
181
- callback();
182
- this.unbind(context);
183
- }
184
- },
185
-
186
- bind: function(context, callback) {
187
- if (!this.getHandle(context)) build(context, this);
188
- context.glBindFramebuffer(GL_FRAMEBUFFER, this.getHandle(context));
189
-
190
-
191
- if (callback) {
192
- callback.call(this);
193
- this.unbind(context);
194
- }
195
- },
196
-
197
- unbind: function(context) {
198
- context.glBindFramebuffer(GL_FRAMEBUFFER, null);
199
- },
200
-
201
- viewport: function(context) {
202
- context.glViewport(0,0,this.options.width,this.options.height);
203
- },
204
-
205
- getTextureBuffer: function(context, index) { return this.getHandle(context) && this.getHandle(context).textures[index]; },
206
- getTextureBufferHandle: function(context, index) { return this.getTextureBuffer().getHandle(context); },
207
-
208
- getHandle: function(context) { return this.handles[context.id]; },
209
- setHandle: function(context, handle) { this.handles[context.id] = handle; }
210
- });
211
- })();
@@ -1,392 +0,0 @@
1
- //= require "shader"
2
-
3
- /**
4
- * class Jax.Material
5
- *
6
- * Represents a single material, which has its own color, lighting and texture properties.
7
- *
8
- * Example:
9
- *
10
- * var material = new Jax.Material({ shininess: 1,
11
- * diffuse: [0.8, 0.8, 0.8, 1.0],
12
- * ambient: [0.8, 0.8, 0.8, 1.0],
13
- * specular: [1.0, 1.0, 1.0, 1.0],
14
- * emissive: [0.0, 0.0, 0.0, 1.0]
15
- * });
16
- *
17
- * IMPORTANT: Note that shaders are no longer directly tied to a given Material. Instead, the shader
18
- * should be specified as a property (or render option) of the mesh to be rendered. In most cases,
19
- * however, the appropriate shader will be determined automatically by Jax.
20
- **/
21
- Jax.Material = (function() {
22
- function updatePrevious(self) {
23
- self.previous = self.previous || {subshaders:[]};
24
- for (var i = 0; i < self.layers.length; i++)
25
- self.previous.subshaders[i] = self.layers[i].getName();
26
- }
27
-
28
- function instantiate_layer(options) {
29
- if (options.isKindOf && options.isKindOf(Jax.Material))
30
- return options;
31
- else {
32
- if (options.type) {
33
- var klass = Jax.Material[options.type];
34
- if (!klass) throw new Error("Could not find material layer type: "+options.type);
35
- delete options.type;
36
- return new klass(options);
37
- }
38
- else
39
- throw new Error("Could not create layer: property 'type' was missing!");
40
- }
41
- }
42
-
43
- return Jax.Class.create({
44
- initialize: function(options) {
45
- options = Jax.Util.normalizeOptions(options, {
46
- ambient: [1,1,1,1],
47
- diffuse: [1,1,1,1],
48
- specular:[1,1,1,1],
49
- emissive: [0, 0, 0, 1.0],
50
- shininess: 10,
51
- default_shader: Jax.default_shader
52
- });
53
- options.ambient = Jax.Util.colorize(options.ambient);
54
- options.diffuse = Jax.Util.colorize(options.diffuse);
55
- options.specular = Jax.Util.colorize(options.specular);
56
- options.emissive = Jax.Util.colorize(options.emissive);
57
-
58
- for (var i in options) { this[i] = options[i]; }
59
- this.option_properties = Jax.Util.properties(options);
60
- this.protected_properties = ['name', 'shader', 'default_shader', 'shaders', 'layers'];
61
-
62
- this.name = options.name || options.shader || options.default_shader;
63
- this.shaders = {};
64
- this.layers = [];
65
-
66
- var tex;
67
- if (options.texture) {
68
- tex = new Jax.Texture(options.texture);
69
- this.addTextureLayer(tex);
70
- delete options.texture;
71
- } else if (options.textures) {
72
- for (i = 0; i < options.textures.length; i++) {
73
- tex = new Jax.Texture(options.textures[i]);
74
- this.addTextureLayer(tex);
75
- }
76
- delete options.textures;
77
- }
78
-
79
- if (options.layers) {
80
- for (i = 0; i < options.layers.length; i++) {
81
- this.addLayer(instantiate_layer(options.layers[i]));
82
- }
83
- }
84
- },
85
-
86
- /**
87
- * Jax.Material#supportsLighting() -> Boolean
88
- *
89
- * Returns true if this material supports lighting effects.
90
- **/
91
- supportsLighting: function() {
92
- if (this.getName() == "lighting")
93
- return true;
94
- for (var i = 0; i < this.layers.length; i++)
95
- if (this.layers[i].getName() == "lighting")
96
- return true;
97
- return false;
98
- },
99
-
100
- getName: function() { return this.name; },
101
-
102
- addTextureLayer: function(tex) {
103
- var mat;
104
- switch(tex.options.type) {
105
- case Jax.NORMAL_MAP:
106
- mat = new Jax.Material.NormalMap(tex);
107
- break;
108
- default:
109
- mat = new Jax.Material.Texture(tex);
110
- }
111
- this.addLayer(mat);
112
- },
113
-
114
- addLayer: function(layer) {
115
- if (!layer.option_properties) layer = instantiate_layer(layer);
116
- this.layers.push(layer);
117
-
118
- for (var i = 0; i < layer.option_properties.length; i++) {
119
- var name = layer.option_properties[i];
120
- if (this.protected_properties.indexOf(name) == -1 && this[name] == undefined) {
121
- this[name] = layer[name];
122
- }
123
- }
124
- },
125
-
126
- /**
127
- * Jax.Material#buildShader(name) -> Jax.Shader
128
- *
129
- * Forces a rebuild of the specified shader. If the shader doesn't exist, one will be instantiated.
130
- * Note that this doesn't result in an immediate recompile (as that would require a Jax.Context).
131
- * Instead, it schedules the rebuild for the next render pass, when the Jax.Context is readily
132
- * available.
133
- **/
134
- buildShader: function() {
135
- if (this.shaderChain)
136
- this.shaderChain.removeAllShaders();
137
- else
138
- this.shaderChain = new Jax.ShaderChain(this.getName());
139
-
140
- this.addShadersToChain(this.shaderChain);
141
-
142
- return this.shaderChain;
143
- },
144
-
145
- addShadersToChain: function(chain) {
146
- this.shader_variable_prefix = chain.addShader(this.getBaseShader());
147
- for (var i = 0; i < this.layers.length; i++)
148
- this.layers[i].addShadersToChain(chain);
149
- },
150
-
151
- getBaseShader: function() {
152
- return (this.shader || this.default_shader);
153
- },
154
-
155
- /**
156
- * Jax.Material#updateModifiedShaders() -> self
157
- *
158
- * If this Material has been modified, all shaders attached to it will be rebuilt.
159
- **/
160
- updateModifiedShaders: function() {
161
- if (this.isChanged()) {
162
- this.buildShader();
163
- updatePrevious(this);
164
- }
165
- return this;
166
- },
167
-
168
- /**
169
- * Jax.Material#prepareShader(name) -> Jax.Shader
170
- *
171
- * Prepares the specified shader for rendering. If this Material has been modified,
172
- * then all related shaders are updated. The specified shader is either built or returned,
173
- * depending on whether it has already been built.
174
- **/
175
- prepareShader: function() {
176
- var shader;
177
-
178
- if (this.shaderChain) shader = this.shaderChain;
179
- else shader = this.buildShader();
180
-
181
- this.updateModifiedShaders();
182
- return shader;
183
- },
184
-
185
- setUniforms: function(context, mesh, options, uniforms) {},
186
- setAttributes: function(context, mesh, options, attributes) { },
187
-
188
- setShaderVariables: function(context, mesh, options, manifest) {
189
- manifest.variable_prefix = this.shader_variable_prefix;
190
-
191
- manifest.set({
192
- mMatrix: context.getModelMatrix(),
193
- vnMatrix: mat3.transpose(mat4.toMat3(context.getViewMatrix())),
194
- ivMatrix: context.getInverseViewMatrix(),
195
- vMatrix: context.getViewMatrix(),
196
- mvMatrix: context.getModelViewMatrix(),
197
- pMatrix: context.getProjectionMatrix(),
198
- nMatrix: context.getNormalMatrix(),
199
-
200
- PASS_TYPE: context.current_pass,
201
-
202
- materialAmbient: this.ambient,
203
- materialDiffuse: this.diffuse,
204
- materialSpecular: this.specular,
205
- materialShininess: this.shininess
206
- });
207
- manifest.set('VERTEX_POSITION', mesh.getVertexBuffer() || null);
208
- manifest.set('VERTEX_COLOR', mesh.getColorBuffer() || null);
209
- manifest.set('VERTEX_NORMAL', mesh.getNormalBuffer() || null);
210
- manifest.set('VERTEX_TEXCOORDS', mesh.getTextureCoordsBuffer() || null);
211
-
212
-
213
- this.setUniforms(context, mesh, options, manifest);
214
- this.setAttributes(context, mesh, options, manifest);
215
-
216
- for (var i = 0; i < this.layers.length; i++) {
217
- manifest.variable_prefix = this.layers[i].shader_variable_prefix;
218
- this.layers[i].setUniforms(context, mesh, options, manifest);
219
- this.layers[i].setAttributes(context, mesh, options, manifest);
220
- }
221
- },
222
-
223
- /**
224
- * Jax.Material#render(context, mesh) -> undefined
225
- * Renders the specified object to the specified context, using this material.
226
- *
227
- * This action will build and compile the shader for the given context if necessary.
228
- **/
229
- render: function(context, mesh, options) {
230
- this.lights = context.world.lighting._lights;
231
- this.light_count = context.world.lighting._lights.length;
232
-
233
- try {
234
- var shader = this.prepareShader(context);
235
-
236
- shader.render(context, mesh, this, options);
237
- } catch(error) {
238
- if (error instanceof RangeError) {
239
- // we've hit hardware limits. Back off a layer. If we are down to no layers, raise a coherent error.
240
- if (this.layers.length > 0) {
241
- this.adaptShaderToHardwareLimits(shader, error);
242
- this.render(context, mesh, options);
243
- }
244
- else throw error;
245
- }
246
- else throw error;
247
- }
248
- },
249
-
250
- adaptShaderToHardwareLimits: function(shader, error) {
251
- function log(msg) {
252
- if (window.console)
253
- console.log(msg);
254
- else
255
- setTimeout(function() { throw new Error(msg); }, 1);
256
- }
257
-
258
- log("WARNING: Hardware limits reached for material '"+this.getName()+"'! (original message: "+error+")");
259
-
260
- /*
261
- choose which shader(s) to remove. We know off the bat that we can remove any shaders which would
262
- push us over the threshold on their own (e.g. not combined with any except 'basic'), so let's remove
263
- those first.
264
- */
265
-
266
- var map = shader.getPerShaderInputMap(this);
267
-
268
- var uniformsRemaining = Jax.Shader.max_uniforms - map[this.getBaseShader()].uniforms.length;
269
- var varyingsRemaining = Jax.Shader.max_varyings - map[this.getBaseShader()].varyings.length;
270
- var attributesRemaining = Jax.Shader.max_attributes - map[this.getBaseShader()].attributes.length;
271
-
272
- // we'll use these to determine if we *still* need to pop at the end.
273
- var totalUniformsInUse = 0, totalVaryingsInUse = 0, totalAttributesInUse = 0;
274
-
275
- for (var i = 0; i < this.layers.length; i++) {
276
- var entry = map[this.layers[i].getBaseShader()];
277
-
278
- if (entry.uniforms.length > uniformsRemaining || entry.varyings.length > varyingsRemaining ||
279
- entry.attributes.length > attributesRemaining)
280
- {
281
- log("WARNING: Removing shader '"+this.layers[i].getName()+"' due to hardware limitations!");
282
- this.layers.splice(i, 1);
283
- i = 0;
284
- } else {
285
- totalUniformsInUse += entry.uniforms.length;
286
- totalVaryingsInUse += entry.varyings.length;
287
- totalAttributesInUse += entry.attributes.length;
288
- }
289
- }
290
-
291
- if (totalUniformsInUse > uniformsRemaining || totalVaryingsInUse > varyingsRemaining ||
292
- totalAttributesInUse > attributesRemaining)
293
- {
294
- log("WARNING: Removing shader '"+this.layers[this.layers.length-1].getName()+"' due to hardware limitations!");
295
- this.layers.pop();
296
- }
297
- },
298
-
299
- /**
300
- * Jax.Material#isChanged() -> Boolean
301
- * Returns true if this material's properties have been changed since
302
- * the last time its internal shader was compiled.
303
- **/
304
- isChanged: function() {
305
- if (!this.previous) return true;
306
-
307
- if (this.previous.subshaders.length != this.layers.length) return true;
308
-
309
- for (var i = 0; i < this.layers.length; i++)
310
- if (this.previous.subshaders[i] != this.layers[i].getName())
311
- return true;
312
-
313
- return false;
314
- }
315
- });
316
- })();
317
-
318
- Jax.Material.instances = {};
319
-
320
- /**
321
- * Jax.Material.find(name) -> Jax.Material
322
- * - name (String): the unique name of the material you're looking for
323
- *
324
- * Returns the instance of Jax.Material matching the specified name, or throws
325
- * an error if the material can't be found.
326
- **/
327
- Jax.Material.find = function(name) {
328
- var result;
329
- if (result = Jax.Material.instances[name])
330
- return result;
331
- throw new Error("Material {material:'"+name+"'} could not be found.");
332
- };
333
-
334
- /**
335
- * Jax.Material.create(name, options) -> Jax.Material
336
- * - name (String): the unique name of this material
337
- * - options (Object): a set of options to be passed to the material constructor
338
- *
339
- * Creates a material and adds it to the material registry. This way,
340
- * the material can be later retrieved using:
341
- *
342
- * var matr = Jax.Material.find(name);
343
- *
344
- * Note that unlike instances of Jax.Model, specifying a name for a material that
345
- * already exists will not raise an error. Instead, the previous material will be
346
- * replaced with a new material constructed using the new options. This allows you
347
- * to override Jax defaults like so:
348
- *
349
- * Jax.Material.create("default", {...});
350
- *
351
- **/
352
- Jax.Material.create = function(name, options) {
353
- options = Jax.Util.normalizeOptions(options, { name: name });
354
-
355
- var klass = Jax.Material;
356
- if (options.type) klass = klass[options.type];
357
-
358
- if (!klass) throw new Error("Material type '"+options.type+"' not found!");
359
- return Jax.Material.instances[name] = new klass(options);
360
- };
361
-
362
- /**
363
- * Jax.Material.all() -> Array
364
- *
365
- * Returns an array containing the names of all Materials currently registered
366
- * with Jax. Note that this does not include one-off materials created directly,
367
- * for example, using "new Jax.Material()".
368
- **/
369
- Jax.Material.all = function() {
370
- return Jax.Util.properties(Jax.Material.instances);
371
- };
372
-
373
- Jax.Material.addResources = function(resources) {
374
- for (var i in resources) {
375
- if (Jax.Material.instances[i]) throw new Error("Duplicate material resource ID: "+i);
376
- Jax.Material.create(i, resources[i]);
377
- }
378
- };
379
-
380
- //= require "../../../builtin/shaders/texture/material"
381
- //= require "../../../builtin/shaders/normal_map/material"
382
- //= require "../../../builtin/shaders/shadow_map/material"
383
- //= require "../../../builtin/shaders/depthmap/material"
384
- //= require "../../../builtin/shaders/paraboloid/material"
385
- //= require "../../../builtin/shaders/fog/material"
386
- //= require "../../../builtin/shaders/picking/material"
387
-
388
- Jax.Material.create("basic");
389
- Jax.Material.create("default", {default_shader:'basic'});
390
- Jax.Material.create("depthmap", {default_shader:"depthmap"});
391
- Jax.Material.create("paraboloid-depthmap", {type:"Paraboloid",default_shader:"paraboloid",layers:[{type:"Depthmap"}]});
392
- Jax.Material.create("picking", {type:"Picking"});