Skip to content

Commit 2b9e26b

Browse files
committed
.
1 parent 4edd9cf commit 2b9e26b

43 files changed

Lines changed: 681 additions & 595 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -166,48 +166,48 @@ name = "compute_readback"
166166
path = "examples/compute_readback.rs"
167167

168168
[[example]]
169-
name = "field_basic"
170-
path = "examples/field_basic.rs"
169+
name = "particles_basic"
170+
path = "examples/particles_basic.rs"
171171

172172
[[example]]
173-
name = "field_animated"
174-
path = "examples/field_animated.rs"
173+
name = "particles_animated"
174+
path = "examples/particles_animated.rs"
175175

176176
[[example]]
177-
name = "field_oriented"
178-
path = "examples/field_oriented.rs"
177+
name = "particles_oriented"
178+
path = "examples/particles_oriented.rs"
179179

180180
[[example]]
181-
name = "field_colored"
182-
path = "examples/field_colored.rs"
181+
name = "particles_colored"
182+
path = "examples/particles_colored.rs"
183183

184184
[[example]]
185-
name = "field_colored_pbr"
186-
path = "examples/field_colored_pbr.rs"
185+
name = "particles_colored_pbr"
186+
path = "examples/particles_colored_pbr.rs"
187187

188188
[[example]]
189-
name = "field_emit"
190-
path = "examples/field_emit.rs"
189+
name = "particles_emit"
190+
path = "examples/particles_emit.rs"
191191

192192
[[example]]
193-
name = "field_lifecycle"
194-
path = "examples/field_lifecycle.rs"
193+
name = "particles_lifecycle"
194+
path = "examples/particles_lifecycle.rs"
195195

196196
[[example]]
197-
name = "field_from_mesh"
198-
path = "examples/field_from_mesh.rs"
197+
name = "particles_from_mesh"
198+
path = "examples/particles_from_mesh.rs"
199199

200200
[[example]]
201-
name = "field_noise"
202-
path = "examples/field_noise.rs"
201+
name = "particles_noise"
202+
path = "examples/particles_noise.rs"
203203

204204
[[example]]
205-
name = "field_emit_gpu"
206-
path = "examples/field_emit_gpu.rs"
205+
name = "particles_emit_gpu"
206+
path = "examples/particles_emit_gpu.rs"
207207

208208
[[example]]
209-
name = "field_stress"
210-
path = "examples/field_stress.rs"
209+
name = "particles_stress"
210+
path = "examples/particles_stress.rs"
211211

212212
[profile.wasm-release]
213213
inherits = "release"

crates/processing_core/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ pub enum ProcessingError {
5656
PipelineCompileError(String),
5757
#[error("Pipeline not ready after {0} frames")]
5858
PipelineNotReady(u32),
59-
#[error("Field not found")]
60-
FieldNotFound,
59+
#[error("Particles not found")]
60+
ParticlesNotFound,
6161
}

crates/processing_pyo3/examples/camera_controllers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def setup():
88
mode_3d()
99
orbit_camera()
1010

11-
dir_light = create_directional_light((1.0, 0.98, 0.95), 1500.0)
11+
dir_light = directional_light((1.0, 0.98, 0.95), 1500.0)
1212
dir_light.position(300.0, 400.0, 300.0)
1313
dir_light.look_at(0.0, 0.0, 0.0)
1414

crates/processing_pyo3/examples/field_stress.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

crates/processing_pyo3/examples/lights.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ def setup():
77
mode_3d()
88

99
# Directional Light
10-
dir_light = create_directional_light((0.5, 0.24, 1.0), 1500.0)
10+
dir_light = directional_light((0.5, 0.24, 1.0), 1500.0)
1111

1212
# Point Lights
13-
point_light_a = create_point_light((1.0, 0.5, 0.25), 1000000.0, 200.0, 0.5)
13+
point_light_a = point_light((1.0, 0.5, 0.25), 1000000.0, 200.0, 0.5)
1414
point_light_a.position(-25.0, 5.0, 51.0)
1515
point_light_a.look_at(0.0, 0.0, 0.0)
1616

17-
point_light_b = create_point_light((0.0, 0.5, 0.75), 2000000.0, 200.0, 0.25)
17+
point_light_b = point_light((0.0, 0.5, 0.75), 2000000.0, 200.0, 0.25)
1818
point_light_b.position(0.0, 5.0, 50.5)
1919
point_light_b.look_at(0.0, 0.0, 0.0)
2020

2121
# Spot Light
22-
spot_light = create_spot_light((0.25, 0.8, 0.19), 15.0 * 1000000.0, 200.0, 0.84, 0.0, 0.7854)
22+
spot_light = spot_light((0.25, 0.8, 0.19), 15.0 * 1000000.0, 200.0, 0.84, 0.0, 0.7854)
2323
spot_light.position(40.0, 0.0, 70.0)
2424
spot_light.look_at(0.0, 0.0, 0.0)
2525

crates/processing_pyo3/examples/materials.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ def setup():
77
size(800, 600)
88
mode_3d()
99

10-
dir_light = create_directional_light((1.0, 0.98, 0.95), 1500.0)
11-
point_light = create_point_light((1.0, 1.0, 1.0), 100000.0, 800.0, 0.0)
10+
dir_light = directional_light((1.0, 0.98, 0.95), 1500.0)
11+
point_light = point_light((1.0, 1.0, 1.0), 100000.0, 800.0, 0.0)
1212
point_light.position(200.0, 200.0, 400.0)
1313

1414
mat = Material()

crates/processing_pyo3/examples/field_animated.py renamed to crates/processing_pyo3/examples/particles_animated.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from mewnala import *
22

3-
field_obj = None
3+
p = None
44
sphere = None
55
mat = None
66
spin = None
@@ -31,12 +31,12 @@
3131

3232

3333
def setup():
34-
global field_obj, sphere, mat, spin
34+
global p, sphere, mat, spin
3535

3636
size(900, 700)
3737
mode_3d()
3838

39-
create_directional_light((0.9, 0.85, 0.8), 300.0)
39+
directional_light((0.9, 0.85, 0.8), 300.0)
4040

4141
sphere = Geometry.sphere(0.25, 12, 8)
4242

@@ -47,8 +47,8 @@ def setup():
4747
for z in range(10):
4848
positions.extend([x - 4.5, y - 4.5, z - 4.5])
4949

50-
field_obj = Field(capacity=capacity, attributes=[Attribute.position()])
51-
pos_buf = field_obj.buffer(Attribute.position())
50+
p = Particles(capacity=capacity, attributes=[Attribute.position()])
51+
pos_buf = p.buffer(Attribute.position())
5252
pos_buf.write(positions)
5353

5454
mat = Material(roughness=0.4)
@@ -62,10 +62,10 @@ def draw():
6262
fill(230, 128, 75)
6363

6464
use_material(mat)
65-
draw_field(field_obj, sphere)
65+
particles(p, sphere)
6666

6767
spin.set(dt=0.01)
68-
field_obj.apply(spin)
68+
p.apply(spin)
6969

7070

7171
run()

crates/processing_pyo3/examples/field_basic.py renamed to crates/processing_pyo3/examples/particles_basic.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
from mewnala import *
22

3-
field_obj = None
3+
p = None
44
particle = None
55
mat = None
66

77

88
def setup():
9-
global field_obj, particle, mat
9+
global p, particle, mat
1010

1111
size(900, 700)
1212
mode_3d()
1313

14-
create_directional_light((0.95, 0.9, 0.85), 600.0)
14+
directional_light((0.95, 0.9, 0.85), 600.0)
1515

1616
# Source mesh whose vertices become particle positions; uvs come along for
1717
# free and we use them to color each particle.
1818
source = Geometry.sphere(5.0, 32, 24)
19-
field_obj = Field(
19+
p = Particles(
2020
geometry=source,
2121
attributes=[Attribute.position(), Attribute.uv(), Attribute.color()],
2222
)
2323

24-
uv_buf = field_obj.buffer(Attribute.uv())
25-
color_buf = field_obj.buffer(Attribute.color())
24+
uv_buf = p.buffer(Attribute.uv())
25+
color_buf = p.buffer(Attribute.color())
2626

2727
colors = []
2828
for uv in uv_buf.read():
@@ -40,7 +40,7 @@ def draw():
4040
background(15, 15, 20)
4141

4242
use_material(mat)
43-
draw_field(field_obj, particle)
43+
particles(p, particle)
4444

4545

4646
run()

crates/processing_pyo3/examples/field_emit.py renamed to crates/processing_pyo3/examples/particles_emit.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
from mewnala import *
22
import math
33

4-
field_obj = None
4+
p = None
55
sphere = None
66
mat = None
77
frame = 0
88

99

1010
def setup():
11-
global field_obj, sphere, mat
11+
global p, sphere, mat
1212

1313
size(900, 700)
1414
mode_3d()
1515

1616
sphere = Geometry.sphere(0.08, 8, 6)
1717

1818
capacity = 2000
19-
field_obj = Field(
19+
p = Particles(
2020
capacity=capacity,
2121
attributes=[Attribute.position(), Attribute.color()],
2222
)
2323

2424
# Push unemitted slots far off-screen so they don't all render at the
2525
# origin while the ring buffer is still filling.
26-
pos_buf = field_obj.buffer(Attribute.position())
26+
pos_buf = p.buffer(Attribute.position())
2727
pos_buf.write([1.0e6] * (capacity * 3))
2828

29-
color_buf = field_obj.buffer(Attribute.color())
29+
color_buf = p.buffer(Attribute.color())
3030
mat = Material.unlit(albedo=color_buf)
3131

3232

@@ -37,7 +37,7 @@ def draw():
3737
background(15, 15, 20)
3838

3939
use_material(mat)
40-
draw_field(field_obj, sphere)
40+
particles(p, sphere)
4141

4242
# Emit 4 particles per frame in an outward-spiraling ring; once the ring
4343
# buffer fills (~500 frames at 4/frame for capacity 2000), oldest get
@@ -54,7 +54,7 @@ def draw():
5454
c = hsva((i * 4.32) % 360.0, 0.85, 1.0)
5555
colors.extend([c.r, c.g, c.b, 1.0])
5656

57-
field_obj.emit(burst, position=positions, color=colors)
57+
p.emit(burst, position=positions, color=colors)
5858
frame += 1
5959

6060

0 commit comments

Comments
 (0)