Deploying to gh-pages from @ sotrh/learn-wgpu@714ea27bc2 🚀

This commit is contained in:
sotrh 2022-12-10 19:33:10 +00:00
parent 8caccb9805
commit 87dc5f5fcb
112 changed files with 190 additions and 188 deletions

View File

@ -8,11 +8,11 @@
<meta name="description" content=""> <meta name="description" content="">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/37.4abf0071.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/14.ae52f492.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.143159cd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.deb3c0a2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/38.948c9159.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.656a9cc4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.31e0a434.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.831771f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
<div id="app" data-server-rendered="true"><div class="theme-container"><div class="theme-default-content"><h1>404</h1> <blockquote>There's nothing here.</blockquote> <a href="/learn-wgpu/" class="router-link-active">Take me home.</a></div></div><div class="global-ui"><!----></div></div> <div id="app" data-server-rendered="true"><div class="theme-container"><div class="theme-default-content"><h1>404</h1> <blockquote>How did we get here?</blockquote> <a href="/learn-wgpu/" class="router-link-active">Take me home.</a></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/37.4abf0071.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/38.948c9159.js" defer></script>
</body> </body>
</html> </html>

Binary file not shown.

1
assets/js/0.5a1994c5.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
assets/js/10.283e1aeb.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
assets/js/11.6c80f1a5.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
assets/js/12.fd765fd8.js Normal file

File diff suppressed because one or more lines are too long

1
assets/js/13.64e1abdd.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{420:function(t,r,e){var n=e(202),i=Math.floor,o=function(t,r){var e=t.length,c=i(e/2);return e<8?u(t,r):a(t,o(n(t,0,c),r),o(n(t,c),r),r)},u=function(t,r){for(var e,n,i=t.length,o=1;o<i;){for(n=o,e=t[o];n&&r(t[n-1],e)>0;)t[n]=t[--n];n!==o++&&(t[n]=e)}return t},a=function(t,r,e,n){for(var i=r.length,o=e.length,u=0,a=0;u<i||a<o;)t[u+a]=u<i&&a<o?n(r[u],e[a])<=0?r[u++]:e[a++]:u<i?r[u++]:e[a++];return t};t.exports=o},421:function(t,r,e){var n=e(43).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},422:function(t,r,e){var n=e(43);t.exports=/MSIE|Trident/.test(n)},423:function(t,r,e){var n=e(43).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},539:function(t,r,e){"use strict";var n=e(1),i=e(2),o=e(35),u=e(15),a=e(24),c=e(14),f=e(3),s=e(420),l=e(48),v=e(421),h=e(422),d=e(46),p=e(423),g=[],m=i(g.sort),w=i(g.push),b=f((function(){g.sort(void 0)})),k=f((function(){g.sort(null)})),D=l("sort"),x=!f((function(){if(d)return d<70;if(!(v&&v>3)){if(h)return!0;if(p)return p<603;var t,r,e,n,i="";for(t=65;t<76;t++){switch(r=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:e=3;break;case 68:case 71:e=4;break;default:e=2}for(n=0;n<47;n++)g.push({k:r+n,v:e})}for(g.sort((function(t,r){return r.v-t.v})),n=0;n<g.length;n++)r=g[n].k.charAt(0),i.charAt(i.length-1)!==r&&(i+=r);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:b||!k||!D||!x},{sort:function(t){void 0!==t&&o(t);var r=u(this);if(x)return void 0===t?m(r):m(r,t);var e,n,i=[],f=a(r);for(n=0;n<f;n++)n in r&&w(i,r[n]);for(s(i,function(t){return function(r,e){return void 0===e?-1:void 0===r?1:void 0!==t?+t(r,e)||0:c(r)>c(e)?1:-1}}(t)),e=i.length,n=0;n<e;)r[n]=i[n++];for(;n<f;)delete r[n++];return r}})},540:function(t,r,e){var n=e(2),i=e(16),o=Date.prototype,u=n(o.toString),a=n(o.getTime);"Invalid Date"!=String(new Date(NaN))&&i(o,"toString",(function(){var t=a(this);return t==t?u(this):"Invalid Date"}))},569:function(t,r,e){"use strict";e.r(r);e(61),e(539),e(38),e(8),e(214),e(215),e(540);var n={name:"RecentArticles",data:function(){return{}},computed:{recentFiles:function(){return this.$site.pages.filter((function(t){return t.regularPath.includes("beginner")||t.regularPath.includes("intermediate")})).sort((function(t,r){var e=new Date(t.frontmatter.published).getTime()-new Date(r.frontmatter.published).getTime();return e<0?-1:e>0?1:0})).slice(0,5)}}},i=e(23),o=Object(i.a)(n,(function(){var t=this,r=t.$createElement,e=t._self._c||r;return e("div",[e("ul",t._l(t.recentFiles,(function(r,n){return e("li",{key:r},[e("a",{attrs:{href:n.path}},[t._v(t._s(n.title))])])})),0)])}),[],!1,null,null,null);r.default=o.exports}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[18],{421:function(t,r,e){var n=e(202),i=Math.floor,o=function(t,r){var e=t.length,c=i(e/2);return e<8?u(t,r):a(t,o(n(t,0,c),r),o(n(t,c),r),r)},u=function(t,r){for(var e,n,i=t.length,o=1;o<i;){for(n=o,e=t[o];n&&r(t[n-1],e)>0;)t[n]=t[--n];n!==o++&&(t[n]=e)}return t},a=function(t,r,e,n){for(var i=r.length,o=e.length,u=0,a=0;u<i||a<o;)t[u+a]=u<i&&a<o?n(r[u],e[a])<=0?r[u++]:e[a++]:u<i?r[u++]:e[a++];return t};t.exports=o},422:function(t,r,e){var n=e(44).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},423:function(t,r,e){var n=e(44);t.exports=/MSIE|Trident/.test(n)},424:function(t,r,e){var n=e(44).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},541:function(t,r,e){"use strict";var n=e(1),i=e(2),o=e(35),u=e(15),a=e(24),c=e(14),f=e(3),s=e(421),l=e(49),v=e(422),h=e(423),d=e(47),p=e(424),g=[],m=i(g.sort),w=i(g.push),b=f((function(){g.sort(void 0)})),k=f((function(){g.sort(null)})),D=l("sort"),x=!f((function(){if(d)return d<70;if(!(v&&v>3)){if(h)return!0;if(p)return p<603;var t,r,e,n,i="";for(t=65;t<76;t++){switch(r=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:e=3;break;case 68:case 71:e=4;break;default:e=2}for(n=0;n<47;n++)g.push({k:r+n,v:e})}for(g.sort((function(t,r){return r.v-t.v})),n=0;n<g.length;n++)r=g[n].k.charAt(0),i.charAt(i.length-1)!==r&&(i+=r);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:b||!k||!D||!x},{sort:function(t){void 0!==t&&o(t);var r=u(this);if(x)return void 0===t?m(r):m(r,t);var e,n,i=[],f=a(r);for(n=0;n<f;n++)n in r&&w(i,r[n]);for(s(i,function(t){return function(r,e){return void 0===e?-1:void 0===r?1:void 0!==t?+t(r,e)||0:c(r)>c(e)?1:-1}}(t)),e=i.length,n=0;n<e;)r[n]=i[n++];for(;n<f;)delete r[n++];return r}})},542:function(t,r,e){var n=e(2),i=e(16),o=Date.prototype,u=n(o.toString),a=n(o.getTime);"Invalid Date"!=String(new Date(NaN))&&i(o,"toString",(function(){var t=a(this);return t==t?u(this):"Invalid Date"}))},572:function(t,r,e){"use strict";e.r(r);e(61),e(541),e(38),e(8),e(214),e(215),e(542);var n={name:"RecentArticles",data:function(){return{}},computed:{recentFiles:function(){return this.$site.pages.filter((function(t){return t.regularPath.includes("beginner")||t.regularPath.includes("intermediate")})).sort((function(t,r){var e=new Date(t.frontmatter.published).getTime()-new Date(r.frontmatter.published).getTime();return e<0?-1:e>0?1:0})).slice(0,5)}}},i=e(23),o=Object(i.a)(n,(function(){var t=this,r=t.$createElement,e=t._self._c||r;return e("div",[e("ul",t._l(t.recentFiles,(function(r,n){return e("li",{key:r},[e("a",{attrs:{href:n.path}},[t._v(t._s(n.title))])])})),0)])}),[],!1,null,null,null);r.default=o.exports}}]);

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{445:function(t,r,e){},541:function(t,r,e){"use strict";var a=e(1),n=e(2),o=e(32),i=e(64),u=e(14),s=n("".slice),l=Math.max,c=Math.min;a({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,r){var e,a,n=u(o(this)),_=n.length,m=i(t);return m===1/0&&(m=0),m<0&&(m=l(_+m,0)),(e=void 0===r?_:i(r))<=0||e===1/0||m>=(a=c(m+e,_))?"":s(n,m,a)}})},542:function(t,r,e){var a={"./tutorial10_lighting/tutorial10_lighting.js":[545,0,2,48],"./tutorial10_lighting/tutorial10_lighting_bg.js":[363,0,2],"./tutorial11_normals/tutorial11_normals.js":[556,0,3,49],"./tutorial11_normals/tutorial11_normals_bg.js":[364,0,3],"./tutorial12_camera/tutorial12_camera.js":[557,0,4,50],"./tutorial12_camera/tutorial12_camera_bg.js":[365,0,4],"./tutorial2_surface/tutorial2_surface.js":[558,0,6,51],"./tutorial2_surface/tutorial2_surface_bg.js":[373,0,6],"./tutorial3_pipeline/tutorial3_pipeline.js":[559,0,7,52],"./tutorial3_pipeline/tutorial3_pipeline_bg.js":[371,0,7],"./tutorial4_buffer/tutorial4_buffer.js":[560,0,8,53],"./tutorial4_buffer/tutorial4_buffer_bg.js":[372,0,8],"./tutorial5_textures/tutorial5_textures.js":[561,0,9,54],"./tutorial5_textures/tutorial5_textures_bg.js":[367,0,9],"./tutorial6_uniforms/tutorial6_uniforms.js":[562,0,10,55],"./tutorial6_uniforms/tutorial6_uniforms_bg.js":[368,0,10],"./tutorial7_instancing/tutorial7_instancing.js":[563,0,11,56],"./tutorial7_instancing/tutorial7_instancing_bg.js":[369,0,11],"./tutorial8_depth/tutorial8_depth.js":[564,0,12,57],"./tutorial8_depth/tutorial8_depth_bg.js":[370,0,12],"./tutorial9_models/tutorial9_models.js":[565,0,5,58],"./tutorial9_models/tutorial9_models_bg.js":[366,0,5]};function n(t){if(!e.o(a,t))return Promise.resolve().then((function(){var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}));var r=a[t],n=r[0];return Promise.all(r.slice(1).map(e.e)).then((function(){return e(n)}))}n.keys=function(){return Object.keys(a)},n.id=542,t.exports=n},543:function(t,r,e){"use strict";e(445)},570:function(t,r,e){"use strict";e.r(r);var a=e(87);e(135),e(29),e(93),e(541),e(8),e(18),e(25),e(123);var n={name:"WasmExample",props:{example:"",autoLoad:!1},data:function(){return{error:"",loading:!1,exampleStarted:!1}},computed:{exampleName:function(){return this.example.replace(/\w\S*/g,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))}},methods:{loadExample:function(){var t=this;return Object(a.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t.loading=!0,r.prev=1,r.next=4,e(542)("./".concat(t.example,"/").concat(t.example,".js"));case 4:r.next=9;break;case 6:r.prev=6,r.t0=r.catch(1),"Error: Using exceptions for control flow, don't mind me. This isn't actually an error!"!="".concat(r.t0)?(t.error='An error occurred loading "'.concat(t.example,'": ').concat(r.t0),console.error(r.t0),t.exampleStarted=!1):t.exampleStarted=!0;case 9:t.loading=!1;case 10:case"end":return r.stop()}}),r,null,[[1,6]])})))()}},mounted:function(){var t=this;return Object(a.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$nextTick();case 2:if(!t.autoLoad){r.next=5;break}return r.next=5,t.loadExample();case 5:case"end":return r.stop()}}),r)})))()}},o=(e(543),e(23)),i=Object(o.a)(n,(function(){var t=this,r=t.$createElement,e=t._self._c||r;return e("div",{attrs:{id:"wasm-example"}},[t.error?e("div",{staticClass:"error"},[t._v("\n "+t._s(t.error)+"\n ")]):t._e(),t._v(" "),t.exampleStarted||t.autoLoad?t._e():e("button",{attrs:{disabled:t.loading},on:{click:function(r){return t.loadExample()}}},[t._v("Try "+t._s(t.exampleName)+"!")])])}),[],!1,null,null,null);r.default=i.exports}}]);

1
assets/js/2.6b3360f8.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
assets/js/20.31e0a434.js Normal file
View File

@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{446:function(t,r,e){},543:function(t,r,e){"use strict";var a=e(1),o=e(2),n=e(32),i=e(65),u=e(14),l=o("".slice),s=Math.max,c=Math.min;a({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,r){var e,a,o=u(n(this)),_=o.length,m=i(t);return m===1/0&&(m=0),m<0&&(m=s(_+m,0)),(e=void 0===r?_:i(r))<=0||e===1/0||m>=(a=c(m+e,_))?"":l(o,m,a)}})},544:function(t,r,e){var a={"./tutorial10_lighting/tutorial10_lighting.js":[547,0,2,49],"./tutorial10_lighting/tutorial10_lighting_bg.js":[363,0,2],"./tutorial11_normals/tutorial11_normals.js":[558,0,3,50],"./tutorial11_normals/tutorial11_normals_bg.js":[364,0,3],"./tutorial12_camera/tutorial12_camera.js":[559,0,4,51],"./tutorial12_camera/tutorial12_camera_bg.js":[365,0,4],"./tutorial1_window/tutorial1_window.js":[560,0,13,52],"./tutorial1_window/tutorial1_window_bg.js":[374,0,13],"./tutorial2_surface/tutorial2_surface.js":[561,0,6,53],"./tutorial2_surface/tutorial2_surface_bg.js":[373,0,6],"./tutorial3_pipeline/tutorial3_pipeline.js":[562,0,7,54],"./tutorial3_pipeline/tutorial3_pipeline_bg.js":[371,0,7],"./tutorial4_buffer/tutorial4_buffer.js":[563,0,8,55],"./tutorial4_buffer/tutorial4_buffer_bg.js":[372,0,8],"./tutorial5_textures/tutorial5_textures.js":[564,0,9,56],"./tutorial5_textures/tutorial5_textures_bg.js":[367,0,9],"./tutorial6_uniforms/tutorial6_uniforms.js":[565,0,10,57],"./tutorial6_uniforms/tutorial6_uniforms_bg.js":[368,0,10],"./tutorial7_instancing/tutorial7_instancing.js":[566,0,11,58],"./tutorial7_instancing/tutorial7_instancing_bg.js":[369,0,11],"./tutorial8_depth/tutorial8_depth.js":[567,0,12,59],"./tutorial8_depth/tutorial8_depth_bg.js":[370,0,12],"./tutorial9_models/tutorial9_models.js":[568,0,5,60],"./tutorial9_models/tutorial9_models_bg.js":[366,0,5]};function o(t){if(!e.o(a,t))return Promise.resolve().then((function(){var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}));var r=a[t],o=r[0];return Promise.all(r.slice(1).map(e.e)).then((function(){return e(o)}))}o.keys=function(){return Object.keys(a)},o.id=544,t.exports=o},545:function(t,r,e){"use strict";e(446)},573:function(t,r,e){"use strict";e.r(r);var a=e(87);e(135),e(29),e(93),e(543),e(8),e(18),e(25),e(123);var o={name:"WasmExample",props:{example:"",autoLoad:!1},data:function(){return{error:"",loading:!1,exampleStarted:!1}},computed:{exampleName:function(){return this.example.replace(/\w\S*/g,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))}},methods:{loadExample:function(){var t=this;return Object(a.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return t.loading=!0,r.prev=1,r.next=4,e(544)("./".concat(t.example,"/").concat(t.example,".js"));case 4:r.next=9;break;case 6:r.prev=6,r.t0=r.catch(1),"Error: Using exceptions for control flow, don't mind me. This isn't actually an error!"!="".concat(r.t0)?(t.error='An error occurred loading "'.concat(t.example,'": ').concat(r.t0),console.error(r.t0),t.exampleStarted=!1):t.exampleStarted=!0;case 9:t.loading=!1;case 10:case"end":return r.stop()}}),r,null,[[1,6]])})))()}},mounted:function(){var t=this;return Object(a.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$nextTick();case 2:if(!t.autoLoad){r.next=5;break}return r.next=5,t.loadExample();case 5:case"end":return r.stop()}}),r)})))()}},n=(e(545),e(23)),i=Object(n.a)(o,(function(){var t=this,r=t.$createElement,e=t._self._c||r;return e("div",{attrs:{id:"wasm-example"}},[t.error?e("div",{staticClass:"error"},[t._v("\n "+t._s(t.error)+"\n ")]):t._e(),t._v(" "),t.exampleStarted||t.autoLoad?t._e():e("button",{attrs:{disabled:t.loading},on:{click:function(r){return t.loadExample()}}},[t._v("Try "+t._s(t.exampleName)+"!")])])}),[],!1,null,null,null);r.default=i.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{444:function(t,e,n){},538:function(t,e,n){"use strict";n(444)},568:function(t,e,n){"use strict";n.r(e);var i={name:"AutoGithubLink",computed:{link:function(){return"https://github.com/sotrh/learn-wgpu/tree/master/code"+this.$page.path}}},r=(n(538),n(23)),u=Object(r.a)(i,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"auto-github-link"},[e("a",{attrs:{href:this.link,target:"_blank",rel:"noopener noreferrer"}},[this._v("Check out the code!")]),this._v(" "),e("OutboundLink")],1)}),[],!1,null,null,null);e.default=u.exports}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[25],{445:function(t,e,n){},540:function(t,e,n){"use strict";n(445)},571:function(t,e,n){"use strict";n.r(e);var i={name:"AutoGithubLink",computed:{link:function(){return"https://github.com/sotrh/learn-wgpu/tree/master/code"+this.$page.path}}},r=(n(540),n(23)),u=Object(r.a)(i,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"auto-github-link"},[e("a",{attrs:{href:this.link,target:"_blank",rel:"noopener noreferrer"}},[this._v("Check out the code!")]),this._v(" "),e("OutboundLink")],1)}),[],!1,null,null,null);e.default=u.exports}}]);

View File

@ -1 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{446:function(t,e,n){},544:function(t,e,n){"use strict";n(446)},599:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}},r=(n(544),n(23)),a=Object(r.a)(i,void 0,void 0,!1,null,"86b323a0",null);e.default=a.exports}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[26],{447:function(t,e,n){},546:function(t,e,n){"use strict";n(447)},602:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}},r=(n(546),n(23)),a=Object(r.a)(i,void 0,void 0,!1,null,"86b323a0",null);e.default=a.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
assets/js/3.09f1398c.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{567:function(t,e,s){"use strict";s.r(e);var o=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],n={methods:{getMsg:function(){return o[Math.floor(Math.random()*o.length)]}}},i=s(23),h=Object(i.a)(n,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"theme-container"},[e("div",{staticClass:"theme-default-content"},[e("h1",[this._v("404")]),this._v(" "),e("blockquote",[this._v(this._s(this.getMsg()))]),this._v(" "),e("router-link",{attrs:{to:"/"}},[this._v("Take me home.")])],1)])}),[],!1,null,null,null);e.default=h.exports}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[38],{570:function(t,e,s){"use strict";s.r(e);var o=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],n={methods:{getMsg:function(){return o[Math.floor(Math.random()*o.length)]}}},i=s(23),h=Object(i.a)(n,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"theme-container"},[e("div",{staticClass:"theme-default-content"},[e("h1",[this._v("404")]),this._v(" "),e("blockquote",[this._v(this._s(this.getMsg()))]),this._v(" "),e("router-link",{attrs:{to:"/"}},[this._v("Take me home.")])],1)])}),[],!1,null,null,null);e.default=h.exports}}]);

View File

@ -1 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{571:function(t,e,a){"use strict";a.r(e);var r=a(23),n=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("h2",{attrs:{id:"what-is-wgpu"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#what-is-wgpu"}},[t._v("#")]),t._v(" What is wgpu?")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/gfx-rs/wgpu",target:"_blank",rel:"noopener noreferrer"}},[t._v("Wgpu"),a("OutboundLink")],1),t._v(" is a Rust implementation of the "),a("a",{attrs:{href:"https://gpuweb.github.io/gpuweb/",target:"_blank",rel:"noopener noreferrer"}},[t._v("WebGPU API spec"),a("OutboundLink")],1),t._v(". WebGPU is a specification published by the GPU for the Web Community Group. It aims to allow web code access to GPU functions in a safe and reliable manner. It does this by mimicking the Vulkan API, and translating that down to whatever API the host hardware is using (ie. DirectX, Metal, Vulkan).")]),t._v(" "),a("p",[t._v("Wgpu is still in development, so some of this doc is subject to change.")]),t._v(" "),a("h2",{attrs:{id:"why-rust"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#why-rust"}},[t._v("#")]),t._v(" Why Rust?")]),t._v(" "),a("p",[t._v("Wgpu actually has C bindings to allow you to write C/C++ code with it, as well as use other languages that interface with C. That being said, wgpu is written in Rust, and it has some convenient Rust bindings that don't have to jump through any hoops. On top of that, I've been enjoying writing in Rust.")]),t._v(" "),a("p",[t._v("You should be fairly familiar with Rust before using this tutorial as I won't go into much detail on Rust syntax. If you're not super comfortable with Rust you can review the "),a("a",{attrs:{href:"https://www.rust-lang.org/learn",target:"_blank",rel:"noopener noreferrer"}},[t._v("Rust tutorial"),a("OutboundLink")],1),t._v(". You should also be familiar with "),a("a",{attrs:{href:"https://doc.rust-lang.org/cargo/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Cargo"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("I'm using this project to learn wgpu myself, so I might miss some important details, or explain things badly. I'm always open to constructive feedback.")]),t._v(" "),a("h2",{attrs:{id:"contribution-and-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#contribution-and-support"}},[t._v("#")]),t._v(" Contribution and Support")]),t._v(" "),a("ul",[a("li",[t._v("I accept pull requests ("),a("a",{attrs:{href:"https://github.com/sotrh/learn-wgpu",target:"_blank",rel:"noopener noreferrer"}},[t._v("GitHub repo"),a("OutboundLink")],1),t._v(") for fixing issues with this tutorial such as typos, incorrect information, and other inconsistencies.")]),t._v(" "),a("li",[t._v("Due to wgpu's rapidly changing api, I'm not accepting any new pull requests for showcase demos.")]),t._v(" "),a("li",[t._v("If you want to support me directly, check out my "),a("a",{attrs:{href:"https://www.patreon.com/sotrh",target:"_blank",rel:"noopener noreferrer"}},[t._v("patreon"),a("OutboundLink")],1),t._v("!")])]),t._v(" "),a("h2",{attrs:{id:"translations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#translations"}},[t._v("#")]),t._v(" Translations")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://jinleili.github.io/learn-wgpu-zh/",target:"_blank",rel:"noopener noreferrer"}},[t._v("中文版: 增加了与 App 的集成与调试系列章节"),a("OutboundLink")],1)])]),t._v(" "),a("h2",{attrs:{id:"special-thanks-to-these-patrons"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#special-thanks-to-these-patrons"}},[t._v("#")]),t._v(" Special thanks to these patrons!")]),t._v(" "),a("ul",[a("li",[t._v("David Laban")]),t._v(" "),a("li",[t._v("Gunstein Vatnar")]),t._v(" "),a("li",[t._v("Lennart")]),t._v(" "),a("li",[t._v("Ian Gowen")]),t._v(" "),a("li",[t._v("Aron Granberg")]),t._v(" "),a("li",[t._v("Bernard Llanos")]),t._v(" "),a("li",[t._v("Jan Šipr")]),t._v(" "),a("li",[t._v("Zeh Fernando")]),t._v(" "),a("li",[t._v("Felix")]),t._v(" "),a("li",[t._v("Youngsuk Kim")]),t._v(" "),a("li",[t._v("オリトイツキ")]),t._v(" "),a("li",[t._v("Andrea Postal")]),t._v(" "),a("li",[t._v("charlesk")])])])}),[],!1,null,null,null);e.default=n.exports}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[39],{574:function(t,e,a){"use strict";a.r(e);var r=a(23),n=Object(r.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"introduction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),a("h2",{attrs:{id:"what-is-wgpu"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#what-is-wgpu"}},[t._v("#")]),t._v(" What is wgpu?")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/gfx-rs/wgpu",target:"_blank",rel:"noopener noreferrer"}},[t._v("Wgpu"),a("OutboundLink")],1),t._v(" is a Rust implementation of the "),a("a",{attrs:{href:"https://gpuweb.github.io/gpuweb/",target:"_blank",rel:"noopener noreferrer"}},[t._v("WebGPU API spec"),a("OutboundLink")],1),t._v(". WebGPU is a specification published by the GPU for the Web Community Group. It aims to allow web code access to GPU functions in a safe and reliable manner. It does this by mimicking the Vulkan API, and translating that down to whatever API the host hardware is using (ie. DirectX, Metal, Vulkan).")]),t._v(" "),a("p",[t._v("Wgpu is still in development, so some of this doc is subject to change.")]),t._v(" "),a("h2",{attrs:{id:"why-rust"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#why-rust"}},[t._v("#")]),t._v(" Why Rust?")]),t._v(" "),a("p",[t._v("Wgpu actually has C bindings to allow you to write C/C++ code with it, as well as use other languages that interface with C. That being said, wgpu is written in Rust, and it has some convenient Rust bindings that don't have to jump through any hoops. On top of that, I've been enjoying writing in Rust.")]),t._v(" "),a("p",[t._v("You should be fairly familiar with Rust before using this tutorial as I won't go into much detail on Rust syntax. If you're not super comfortable with Rust you can review the "),a("a",{attrs:{href:"https://www.rust-lang.org/learn",target:"_blank",rel:"noopener noreferrer"}},[t._v("Rust tutorial"),a("OutboundLink")],1),t._v(". You should also be familiar with "),a("a",{attrs:{href:"https://doc.rust-lang.org/cargo/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Cargo"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("p",[t._v("I'm using this project to learn wgpu myself, so I might miss some important details, or explain things badly. I'm always open to constructive feedback.")]),t._v(" "),a("h2",{attrs:{id:"contribution-and-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#contribution-and-support"}},[t._v("#")]),t._v(" Contribution and Support")]),t._v(" "),a("ul",[a("li",[t._v("I accept pull requests ("),a("a",{attrs:{href:"https://github.com/sotrh/learn-wgpu",target:"_blank",rel:"noopener noreferrer"}},[t._v("GitHub repo"),a("OutboundLink")],1),t._v(") for fixing issues with this tutorial such as typos, incorrect information, and other inconsistencies.")]),t._v(" "),a("li",[t._v("Due to wgpu's rapidly changing api, I'm not accepting any new pull requests for showcase demos.")]),t._v(" "),a("li",[t._v("If you want to support me directly, check out my "),a("a",{attrs:{href:"https://www.patreon.com/sotrh",target:"_blank",rel:"noopener noreferrer"}},[t._v("patreon"),a("OutboundLink")],1),t._v("!")])]),t._v(" "),a("h2",{attrs:{id:"translations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#translations"}},[t._v("#")]),t._v(" Translations")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://jinleili.github.io/learn-wgpu-zh/",target:"_blank",rel:"noopener noreferrer"}},[t._v("中文版: 增加了与 App 的集成与调试系列章节"),a("OutboundLink")],1)])]),t._v(" "),a("h2",{attrs:{id:"special-thanks-to-these-patrons"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#special-thanks-to-these-patrons"}},[t._v("#")]),t._v(" Special thanks to these patrons!")]),t._v(" "),a("ul",[a("li",[t._v("David Laban")]),t._v(" "),a("li",[t._v("Gunstein Vatnar")]),t._v(" "),a("li",[t._v("Lennart")]),t._v(" "),a("li",[t._v("Ian Gowen")]),t._v(" "),a("li",[t._v("Aron Granberg")]),t._v(" "),a("li",[t._v("Bernard Llanos")]),t._v(" "),a("li",[t._v("Jan Šipr")]),t._v(" "),a("li",[t._v("Zeh Fernando")]),t._v(" "),a("li",[t._v("Felix")]),t._v(" "),a("li",[t._v("Youngsuk Kim")]),t._v(" "),a("li",[t._v("オリトイツキ")]),t._v(" "),a("li",[t._v("Andrea Postal")]),t._v(" "),a("li",[t._v("charlesk")])])])}),[],!1,null,null,null);e.default=n.exports}}]);

1
assets/js/4.a7a39244.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{581:function(t,s,e){"use strict";e.r(s);var i=e(23),n=Object(i.a)({},(function(){var t=this.$createElement,s=this._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[s("h1",{attrs:{id:"sources"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sources"}},[this._v("#")]),this._v(" Sources")]),this._v(" "),s("ul",[s("li",[this._v("https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-shading/diffuse-lambertian-shading")]),this._v(" "),s("li",[this._v("http://jimmiejohnsson84.me/pages/rendering_pbr.html")])])])}),[],!1,null,null,null);s.default=n.exports}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[41],{584:function(t,s,e){"use strict";e.r(s);var i=e(23),n=Object(i.a)({},(function(){var t=this.$createElement,s=this._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[s("h1",{attrs:{id:"sources"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sources"}},[this._v("#")]),this._v(" Sources")]),this._v(" "),s("ul",[s("li",[this._v("https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-shading/diffuse-lambertian-shading")]),this._v(" "),s("li",[this._v("http://jimmiejohnsson84.me/pages/rendering_pbr.html")])])])}),[],!1,null,null,null);s.default=n.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{590:function(e,t,o){"use strict";o.r(t);var s=o(23),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"foreword"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#foreword"}},[e._v("#")]),e._v(" Foreword")]),e._v(" "),o("p",[e._v("The articles in this section are not meant to be tutorials. They are showcases of the various things you can do with "),o("code",[e._v("wgpu")]),e._v(". I won't go over the specifics of creating "),o("code",[e._v("wgpu")]),e._v(" resources, as those will be covered elsewhere. The code for these examples is still available however and will be accessible on Github.")])])}),[],!1,null,null,null);t.default=r.exports}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[45],{593:function(e,t,o){"use strict";o.r(t);var s=o(23),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[o("h1",{attrs:{id:"foreword"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#foreword"}},[e._v("#")]),e._v(" Foreword")]),e._v(" "),o("p",[e._v("The articles in this section are not meant to be tutorials. They are showcases of the various things you can do with "),o("code",[e._v("wgpu")]),e._v(". I won't go over the specifics of creating "),o("code",[e._v("wgpu")]),e._v(" resources, as those will be covered elsewhere. The code for these examples is still available however and will be accessible on Github.")])])}),[],!1,null,null,null);t.default=r.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{598:function(t,s,n){"use strict";n.r(s);var e=n(23),o=Object(e.a)({},(function(){var t=this.$createElement,s=this._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[s("h1",{attrs:{id:"coming-soon"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#coming-soon"}},[this._v("#")]),this._v(" Coming Soon!")]),this._v(" "),s("p",[this._v("This section has not yet been completed.")])])}),[],!1,null,null,null);s.default=o.exports}}]); (window.webpackJsonp=window.webpackJsonp||[]).push([[48],{601:function(t,s,n){"use strict";n.r(s);var e=n(23),o=Object(e.a)({},(function(){var t=this.$createElement,s=this._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[s("h1",{attrs:{id:"coming-soon"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#coming-soon"}},[this._v("#")]),this._v(" Coming Soon!")]),this._v(" "),s("p",[this._v("This section has not yet been completed.")])])}),[],!1,null,null,null);s.default=o.exports}}]);

File diff suppressed because one or more lines are too long

1
assets/js/5.62e47561.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
assets/js/52.bf5dee59.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
assets/js/9.d82998a2.js Normal file

File diff suppressed because one or more lines are too long

15
assets/js/app.2aa001d7.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Dependencies and the window"> <meta property="og:title" content="Dependencies and the window">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/39.4aa63fe8.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/40.d38c5ac2.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -150,7 +150,7 @@ I won't get into the specifics of wasm-bindgen, so if you need a primer (or just
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">&gt;</span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>body</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">&gt;</span></span> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>html</span><span class="token punctuation">&gt;</span></span>
</code></pre></div></div> <p>Press the button below and you will see the code running!</p> <div id="wasm-example"><!----> <button>Try Tutorial1_window!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial1-window/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div></div> <p>Press the button below and you will see the code running!</p> <div id="wasm-example"><!----> <button>Try Tutorial1_window!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial1-window/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/" class="prev router-link-active"> <a href="/learn-wgpu/" class="prev router-link-active">
Introduction Introduction
@ -159,6 +159,6 @@ I won't get into the specifics of wasm-bindgen, so if you need a primer (or just
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/39.4aa63fe8.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/40.d38c5ac2.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="The Surface"> <meta property="og:title" content="The Surface">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/26.4f737487.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/27.01d55187.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -289,7 +289,7 @@ event_loop<span class="token punctuation">.</span><span class="token function">r
store<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> store<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
</code></pre></div><p>The <code>RenderPassColorAttachment</code> has the <code>view</code> field which informs <code>wgpu</code> what texture to save the colors to. In this case we specify the <code>view</code> that we created using <code>surface.get_current_texture()</code>. This means that any colors we draw to this attachment will get drawn to the screen.</p> <p>The <code>resolve_target</code> is the texture that will receive the resolved output. This will be the same as <code>view</code> unless multisampling is enabled. We don't need to specify this, so we leave it as <code>None</code>.</p> <p>The <code>ops</code> field takes a <code>wpgu::Operations</code> object. This tells wgpu what to do with the colors on the screen (specified by <code>view</code>). The <code>load</code> field tells wgpu how to handle colors stored from the previous frame. Currently, we are clearing the screen with a bluish color. The <code>store</code> field tells wgpu whether we want to store the rendered results to the <code>Texture</code> behind our <code>TextureView</code> (in this case it's the <code>SurfaceTexture</code>). We use <code>true</code> as we do want to store our render results.</p> <div class="note"><p>It's not uncommon to not clear the screen if the screen is going to be completely covered up with objects. If your scene doesn't cover the entire screen however you can end up with something like this.</p> <p><img src="/learn-wgpu/assets/img/no-clear.753f913f.png" alt="./no-clear.png"></p></div> <h2 id="validation-errors"><a href="#validation-errors" class="header-anchor">#</a> Validation Errors?</h2> <p>If wgpu is using Vulkan on your machine, you may run into validation errors if you are running an older version of the Vulkan SDK. You should be using at least version <code>1.2.182</code> as older versions can give out some false positives. If errors persist, you may have encountered a bug in wgpu. You can post an issue at <a href="https://github.com/gfx-rs/wgpu" target="_blank" rel="noopener noreferrer">https://github.com/gfx-rs/wgpu<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Modify the <code>input()</code> method to capture mouse events, and update the clear color using that. <em>Hint: you'll probably need to use <code>WindowEvent::CursorMoved</code></em>.</p> <div id="wasm-example"><!----> <button>Try Tutorial2_surface!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial2-surface/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><p>The <code>RenderPassColorAttachment</code> has the <code>view</code> field which informs <code>wgpu</code> what texture to save the colors to. In this case we specify the <code>view</code> that we created using <code>surface.get_current_texture()</code>. This means that any colors we draw to this attachment will get drawn to the screen.</p> <p>The <code>resolve_target</code> is the texture that will receive the resolved output. This will be the same as <code>view</code> unless multisampling is enabled. We don't need to specify this, so we leave it as <code>None</code>.</p> <p>The <code>ops</code> field takes a <code>wpgu::Operations</code> object. This tells wgpu what to do with the colors on the screen (specified by <code>view</code>). The <code>load</code> field tells wgpu how to handle colors stored from the previous frame. Currently, we are clearing the screen with a bluish color. The <code>store</code> field tells wgpu whether we want to store the rendered results to the <code>Texture</code> behind our <code>TextureView</code> (in this case it's the <code>SurfaceTexture</code>). We use <code>true</code> as we do want to store our render results.</p> <div class="note"><p>It's not uncommon to not clear the screen if the screen is going to be completely covered up with objects. If your scene doesn't cover the entire screen however you can end up with something like this.</p> <p><img src="/learn-wgpu/assets/img/no-clear.753f913f.png" alt="./no-clear.png"></p></div> <h2 id="validation-errors"><a href="#validation-errors" class="header-anchor">#</a> Validation Errors?</h2> <p>If wgpu is using Vulkan on your machine, you may run into validation errors if you are running an older version of the Vulkan SDK. You should be using at least version <code>1.2.182</code> as older versions can give out some false positives. If errors persist, you may have encountered a bug in wgpu. You can post an issue at <a href="https://github.com/gfx-rs/wgpu" target="_blank" rel="noopener noreferrer">https://github.com/gfx-rs/wgpu<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Modify the <code>input()</code> method to capture mouse events, and update the clear color using that. <em>Hint: you'll probably need to use <code>WindowEvent::CursorMoved</code></em>.</p> <div id="wasm-example"><!----> <button>Try Tutorial2_surface!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial2-surface/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/beginner/tutorial1-window/" class="prev"> <a href="/learn-wgpu/beginner/tutorial1-window/" class="prev">
Dependencies and the window Dependencies and the window
@ -298,6 +298,6 @@ event_loop<span class="token punctuation">.</span><span class="token function">r
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/26.4f737487.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/27.01d55187.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Textures and bind groups"> <meta property="og:title" content="Textures and bind groups">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/18.76b2811f.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.067373fa.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -406,7 +406,7 @@ fn fs_main(in: VertexOutput) -&gt; @location(0) vec4&lt;f32&gt; {
<span class="token punctuation">}</span> <span class="token punctuation">}</span>
<span class="token punctuation">}</span> <span class="token punctuation">}</span>
<span class="token punctuation">}</span> <span class="token punctuation">}</span>
</code></pre></div><p>Phew!</p> <p>With these changes in place, the code should be working the same as it was before, but we now have a much easier way to create textures.</p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Create another texture and swap it out when you press the space key.</p> <div id="wasm-example"><!----> <button>Try Tutorial5_textures!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial5-textures/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><p>Phew!</p> <p>With these changes in place, the code should be working the same as it was before, but we now have a much easier way to create textures.</p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Create another texture and swap it out when you press the space key.</p> <div id="wasm-example"><!----> <button>Try Tutorial5_textures!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial5-textures/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/beginner/tutorial4-buffer/" class="prev"> <a href="/learn-wgpu/beginner/tutorial4-buffer/" class="prev">
Buffers and Indices Buffers and Indices
@ -415,6 +415,6 @@ fn fs_main(in: VertexOutput) -&gt; @location(0) vec4&lt;f32&gt; {
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/18.76b2811f.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/19.067373fa.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Uniform buffers and a 3d camera"> <meta property="og:title" content="Uniform buffers and a 3d camera">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/30.c1f8fead.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/31.2cc77589.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -319,7 +319,7 @@ fn vs_main(
<span class="token keyword">self</span><span class="token punctuation">.</span>camera_uniform<span class="token punctuation">.</span><span class="token function">update_view_proj</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">self</span><span class="token punctuation">.</span>camera_uniform<span class="token punctuation">.</span><span class="token function">update_view_proj</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">self</span><span class="token punctuation">.</span>queue<span class="token punctuation">.</span><span class="token function">write_buffer</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera_buffer<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token namespace">bytemuck<span class="token punctuation">::</span></span><span class="token function">cast_slice</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token punctuation">[</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera_uniform<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">self</span><span class="token punctuation">.</span>queue<span class="token punctuation">.</span><span class="token function">write_buffer</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera_buffer<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token namespace">bytemuck<span class="token punctuation">::</span></span><span class="token function">cast_slice</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token punctuation">[</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera_uniform<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span> <span class="token punctuation">}</span>
</code></pre></div><p>That's all we need to do. If you run the code now you should see a pentagon with our tree texture that you can rotate around and zoom into with the wasd/arrow keys.</p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Have our model rotate on its own independently of the camera. <em>Hint: you'll need another matrix for this.</em></p> <div id="wasm-example"><!----> <button>Try Tutorial6_uniforms!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial6-uniforms/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><p>That's all we need to do. If you run the code now you should see a pentagon with our tree texture that you can rotate around and zoom into with the wasd/arrow keys.</p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Have our model rotate on its own independently of the camera. <em>Hint: you'll need another matrix for this.</em></p> <div id="wasm-example"><!----> <button>Try Tutorial6_uniforms!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial6-uniforms/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/beginner/tutorial5-textures/" class="prev"> <a href="/learn-wgpu/beginner/tutorial5-textures/" class="prev">
Textures and bind groups Textures and bind groups
@ -328,6 +328,6 @@ fn vs_main(
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/30.c1f8fead.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/31.2cc77589.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Instancing"> <meta property="og:title" content="Instancing">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/31.8e0bd3aa.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/32.946ceeb1.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -183,7 +183,7 @@ fn vs_main(
out.clip_position = camera.view_proj * model_matrix * vec4&lt;f32&gt;(model.position, 1.0); out.clip_position = camera.view_proj * model_matrix * vec4&lt;f32&gt;(model.position, 1.0);
return out; return out;
} }
</code></pre></div><p>With all that done, we should have a forest of trees!</p> <p><img src="/learn-wgpu/assets/img/forest.5c5cf3ad.png" alt="./forest.png"></p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Modify the position and/or rotation of the instances every frame.</p> <div id="wasm-example"><!----> <button>Try Tutorial7_instancing!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial7-instancing/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><p>With all that done, we should have a forest of trees!</p> <p><img src="/learn-wgpu/assets/img/forest.5c5cf3ad.png" alt="./forest.png"></p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Modify the position and/or rotation of the instances every frame.</p> <div id="wasm-example"><!----> <button>Try Tutorial7_instancing!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial7-instancing/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/beginner/tutorial6-uniforms/" class="prev"> <a href="/learn-wgpu/beginner/tutorial6-uniforms/" class="prev">
Uniform buffers and a 3d camera Uniform buffers and a 3d camera
@ -192,6 +192,6 @@ fn vs_main(
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/31.8e0bd3aa.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/32.946ceeb1.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="The Depth Buffer"> <meta property="og:title" content="The Depth Buffer">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/28.f884a3be.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/29.5ead4d92.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -111,7 +111,7 @@ depth_texture<span class="token punctuation">,</span>
stencil_ops<span class="token punctuation">:</span> <span class="token class-name">None</span><span class="token punctuation">,</span> stencil_ops<span class="token punctuation">:</span> <span class="token class-name">None</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><p>And that's all we have to do! No shader code needed! If you run the application, the depth issues will be fixed.</p> <p><img src="/learn-wgpu/assets/img/forest_fixed.a77f70f6.png" alt="forest_fixed.png"></p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Since the depth buffer is a texture, we can sample it in the shader. Because it's a depth texture, we'll have to use the <code>sampler_comparison</code> uniform type and the <code>textureSampleCompare</code> function instead of <code>sampler</code>, and <code>sampler2D</code> respectively. Create a bind group for the depth texture (or reuse an existing one), and render it to the screen.</p> <div id="wasm-example"><!----> <button>Try Tutorial8_depth!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial8-depth/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><p>And that's all we have to do! No shader code needed! If you run the application, the depth issues will be fixed.</p> <p><img src="/learn-wgpu/assets/img/forest_fixed.a77f70f6.png" alt="forest_fixed.png"></p> <h2 id="challenge"><a href="#challenge" class="header-anchor">#</a> Challenge</h2> <p>Since the depth buffer is a texture, we can sample it in the shader. Because it's a depth texture, we'll have to use the <code>sampler_comparison</code> uniform type and the <code>textureSampleCompare</code> function instead of <code>sampler</code>, and <code>sampler2D</code> respectively. Create a bind group for the depth texture (or reuse an existing one), and render it to the screen.</p> <div id="wasm-example"><!----> <button>Try Tutorial8_depth!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial8-depth/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/beginner/tutorial7-instancing/" class="prev"> <a href="/learn-wgpu/beginner/tutorial7-instancing/" class="prev">
Instancing Instancing
@ -120,6 +120,6 @@ depth_texture<span class="token punctuation">,</span>
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/28.f884a3be.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/29.5ead4d92.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Model Loading"> <meta property="og:title" content="Model Loading">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/23.a1c19e16.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.38da801a.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -424,7 +424,7 @@ render_pass<span class="token punctuation">.</span><span class="token function">
</code></pre></div><p>The code in <code>lib.rs</code> will change accordingly.</p> <div class="language-rust extra-class"><pre class="language-rust"><code>render_pass<span class="token punctuation">.</span><span class="token function">set_vertex_buffer</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token keyword">self</span><span class="token punctuation">.</span>instance_buffer<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span><span class="token punctuation">..</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> </code></pre></div><p>The code in <code>lib.rs</code> will change accordingly.</p> <div class="language-rust extra-class"><pre class="language-rust"><code>render_pass<span class="token punctuation">.</span><span class="token function">set_vertex_buffer</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token keyword">self</span><span class="token punctuation">.</span>instance_buffer<span class="token punctuation">.</span><span class="token function">slice</span><span class="token punctuation">(</span><span class="token punctuation">..</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
render_pass<span class="token punctuation">.</span><span class="token function">set_pipeline</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>render_pipeline<span class="token punctuation">)</span><span class="token punctuation">;</span> render_pass<span class="token punctuation">.</span><span class="token function">set_pipeline</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>render_pipeline<span class="token punctuation">)</span><span class="token punctuation">;</span>
render_pass<span class="token punctuation">.</span><span class="token function">draw_model_instanced</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>obj_model<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">..</span><span class="token keyword">self</span><span class="token punctuation">.</span>instances<span class="token punctuation">.</span><span class="token function">len</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">as</span> <span class="token keyword">u32</span><span class="token punctuation">,</span> <span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera_bind_group<span class="token punctuation">)</span><span class="token punctuation">;</span> render_pass<span class="token punctuation">.</span><span class="token function">draw_model_instanced</span><span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>obj_model<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">..</span><span class="token keyword">self</span><span class="token punctuation">.</span>instances<span class="token punctuation">.</span><span class="token function">len</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">as</span> <span class="token keyword">u32</span><span class="token punctuation">,</span> <span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera_bind_group<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><div id="wasm-example"><!----> <button>Try Tutorial9_models!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial9-models/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><div id="wasm-example"><!----> <button>Try Tutorial9_models!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/beginner/tutorial9-models/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/beginner/tutorial8-depth/" class="prev"> <a href="/learn-wgpu/beginner/tutorial8-depth/" class="prev">
The Depth Buffer The Depth Buffer
@ -433,6 +433,6 @@ render_pass<span class="token punctuation">.</span><span class="token function">
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/23.a1c19e16.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/24.38da801a.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Sources"> <meta property="og:title" content="Sources">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,11 +19,11 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/40.8f1c5e70.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.143159cd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.deb3c0a2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/41.9da478f5.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.31e0a434.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.831771f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="inner"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/learn-wgpu/" class="home-link router-link-active"><!----> <span class="site-name">Learn Wgpu</span></a> <div class="links"><!----> <div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div></div></div></header> <div class="sidebar-mask"></div> <div class="docs-layout"><aside class="sidebar"><!----> <ul class="sidebar-links"><li><a href="/learn-wgpu/" aria-current="page" class="sidebar-link">Introduction</a></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Beginner</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/learn-wgpu/beginner/tutorial1-window/" class="sidebar-link">Dependencies and the window</a></li><li><a href="/learn-wgpu/beginner/tutorial2-surface/" class="sidebar-link">The Surface</a></li><li><a href="/learn-wgpu/beginner/tutorial3-pipeline/" class="sidebar-link">The Pipeline</a></li><li><a href="/learn-wgpu/beginner/tutorial4-buffer/" class="sidebar-link">Buffers and Indices</a></li><li><a href="/learn-wgpu/beginner/tutorial5-textures/" class="sidebar-link">Textures and bind groups</a></li><li><a href="/learn-wgpu/beginner/tutorial6-uniforms/" class="sidebar-link">Uniform buffers and a 3d camera</a></li><li><a href="/learn-wgpu/beginner/tutorial7-instancing/" class="sidebar-link">Instancing</a></li><li><a href="/learn-wgpu/beginner/tutorial8-depth/" class="sidebar-link">The Depth Buffer</a></li><li><a href="/learn-wgpu/beginner/tutorial9-models/" class="sidebar-link">Model Loading</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Intermediate</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/learn-wgpu/intermediate/tutorial10-lighting/" class="sidebar-link">Working with Lights</a></li><li><a href="/learn-wgpu/intermediate/tutorial11-normals/" class="sidebar-link">Normal Mapping</a></li><li><a href="/learn-wgpu/intermediate/tutorial12-camera/" class="sidebar-link">A Better Camera</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Showcase</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>News</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="sources"><a href="#sources" class="header-anchor">#</a> Sources</h1> <ul><li>https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-shading/diffuse-lambertian-shading</li> <li>http://jimmiejohnsson84.me/pages/rendering_pbr.html</li></ul></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <!----> </main></div></div><div class="global-ui"><!----></div></div> <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="inner"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/learn-wgpu/" class="home-link router-link-active"><!----> <span class="site-name">Learn Wgpu</span></a> <div class="links"><!----> <div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div></div></div></header> <div class="sidebar-mask"></div> <div class="docs-layout"><aside class="sidebar"><!----> <ul class="sidebar-links"><li><a href="/learn-wgpu/" aria-current="page" class="sidebar-link">Introduction</a></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Beginner</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/learn-wgpu/beginner/tutorial1-window/" class="sidebar-link">Dependencies and the window</a></li><li><a href="/learn-wgpu/beginner/tutorial2-surface/" class="sidebar-link">The Surface</a></li><li><a href="/learn-wgpu/beginner/tutorial3-pipeline/" class="sidebar-link">The Pipeline</a></li><li><a href="/learn-wgpu/beginner/tutorial4-buffer/" class="sidebar-link">Buffers and Indices</a></li><li><a href="/learn-wgpu/beginner/tutorial5-textures/" class="sidebar-link">Textures and bind groups</a></li><li><a href="/learn-wgpu/beginner/tutorial6-uniforms/" class="sidebar-link">Uniform buffers and a 3d camera</a></li><li><a href="/learn-wgpu/beginner/tutorial7-instancing/" class="sidebar-link">Instancing</a></li><li><a href="/learn-wgpu/beginner/tutorial8-depth/" class="sidebar-link">The Depth Buffer</a></li><li><a href="/learn-wgpu/beginner/tutorial9-models/" class="sidebar-link">Model Loading</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Intermediate</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/learn-wgpu/intermediate/tutorial10-lighting/" class="sidebar-link">Working with Lights</a></li><li><a href="/learn-wgpu/intermediate/tutorial11-normals/" class="sidebar-link">Normal Mapping</a></li><li><a href="/learn-wgpu/intermediate/tutorial12-camera/" class="sidebar-link">A Better Camera</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Showcase</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>News</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="sources"><a href="#sources" class="header-anchor">#</a> Sources</h1> <ul><li>https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-shading/diffuse-lambertian-shading</li> <li>http://jimmiejohnsson84.me/pages/rendering_pbr.html</li></ul></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <!----> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/40.8f1c5e70.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/41.9da478f5.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Working with Lights"> <meta property="og:title" content="Working with Lights">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.84e6424a.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/16.944ff32f.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -640,7 +640,7 @@ let specular_color = specular_strength * light.color;
let half_dir = normalize(view_dir + light_dir); let half_dir = normalize(view_dir + light_dir);
let specular_strength = pow(max(dot(in.world_normal, half_dir), 0.0), 32.0); let specular_strength = pow(max(dot(in.world_normal, half_dir), 0.0), 32.0);
</code></pre></div><p>It's hard to tell the difference, but here are the results.</p> <p><img src="/learn-wgpu/assets/img/half_dir.bbcc23b8.png" alt="./half_dir.png"></p> <div id="wasm-example"><!----> <button>Try Tutorial10_lighting!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/intermediate/tutorial10-lighting/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><p>It's hard to tell the difference, but here are the results.</p> <p><img src="/learn-wgpu/assets/img/half_dir.bbcc23b8.png" alt="./half_dir.png"></p> <div id="wasm-example"><!----> <button>Try Tutorial10_lighting!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/intermediate/tutorial10-lighting/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/beginner/tutorial9-models/" class="prev"> <a href="/learn-wgpu/beginner/tutorial9-models/" class="prev">
Model Loading Model Loading
@ -649,6 +649,6 @@ let specular_strength = pow(max(dot(in.world_normal, half_dir), 0.0), 32.0);
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/15.84e6424a.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/16.944ff32f.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Normal Mapping"> <meta property="og:title" content="Normal Mapping">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/16.ce42724f.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/17.fc260ba0.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -479,7 +479,7 @@ render_pass<span class="token punctuation">.</span><span class="token function">
<span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera_bind_group<span class="token punctuation">,</span> <span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>camera_bind_group<span class="token punctuation">,</span>
<span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>light_bind_group<span class="token punctuation">,</span> <span class="token operator">&amp;</span><span class="token keyword">self</span><span class="token punctuation">.</span>light_bind_group<span class="token punctuation">,</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><p>That gives us something like this.</p> <p><img src="/learn-wgpu/assets/img/debug_material.b374492b.png" alt=""></p> <p>You can find the textures I use in the Github Repository.</p> <div id="wasm-example"><!----> <button>Try Tutorial11_normals!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/intermediate/tutorial11-normals/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><p>That gives us something like this.</p> <p><img src="/learn-wgpu/assets/img/debug_material.b374492b.png" alt=""></p> <p>You can find the textures I use in the Github Repository.</p> <div id="wasm-example"><!----> <button>Try Tutorial11_normals!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/intermediate/tutorial11-normals/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/intermediate/tutorial10-lighting/" class="prev"> <a href="/learn-wgpu/intermediate/tutorial10-lighting/" class="prev">
Working with Lights Working with Lights
@ -488,6 +488,6 @@ render_pass<span class="token punctuation">.</span><span class="token function">
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/16.ce42724f.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/17.fc260ba0.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="A Better Camera"> <meta property="og:title" content="A Better Camera">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/29.4022913a.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/19.143159cd.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/24.deb3c0a2.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/30.aac6dc60.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/20.31e0a434.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/25.831771f8.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -381,7 +381,7 @@
<span class="token punctuation">}</span> <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span> <span class="token punctuation">}</span>
</code></pre></div><p>With that, we should be able to move our camera wherever we want.</p> <p><img src="/learn-wgpu/assets/img/screenshot.4f5740bc.png" alt="./screenshot.png"></p> <div id="wasm-example"><!----> <button>Try Tutorial12_camera!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/intermediate/tutorial12-camera/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> </code></pre></div><p>With that, we should be able to move our camera wherever we want.</p> <p><img src="/learn-wgpu/assets/img/screenshot.4f5740bc.png" alt="./screenshot.png"></p> <div id="wasm-example"><!----> <button>Try Tutorial12_camera!</button></div> <div class="auto-github-link"><a href="https://github.com/sotrh/learn-wgpu/tree/master/code/intermediate/tutorial12-camera/" target="_blank" rel="noopener noreferrer">Check out the code!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/intermediate/tutorial11-normals/" class="prev"> <a href="/learn-wgpu/intermediate/tutorial11-normals/" class="prev">
Normal Mapping Normal Mapping
@ -390,6 +390,6 @@
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/29.4022913a.js" defer></script><script src="/learn-wgpu/assets/js/19.143159cd.js" defer></script><script src="/learn-wgpu/assets/js/24.deb3c0a2.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/30.aac6dc60.js" defer></script><script src="/learn-wgpu/assets/js/20.31e0a434.js" defer></script><script src="/learn-wgpu/assets/js/25.831771f8.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Procedural Terrain"> <meta property="og:title" content="Procedural Terrain">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/21.0d1e41d4.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.143159cd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.deb3c0a2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.f2ce7221.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/22.a7ceb9be.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.31e0a434.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.831771f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.e5816a32.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -134,7 +134,7 @@ fn gen_terrain(
gen_terrain(global_invocation_id) gen_terrain(global_invocation_id)
</code></pre></div><p>If you want learn more about workgroups <a href="https://www.w3.org/TR/WGSL/#compute-shader-workgroups" target="_blank" rel="noopener noreferrer">check out the docs<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>.</p></div> <p>TODO:</p> <ul><li>Note changes to <code>create_render_pipeline</code></li> <li>Mention <code>swizzle</code> feature for cgmath</li> <li>Compare workgroups and workgroups sizes to nested for loops </code></pre></div><p>If you want learn more about workgroups <a href="https://www.w3.org/TR/WGSL/#compute-shader-workgroups" target="_blank" rel="noopener noreferrer">check out the docs<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>.</p></div> <p>TODO:</p> <ul><li>Note changes to <code>create_render_pipeline</code></li> <li>Mention <code>swizzle</code> feature for cgmath</li> <li>Compare workgroups and workgroups sizes to nested for loops
<ul><li>Maybe make a diagram in blender?</li></ul></li> <li>Change to camera movement speed</li></ul></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <!----> </main></div></div><div class="global-ui"><!----></div></div> <ul><li>Maybe make a diagram in blender?</li></ul></li> <li>Change to camera movement speed</li></ul></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <!----> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/21.0d1e41d4.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/22.a7ceb9be.js" defer></script>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="generator" content="VuePress 1.9.7"> <meta name="generator" content="VuePress 1.9.7">
<meta name="description" content=""> <meta name="description" content="">
<meta property="article:modified_time" content="2022-11-30T18:10:53.000Z"> <meta property="article:modified_time" content="2022-12-10T19:18:58.000Z">
<meta property="og:site_name" content="Learn Wgpu"> <meta property="og:site_name" content="Learn Wgpu">
<meta property="og:title" content="Update to 0.12!"> <meta property="og:title" content="Update to 0.12!">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
@ -19,7 +19,7 @@
<meta name="twitter:data1" content="Benjamin Hansen"> <meta name="twitter:data1" content="Benjamin Hansen">
<meta name="twitter:creator" content="https://twitter.com/sotrh760"> <meta name="twitter:creator" content="https://twitter.com/sotrh760">
<link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.64dc10c5.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/14.ae52f492.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/41.f2ce7221.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.ca1c2622.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.befdcc6e.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.063ca119.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.65e5cff6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/15.84e6424a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.ce42724f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.a06f58e2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.76b2811f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.143159cd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6baa2ac9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.974dd1af.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.0d1e41d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.42d34407.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.a1c19e16.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.deb3c0a2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.a612b130.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.4f737487.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.658633e5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.f884a3be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.4022913a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.5c7419db.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.c1f8fead.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.8e0bd3aa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.552c49b8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.fc371e11.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.af68cb86.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.a9fbafe0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a1365c71.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.4abf0071.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.9362517c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.4aa63fe8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.e0694e30.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.8f1c5e70.js"><link rel="prefetch" href="/learn-wgpu/assets/js/42.9444bcb9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.e076a900.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1fffcec3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.9a1f2d9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.62b4be7a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.5bfa960c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.4502bb84.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.24a0758c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.e1d8f41b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.9008cb75.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.2ea56c31.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bde116fc.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.ebfbb38b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.74a877d4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.3bb59e1a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.abd5fff5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.759cf256.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.1656d8a0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.2a17918a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.2c6d1b9a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.a60e8279.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.014d094b.js"> <link rel="preload" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css" as="style"><link rel="preload" href="/learn-wgpu/assets/js/app.2aa001d7.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/15.656a9cc4.js" as="script"><link rel="preload" href="/learn-wgpu/assets/js/42.e5816a32.js" as="script"><link rel="prefetch" href="/learn-wgpu/assets/js/0.5a1994c5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/10.283e1aeb.js"><link rel="prefetch" href="/learn-wgpu/assets/js/11.6c80f1a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/12.fd765fd8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/13.64e1abdd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/16.944ff32f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/17.fc260ba0.js"><link rel="prefetch" href="/learn-wgpu/assets/js/18.4a711d00.js"><link rel="prefetch" href="/learn-wgpu/assets/js/19.067373fa.js"><link rel="prefetch" href="/learn-wgpu/assets/js/2.6b3360f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/20.31e0a434.js"><link rel="prefetch" href="/learn-wgpu/assets/js/21.47016ecd.js"><link rel="prefetch" href="/learn-wgpu/assets/js/22.a7ceb9be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/23.abdd6762.js"><link rel="prefetch" href="/learn-wgpu/assets/js/24.38da801a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/25.831771f8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/26.275f1cf4.js"><link rel="prefetch" href="/learn-wgpu/assets/js/27.01d55187.js"><link rel="prefetch" href="/learn-wgpu/assets/js/28.eb1c9cc8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/29.5ead4d92.js"><link rel="prefetch" href="/learn-wgpu/assets/js/3.09f1398c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/30.aac6dc60.js"><link rel="prefetch" href="/learn-wgpu/assets/js/31.2cc77589.js"><link rel="prefetch" href="/learn-wgpu/assets/js/32.946ceeb1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/33.4771159b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/34.243b88c1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/35.9375dd6a.js"><link rel="prefetch" href="/learn-wgpu/assets/js/36.a67ffba8.js"><link rel="prefetch" href="/learn-wgpu/assets/js/37.7a606210.js"><link rel="prefetch" href="/learn-wgpu/assets/js/38.948c9159.js"><link rel="prefetch" href="/learn-wgpu/assets/js/39.c3cb620b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/4.a7a39244.js"><link rel="prefetch" href="/learn-wgpu/assets/js/40.d38c5ac2.js"><link rel="prefetch" href="/learn-wgpu/assets/js/41.9da478f5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/43.924905ff.js"><link rel="prefetch" href="/learn-wgpu/assets/js/44.1b27deea.js"><link rel="prefetch" href="/learn-wgpu/assets/js/45.582f637d.js"><link rel="prefetch" href="/learn-wgpu/assets/js/46.1b5427a5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/47.4573b85b.js"><link rel="prefetch" href="/learn-wgpu/assets/js/48.2512ae5c.js"><link rel="prefetch" href="/learn-wgpu/assets/js/49.b549b904.js"><link rel="prefetch" href="/learn-wgpu/assets/js/5.62e47561.js"><link rel="prefetch" href="/learn-wgpu/assets/js/50.69b61f89.js"><link rel="prefetch" href="/learn-wgpu/assets/js/51.f14521a6.js"><link rel="prefetch" href="/learn-wgpu/assets/js/52.bf5dee59.js"><link rel="prefetch" href="/learn-wgpu/assets/js/53.639630ee.js"><link rel="prefetch" href="/learn-wgpu/assets/js/54.a0d139e9.js"><link rel="prefetch" href="/learn-wgpu/assets/js/55.2469ed88.js"><link rel="prefetch" href="/learn-wgpu/assets/js/56.4d41b7e3.js"><link rel="prefetch" href="/learn-wgpu/assets/js/57.bc5114be.js"><link rel="prefetch" href="/learn-wgpu/assets/js/58.e52c8733.js"><link rel="prefetch" href="/learn-wgpu/assets/js/59.0c19fdc1.js"><link rel="prefetch" href="/learn-wgpu/assets/js/6.c1433563.js"><link rel="prefetch" href="/learn-wgpu/assets/js/60.d3f1814f.js"><link rel="prefetch" href="/learn-wgpu/assets/js/7.0b322ea5.js"><link rel="prefetch" href="/learn-wgpu/assets/js/8.971f6540.js"><link rel="prefetch" href="/learn-wgpu/assets/js/9.d82998a2.js">
<link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css"> <link rel="stylesheet" href="/learn-wgpu/assets/css/1.styles.a09ac8f8.css">
</head> </head>
<body> <body>
@ -61,7 +61,7 @@ I needed to do was add a padding field:</p> <div class="language-rust extra-clas
breaks glob imports (aka. <code>use anyhow::*</code>), I had to switch qualified breaks glob imports (aka. <code>use anyhow::*</code>), I had to switch qualified
imports and uses (ie. <code>anyhow::Result</code>). This was mostly an issue on my imports and uses (ie. <code>anyhow::Result</code>). This was mostly an issue on my
build scripts for some of the showcase examples.</p> <p>The main tutorial examples weren't affected, and the changes are minor, so build scripts for some of the showcase examples.</p> <p>The main tutorial examples weren't affected, and the changes are minor, so
if you're curious feel free to look at the repo.</p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">11/30/2022, 6:10:53 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"> if you're curious feel free to look at the repo.</p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">12/10/2022, 7:18:58 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/learn-wgpu/news/0.13/" class="prev"> <a href="/learn-wgpu/news/0.13/" class="prev">
Update to 0.13! Update to 0.13!
@ -70,6 +70,6 @@ if you're curious feel free to look at the repo.</p></div> <footer class="page-e
</a> </a>
</span></p></div> </main></div></div><div class="global-ui"><!----></div></div> </span></p></div> </main></div></div><div class="global-ui"><!----></div></div>
<script src="/learn-wgpu/assets/js/app.64dc10c5.js" defer></script><script src="/learn-wgpu/assets/js/14.ae52f492.js" defer></script><script src="/learn-wgpu/assets/js/41.f2ce7221.js" defer></script> <script src="/learn-wgpu/assets/js/app.2aa001d7.js" defer></script><script src="/learn-wgpu/assets/js/15.656a9cc4.js" defer></script><script src="/learn-wgpu/assets/js/42.e5816a32.js" defer></script>
</body> </body>
</html> </html>

Some files were not shown because too many files have changed in this diff Show More