Skip to content

Commit 9ed6b23

Browse files
committed
add mising language tag in Lesson-6bis
1 parent a47b446 commit 9ed6b23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lesson-6bis:-tangent-space-normal-mapping.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Let us finish with the motivation section and go straight ahead to the computati
2828

2929
Okay, here is the [starting point](https://github.com/ssloy/tinyrenderer/tree/e30ff353121460557e29dced5708652171dbc7d2). The shader is really simple, it is Phong shading.
3030

31-
```
31+
```C++
3232
struct Shader : public IShader {
3333
mat<2,3,float> varying_uv; // triangle uv coordinates, written by the vertex shader, read by the fragment shader
3434
mat<3,3,float> varying_nrm; // normal per vertex to be interpolated by FS
@@ -122,7 +122,7 @@ So, Darboux basis is a triplet of vectors (i,j,n), where n - is the original nor
122122
123123
All is quite straightforward, I compute the matrix A:
124124
125-
```
125+
```C++
126126
mat<3,3,float> A;
127127
A[0] = ndc_tri.col(1) - ndc_tri.col(0);
128128
A[1] = ndc_tri.col(2) - ndc_tri.col(0);
@@ -131,7 +131,7 @@ All is quite straightforward, I compute the matrix A:
131131

132132
Then compute two unknown vectors (i,j) of Darboux basis:
133133

134-
```
134+
```C++
135135
mat<3,3,float> AI = A.invert();
136136
Vec3f i = AI * Vec3f(varying_uv[0][1] - varying_uv[0][0], varying_uv[0][2] - varying_uv[0][0], 0);
137137
Vec3f j = AI * Vec3f(varying_uv[1][1] - varying_uv[1][0], varying_uv[1][2] - varying_uv[1][0], 0);

0 commit comments

Comments
 (0)