Merge pull request #439 from zimurgh/zimurgh-tutorial11-normals-fix-typos

Fix to docs for tutorial 11
pull/427/head^2
sotrh 1 year ago committed by GitHub
commit 1ec11ef789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -114,7 +114,6 @@ impl Material {
} }
``` ```
Now we can use the texture in the fragment shader. Now we can use the texture in the fragment shader.
```wgsl ```wgsl
@ -366,12 +365,12 @@ Next, we'll construct the `tangent_matrix` and then transform the vertex's light
```wgsl ```wgsl
struct VertexOutput { struct VertexOutput {
@builtin(position) clip_position: vec4<f32>; @builtin(position) clip_position: vec4<f32>,
@location(0) tex_coords: vec2<f32>; @location(0) tex_coords: vec2<f32>,
// UPDATED! // UPDATED!
@location(1) tangent_position: vec3<f32>; @location(1) tangent_position: vec3<f32>,
@location(2) tangent_light_position: vec3<f32>; @location(2) tangent_light_position: vec3<f32>,
@location(3) tangent_view_position: vec3<f32>; @location(3) tangent_view_position: vec3<f32>,
}; };
@vertex @vertex
@ -441,7 +440,7 @@ pub fn from_image(
img: &image::DynamicImage, img: &image::DynamicImage,
label: Option<&str>, label: Option<&str>,
is_normal_map: bool, // NEW! is_normal_map: bool, // NEW!
) -> Result<(Self, wgpu::CommandBuffer), failure::Error> { ) -> Result<Self> {
// ... // ...
let texture = device.create_texture(&wgpu::TextureDescriptor { let texture = device.create_texture(&wgpu::TextureDescriptor {
label, label,
@ -460,7 +459,11 @@ pub fn from_image(
// ... // ...
Ok((Self { texture, view, sampler }, cmd_buffer)) Ok(Self {
texture,
view,
sampler,
})
} }
``` ```

Loading…
Cancel
Save