Commit 809dbe3
authored
Clarify compute shader N-body tutorial (#1798)
* Use a more manageable default size for the screen
* Set resizable to false to play safe with tiling WMs
* Make the tutorial friendlier to low-end systems by using fewer particles
* Use a top-level constant to control the number of stars
* Make naming consistent, ie stars instead of balls
* s/effected/affected/ + phrasing tweak in same sentence
* Use self.position instead of .center_x, .center_y
* Change the window title to be clearer
* s/ball/star/g in the computer shader example's glsl
* Improve clarity by renaming buffer variables and updating comments
* Clean up buffer initialization by using a nested function
* Use standard conditional execution for the example
* Add units to comments
* Make phrasing consistent in program parts list
* Explain templating behavior at the top of the compute shader
* Use pathlib.Path.read_text instead of longer with statememnts
* Add comments explaining input variables to compute shaders
* Randomize star color to make movement visualization easier
* Incorporate feedback from discord discussion
* Use clearer names for the buffers
* Clarify a comment
* Add missing "the" to increase smoothness
* Add notes on vec3 being fake based on discussion with @einarf
* Extend comment to support the .rst file
* Rephrase label in SVG diagram
* Move initial data generation into separate function to make indent cleaner
* Clean up the top of the tutorial's __init__
* Update file docstring, window title, and class name
* Remove unused instance variable & reorganize code for easier inclusion in .rst
* Initialize both ssbo buffers with the same data to start with
* Add section on buffer allocation to computer shader tutorial
* Tweak tutorial intro phrasing
* Tweak buffer opening phrasing
* Add index to SVG diagram label to indicate parallel iteration
* Subdivide visualization section with headings + touch up Vertex & Geometry shader sections
* Make ordering of variables identical across doc, vertex, and geometry shader
* Improve clarity of Geometry Shader section & GLSL
* Clean up rst description of geometry & fragment shaders
* Finish first full rework draft
* Make star color togglable & off by default to match the embedded video
* Update example portion line numbers
* Fix an ambiguous comment in compute shader
* Fix plural in heading1 parent 7068d35 commit 809dbe3
File tree
5 files changed
+261
-146
lines changed- doc/tutorials/compute_shader
- shaders
5 files changed
+261
-146
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
25 | 61 | | |
26 | 62 | | |
27 | 63 | | |
28 | 64 | | |
29 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
30 | 69 | | |
31 | 70 | | |
32 | 71 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
37 | 80 | | |
38 | | - | |
39 | | - | |
| 81 | + | |
| 82 | + | |
40 | 83 | | |
41 | 84 | | |
42 | 85 | | |
43 | 86 | | |
44 | 87 | | |
45 | 88 | | |
46 | | - | |
47 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
48 | 101 | | |
49 | 102 | | |
50 | 103 | | |
51 | 104 | | |
52 | 105 | | |
53 | 106 | | |
54 | | - | |
55 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
56 | 114 | | |
57 | 115 | | |
58 | 116 | | |
59 | 117 | | |
60 | 118 | | |
61 | 119 | | |
62 | 120 | | |
63 | | - | |
64 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
65 | 125 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
69 | 133 | | |
70 | 134 | | |
71 | 135 | | |
72 | 136 | | |
73 | 137 | | |
74 | 138 | | |
75 | | - | |
76 | | - | |
| 139 | + | |
| 140 | + | |
77 | 141 | | |
78 | | - | |
| 142 | + | |
79 | 143 | | |
80 | 144 | | |
81 | 145 | | |
82 | 146 | | |
83 | 147 | | |
84 | | - | |
| 148 | + | |
| 149 | + | |
0 commit comments