|
2 | 2 | :clay {:title "Volumetric Clouds with Clojure and LWJGL" |
3 | 3 | :external-requirements ["Xorg"] |
4 | 4 | :quarto {:author [:janwedekind] |
5 | | - :draft true |
| 5 | + :draft false |
6 | 6 | :description "Procedural generation of volumetric clouds using different types of noise" |
7 | 7 | :image "clouds.jpg" |
8 | 8 | :type :post |
|
14 | 14 | (:require [clojure.math :refer (PI sqrt cos sin tan to-radians pow floor)] |
15 | 15 | [midje.sweet :refer (fact facts tabular => roughly)] |
16 | 16 | [fastmath.vector :refer (vec2 vec3 add mult sub div mag dot normalize)] |
17 | | - [fastmath.matrix :refer (mat->float-array mulm mulv inverse |
| 17 | + [fastmath.matrix :refer (mat->float-array mulm |
18 | 18 | rotation-matrix-3d-x rotation-matrix-3d-y)] |
19 | 19 | [tech.v3.datatype :as dtype] |
20 | 20 | [tech.v3.tensor :as tensor] |
|
33 | 33 | ;; For a introductory video see [Sebastian Lague's video "Coding Adventure: Clouds](https://www.youtube.com/watch?v=4QOcCGI6xOU). |
34 | 34 | ;; This article gets you started with computing and rendering volumetric clouds. |
35 | 35 | ;; |
| 36 | +;; ## Dependencies |
| 37 | +;; |
| 38 | +;; To download the required libraries, we use a `deps.edn` file with the following content: |
| 39 | +;; |
| 40 | +;; ```Clojure |
| 41 | +;; {:deps |
| 42 | +;; { |
| 43 | +;; org.clojure/clojure {:mvn/version "1.12.3"} |
| 44 | +;; org.scicloj/noj {:mvn/version "2-beta18"} |
| 45 | +;; midje/midje {:mvn/version "1.10.10"} |
| 46 | +;; generateme/fastmath {:mvn/version "3.0.0-alpha4"} |
| 47 | +;; comb/comb {:mvn/version "1.0.0"} |
| 48 | +;; } |
| 49 | +;; ``` |
| 50 | +;; |
| 51 | +;; We are going to import the following methods and namespaces: |
| 52 | +;; ```Clojure |
| 53 | +;; (require '[clojure.math :refer (PI sqrt cos sin tan to-radians pow floor)] |
| 54 | +;; '[midje.sweet :refer (fact facts tabular => roughly)] |
| 55 | +;; '[fastmath.vector :refer (vec2 vec3 add mult sub div mag dot normalize)] |
| 56 | +;; '[fastmath.matrix :refer (mat->float-array mulm |
| 57 | +;; rotation-matrix-3d-x rotation-matrix-3d-y)] |
| 58 | +;; '[tech.v3.datatype :as dtype] |
| 59 | +;; '[tech.v3.tensor :as tensor] |
| 60 | +;; '[tech.v3.datatype.functional :as dfn] |
| 61 | +;; '[tablecloth.api :as tc] |
| 62 | +;; '[scicloj.tableplot.v1.plotly :as plotly] |
| 63 | +;; '[tech.v3.libs.buffered-image :as bufimg] |
| 64 | +;; '[comb.template :as template]) |
| 65 | +;; (import '[org.lwjgl.opengl GL11] |
| 66 | +;; '[org.lwjgl BufferUtils] |
| 67 | +;; '[org.lwjgl.glfw GLFW] |
| 68 | +;; '[org.lwjgl.opengl GL GL11 GL12 GL13 GL15 GL20 GL30 GL32 GL42]) |
| 69 | +;; ``` |
| 70 | +;; |
36 | 71 | ;; ## Worley noise |
37 | 72 | ;; |
38 | 73 | ;; [Worley noise](https://en.wikipedia.org/wiki/Worley_noise) is a type of structured noise which is defined for each pixel using the distance to the nearest seed point. |
|
0 commit comments