-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
182 lines (165 loc) · 8.76 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
resources:
. https://www.khronos.org/opengl/wiki/Compute_Shader
. https://www.khronos.org/opengl/wiki/Sampler_(GLSL)
. https://www.w3.org/TR/WGSL/
. https://sotrh.github.io/learn-wgpu
. https://gpuweb.github.io/gpuweb/wgsl/#builtin-functions
. for wgpu on browser
. https://github.com/sotrh/learn-wgpu/tree/master/code/showcase/pong
. https://sotrh.github.io/learn-wgpu/showcase/pong/
. look for wasm examples in wgpu
custom commands:
. /// import ./shader_path
. keep track of what files included and dont import files multiple times
. /// compute_enable
. /// work_group_count 64
fractal resources:
. https://iquilezles.org/articles/
. http://blog.hvidtfeldts.net/index.php/2011/06/distance-estimated-3d-fractals-part-i/
bugs:
. gamma correction + MSAA
. NOTE: color correction is not really needed as this is not physically based
. how do i do this? (dumping image)
. sum(get_col()^2)^(1/2)
. sum(get_col())
. sum(get_col()^2.2)^(1/2.2)
. sum(get_col()^(1/2.2))
. AA after doing color correction (maybe probably the most correct)
. dumping mandlebrot if rendered only when not in fullscreen, dumps images not rendered fully
. to fix, execute in compute shaders instead of in fragment shaders
. more taxing on gpu tho
plan:
. custom commands
. impliment ifdef equivalent
. #define equivalents but only to trigger ifdefs (basically to have different modes)
. windowless dump across frames + progress
. on pressing "p", dump_render() + code of render_windowless() is executed till the call to execute_render_and_compute_pass()
and the execute_render_and_compute_pass() is executed n times where n is the max frames it takes to render
image completely. each pass per frame
. keep a counter to know how many iterations left (with default value as 1 cuz bbrot)
. impliment another custom command to get the number of frames it takes to calculate everything
. disable checking for shader code edits till this is done
/. map_read in buffer features hurts performance
/. instead of using a buffer, render stuff to texture directly
/. then do what is done in windowless but with the windowed version
/. create a readable buffer and copy texture to it and save buffer as image
. this way, bbrot does not even need to render windowless
. maybe increase/decrease the cumpute_buffer invocations/iterations_per_frame based on the frame time
. how do i check fps?
. ig its already sync cuz get_current_texture() ??
. is the winit eventloop async?
. so can another iteration start before one ends?
. sliders for variables
. pressing some button + scrolling
. how anti-aliasing
. can i dump gifs
new ideas:
. render a 3d fractal with z axis as the f(iteration count).
. where f can be a scaling func like sqrt or log
. so at z=0, its just a plane, but as it goes further away, it forms the fractal but clearer
. hybrid fractals like those in mandlebulber2
. try with DE and without DE
. switch between multiple fractal equations depending on current iter
. have a fixed loop of what equation to use and in what order
. threshold of n for using what equation
. f(eqn1, eqn2)
raymarch:
. make a mode where the gpu does not execute all shaders, it just shows the last frame till code edited
. a mode for manual shader compile triggers
. global kb shortcuts for fullscreen, compiling shaders (dont auto compile)
flame fractals??
. https://en.wikipedia.org/wiki/Fractal_flame
. this tut looks good: https://fractalformulas.wordpress.com/2017/05/01/basics-of-flame-fractals/
. https://www.ultrafractal.com/kb/flamefractals.html
buddhabrot:
. try complex to the power complex number equation
. https://math.stackexchange.com/questions/476968/complex-power-of-a-complex-number
. what happens with non polynomial functions?
. cuz slight variations to complex number calculation still produces fractals
. mandlebrot, but mirror the point so that it always stays in the first quadrant
. or some other variations of this kind
. get more julia buddhabrot things + the rooty stuff
. optimisation techniques?: https://github.com/Michaelangel007/buddhabrot
. change coloring tech
. image[index] += get_col(1_hit_equivalent)
. 1_hit_equivalent can be 1.0 or whatever else generated on points/orbits
. since this implimentation can know about the exact iteration count of trajectory, color based on the trajectory length
. color bigg trajectories with less bias
. orbit traps
. color entire orbits as f(distance of Zn from the traps)
. color the points as f(distance of the point from the traps, hits) (this isnt really orbit trapping tho)
. color points as f(orbit_trap_based_color, non_orbit_trap_based_color)
buddhabrot but only a section:
. https://benedikt-bitterli.me/buddhabrot/
. https://github.com/Quuxplusone/Buddhabrot
. execute for a grid, find all points that contribute to current section.
then look for new points in finer grid around the good points (take care of overlap)
and repeat n times while discarding bottom p percentage of points that no not contribute much points.
. be careful not to just use points from very small regions. instead allow a range of "contributions"
and discard anything outside it
. finally select random points from the good regions
. choosing not fine enough grid initially will cause to miss a lot of good zones
mandlebrot:
. do something so that less TrajectoryPoints are needed (independent of the render rez)
. use compute shaders + multiple passes
. do p passes per frame such that total time taken is not unreasonable
. MSAA can be done across frames too
. such that 2nd sample is taken after 1st sample is done for all pixels
. make sure that all pixels can be calculated completely within 1 compute pass
. this way TrajectoryPoints are not needed at all
. also multiple orbit traps can be combined in different ways since no tracking across invocations is needed
. maybe seperate this into a different file
. maybe impliment such that computations are done in smol squares
. 1 compute pass does 1 pixel in the box
. a seperate mode for realtime mbrot shaders
. all calculations done in 1 pass of fragment shaders
. press a button to stop realtime-ness
. make the juliabrot viewer. kinda like in the 3b1b vid: https://youtu.be/LqbZpur38nw at 8:02
. use 2 sets of triangles to cover half a screen each
. just overlay the mandlebrot render quardilateral on top of the julia one.
. spawn 2 windows and let user arrange them
. histogram equalization coloring technique
. https://github.com/Smoltbob/fractals_rust/blob/master/src/main.rs
/. orbit traps!!!!!
. https://iquilezles.org/articles/ftrapsgeometric/
. https://en.wikipedia.org/wiki/Orbit_trap
. https://www.shadertoy.com/view/Wl2Gz1
. bitmap orbit trap thing
. iterate Zn and sample a color from a texture at the clamp(Zn, 0.0, 1.0) coords (not clamping works too for some reason)
and take the first color hit and break (alpha channel != 0 (assuming the texture has 0.0 alpha for bg))
. https://www.shadertoy.com/view/4slGWH
newton's fractal:
. wip wgsl rust: https://github.com/agausmann/NewtonFractal
notes:
get wierd cool fractals: (works in both mbrot and bbrot)
. needs non-smooth coloring
k. equation (return k + c)
1. k = v2f(z.x*z.x-z.y*z.y, 2.0*z.x*z.y);
2. k = v2f(z.x*z.x+z.y*z.y, 2.0*z.x*z.y); // gives square
3. k = v2f(z.x*z.x+z.y*z.y, -2.0*z.x*z.y); // gives bullet/droplet
e. escape func (NOTE: this was basically accidental orbit trap of line x = 0)
1. return z.x*z.x + z.y*z.y > 4.0;
2. return 1.0/z.x + z.y*z.y > 4.0; // make wierd tendril things
3. return 1.0/z.x - z.y*z.y > 4.0; // makes the background black
4. return 0.2/z.x ......... > 4.0; // tendril things go smaller
i. iteration
1. min_iterations = 5000, max_iterations = 100000
2. min_iterations = 0, max_iterations = 10
3. min_iterations = 0, max_iterations = 20
1. min_iterations = 5000, max_iterations = 100000
o. observation:
1. k1 + e1 + i1 -> normal bbrot
2. e1 + i2
. (does not give anything intresting in bbrot)
1. k2 -> gives square in mandlebrot
2. k3 -> gives droplet shaper in mandlebrot
3. k* + i2
. (i2 -> no glow around tendrils)
1. e2 -> rooty/tendrils + bright background
2. e3 -> rooty/tendrils + dark background
3. e4 -> rooty/tendrils + thinner tendrils
4. k* + i3 -> o3 + glow
5. with anti bbrot:
1. o3.2 and o3.3 swap behaviour
2. prefer a bit higher iterations (a lil bit higher than i3)
3. k2 and k3 have very unintresting results