Skip to content

Commit 05b27c5

Browse files
Merge pull request #83 from wedesoft/main
Minor changes to OpenGL article
2 parents ccb9132 + c66c247 commit 05b27c5

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

site/opengl_visualization/main.qmd

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Next we need to set up OpenGL rendering for this window.
178178

179179
::: {.printedClojure}
180180
```clojure
181-
#object[org.lwjgl.opengl.GLCapabilities 0x30f1b3c2 "org.lwjgl.opengl.GLCapabilities@30f1b3c2"]
181+
#object[org.lwjgl.opengl.GLCapabilities 0x688b081a "org.lwjgl.opengl.GLCapabilities@688b081a"]
182182

183183
```
184184
:::
@@ -987,7 +987,8 @@ This shader program requires setup of several uniforms and a texture.
987987
```clojure
988988
(do
989989
(GL20/glUseProgram program-moon)
990-
(GL20/glUniform2f (GL20/glGetUniformLocation program-moon "iResolution") window-width window-height)
990+
(GL20/glUniform2f (GL20/glGetUniformLocation program-moon "iResolution")
991+
window-width window-height)
991992
(GL20/glUniform1f (GL20/glGetUniformLocation program-moon "fov") (to-radians 25.0))
992993
(GL20/glUniform1f (GL20/glGetUniformLocation program-moon "alpha") (to-radians 30.0))
993994
(GL20/glUniform1f (GL20/glGetUniformLocation program-moon "beta") (to-radians -20.0))
@@ -1716,7 +1717,7 @@ We reuse the vertex shader from the previous section.
17161717

17171718
The fragment shader this time is more involved.
17181719

1719-
* A horizon matrix with normal, tangent, and bitangent vectors is computed/
1720+
* A horizon matrix with normal, tangent, and bitangent vectors is computed.
17201721
* The elevation is sampled in four directions from the current 3D point.
17211722
* The elevation values are used to create two surface vectors.
17221723
* The cross product of the surface vectors is computed and normalized to get the normal vector.
@@ -2021,8 +2022,10 @@ Note that in practise you will
20212022
* use higher resolution data and map the data onto texture tiles
20222023
* generate textures containing normal maps offline
20232024
* create a multiresolution map
2024-
* you use tessellation to increase the mesh resolution
2025-
* you will use elevation data to deform the mesh
2025+
* use tessellation to increase the mesh resolution
2026+
* use elevation data to deform the mesh
2027+
2028+
Thanks to [Timothy Pratley](https://timothypratley.blogspot.com/p/httpswww.html) for helping getting this post online.
20262029

20272030

20282031
```{=html}

src/opengl_visualization/main.clj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ void main()
460460
;; This shader program requires setup of several uniforms and a texture.
461461
(do
462462
(GL20/glUseProgram program-moon)
463-
(GL20/glUniform2f (GL20/glGetUniformLocation program-moon "iResolution") window-width window-height)
463+
(GL20/glUniform2f (GL20/glGetUniformLocation program-moon "iResolution")
464+
window-width window-height)
464465
(GL20/glUniform1f (GL20/glGetUniformLocation program-moon "fov") (to-radians 25.0))
465466
(GL20/glUniform1f (GL20/glGetUniformLocation program-moon "alpha") (to-radians 30.0))
466467
(GL20/glUniform1f (GL20/glGetUniformLocation program-moon "beta") (to-radians -20.0))
@@ -698,7 +699,7 @@ void main()
698699
;;
699700
;; The fragment shader this time is more involved.
700701
;;
701-
;; * A horizon matrix with normal, tangent, and bitangent vectors is computed/
702+
;; * A horizon matrix with normal, tangent, and bitangent vectors is computed.
702703
;; * The elevation is sampled in four directions from the current 3D point.
703704
;; * The elevation values are used to create two surface vectors.
704705
;; * The cross product of the surface vectors is computed and normalized to get the normal vector.
@@ -839,5 +840,7 @@ void main()
839840
;; * use higher resolution data and map the data onto texture tiles
840841
;; * generate textures containing normal maps offline
841842
;; * create a multiresolution map
842-
;; * you use tessellation to increase the mesh resolution
843-
;; * you will use elevation data to deform the mesh
843+
;; * use tessellation to increase the mesh resolution
844+
;; * use elevation data to deform the mesh
845+
;;
846+
;; Thanks to [Timothy Pratley](https://timothypratley.blogspot.com/p/httpswww.html) for helping getting this post online.

0 commit comments

Comments
 (0)