You are browsing as a guest. Sign up (or log in) to start making projects!

Terrain Simulator

  • 19 Devlogs
  • 20 Total hours

3D terrain generator and renderer. Uses WebGPU for low level control and cross platform compatibility.

Ship #1

I made a terrain generator and renderer. It uses the WebGPU standard through the wgpu library for Rust for rendering, and uses a bunch of stacked perlin noise for the generation. Works on EVERY platform (including web) since Rust is just that sigma.
Hardest part was learning wgpu in the first place, but the docs had a REALLY good guide/tutorial thing I followed, and a lot of my code is based off of it, including everything needed to get it to work in web.
If I were to work on this project more, I'd optimize it a bit more so it'd run better, like 500fps on web somehow or smth. Or to add LODs or smth.

  • 19 devlogs
  • 20h
Try project → See source code →
Open comments for this post

1h 42m 28s logged

final polishes, random seed on every load, small changes like that
MORE IMPORTANTLY setup a github action that auto builds for EVERY SINGLE PLATFORM, PUSHES TO CRATES.IO, AND DEPLOYS TO GITHUB PAGES
https://shuflduf.github.io/Terrain-Simulator/

final polishes, random seed on every load, small changes like that
MORE IMPORTANTLY setup a github action that auto builds for EVERY SINGLE PLATFORM, PUSHES TO CRATES.IO, AND DEPLOYS TO GITHUB PAGES
https://shuflduf.github.io/Terrain-Simulator/

Replying to @Shuflduf

0
12
Open comments for this post

2h 25m 18s logged

lots and lots of little optimizations and QOL things
the project is basically done already.
heap allocated some stuff that really shouldnt be on the stack
made the textures actually tile each other instead of having harsh borders
vsync toggle
text rendering for overlay (using glyphon)
Q and E for camera controls
etc etc
cant upload video because sd crashes every time i try to

lots and lots of little optimizations and QOL things
the project is basically done already.
heap allocated some stuff that really shouldnt be on the stack
made the textures actually tile each other instead of having harsh borders
vsync toggle
text rendering for overlay (using glyphon)
Q and E for camera controls
etc etc
cant upload video because sd crashes every time i try to

Replying to @Shuflduf

0
10
Open comments for this post

41m 49s logged

frustum culling! now chunks that you cant see arent rendered. i actually have no idea if its working or not because if the chunks are behind me then i cant see tham get culled anyways

frustum culling! now chunks that you cant see arent rendered. i actually have no idea if its working or not because if the chunks are behind me then i cant see tham get culled anyways

Replying to @Shuflduf

0
16
Open comments for this post

41m 51s logged

SKYBOXXXXX
i have a massive physics test tmw and my diploma is in 5 days
ANYWAYS its cool because it draws over the water that draws over nothing, so when you go below the map you dont see the water plane since the skybox draws over it its so cool

SKYBOXXXXX
i have a massive physics test tmw and my diploma is in 5 days
ANYWAYS its cool because it draws over the water that draws over nothing, so when you go below the map you dont see the water plane since the skybox draws over it its so cool

Replying to @Shuflduf

0
9
Open comments for this post

50m 44s logged

WATER!!!!!!!!!!!!!!!!! IM PROCRASTINATING SCHOOL SO HARD RIGHT NOW!!!!!!!!! BUT IT LOOOKS SOOOO GOOOOOOD!!!!!!!!!!

WATER!!!!!!!!!!!!!!!!! IM PROCRASTINATING SCHOOL SO HARD RIGHT NOW!!!!!!!!! BUT IT LOOOKS SOOOO GOOOOOOD!!!!!!!!!!

Replying to @Shuflduf

0
6
Open comments for this post

1h 24m 56s logged

FINALLY
different textures depending on height
right now theres 4, going from sand, grass, stone (mountain) to snow. and they all have their various blend thesrholds and widths and its so sigma
next step is adding like water or smth

FINALLY
different textures depending on height
right now theres 4, going from sand, grass, stone (mountain) to snow. and they all have their various blend thesrholds and widths and its so sigma
next step is adding like water or smth

Replying to @Shuflduf

0
6
Open comments for this post

40m 8s logged

improve terrain generation, minor refactors, etc etc

This is a video of me flying around the terrain while Chris Christodoulou’s “…con lentitud poderosa” from Risk of Rain 2 plays in it’s entirety.

improve terrain generation, minor refactors, etc etc

This is a video of me flying around the terrain while Chris Christodoulou’s “…con lentitud poderosa” from Risk of Rain 2 plays in it’s entirety.

Replying to @Shuflduf

0
10
Open comments for this post

15m 5s logged

depth buffer was so light
15 minutes like holy
the docs are just that good and wgpu is just that good
code is becoming a mess tho might refactor that soon (again)
it doesnt look very impressive but like the hills IN THE FRONT are IN FRONT of the hills IN THE BACK

depth buffer was so light
15 minutes like holy
the docs are just that good and wgpu is just that good
code is becoming a mess tho might refactor that soon (again)
it doesnt look very impressive but like the hills IN THE FRONT are IN FRONT of the hills IN THE BACK

Replying to @Shuflduf

0
4
Open comments for this post

21m 59s logged

lfkdslfsd vsync
without vsync my laptop just renders so many frames and cpu usage spikes to 10% on idle like wtf
with vsync it goes to a much more reasonable 2%
also grass texture
next step is to add a depth buffer because as you can see some chunks are clipping in front of chunks that are in front of them

lfkdslfsd vsync
without vsync my laptop just renders so many frames and cpu usage spikes to 10% on idle like wtf
with vsync it goes to a much more reasonable 2%
also grass texture
next step is to add a depth buffer because as you can see some chunks are clipping in front of chunks that are in front of them

Replying to @Shuflduf

0
4
Open comments for this post

48m 45s logged

big refactoring

made it so the assets (textures and shaders) are basically created (not really) at compile time, so i can reference them using just their name (ex: “frog”) instead of the relative path from the file its being referenced in (ex: “../../assets/images/frog.png”) AND it lets me make sure the file exists at compile time

AND it makes sure the final binary is completely standalone (i think)

big refactoring

made it so the assets (textures and shaders) are basically created (not really) at compile time, so i can reference them using just their name (ex: “frog”) instead of the relative path from the file its being referenced in (ex: “../../assets/images/frog.png”) AND it lets me make sure the file exists at compile time

AND it makes sure the final binary is completely standalone (i think)

Replying to @Shuflduf

0
6
Open comments for this post

1h 51m 42s logged

implementing terrain now! the code is good now i think

implementing terrain now! the code is good now i think

Replying to @Shuflduf

0
10
Open comments for this post

1h 14m 55s logged

camera system was lowk ass so i fixed it
planning to add Q and E to move up and down relative to camera

camera system was lowk ass so i fixed it
planning to add Q and E to move up and down relative to camera

Replying to @Shuflduf

0
15
Open comments for this post

1h 27m 33s logged

so so so much refactoring
i still don’t think its organized enough

but i got the camera to work so thats cool

so so so much refactoring
i still don’t think its organized enough

but i got the camera to work so thats cool

Replying to @Shuflduf

0
7
Open comments for this post

1h 33m 18s logged

Mostly just refactoring.
I still have almost no idea how wgpu works, but at least everything is organized!
One of the benefits of Factorio is knowing when something should be it’s own module that other parts of the program can interact with.
Instead of having a massive main.rs, i split it up into like 4 different modules, the biggest ones being GpuContext, which handles setting up the wgpu backend stuff, Renderer, which renders stuff through wgpu, and Application, which handles the window management stuff.

Mostly just refactoring.
I still have almost no idea how wgpu works, but at least everything is organized!
One of the benefits of Factorio is knowing when something should be it’s own module that other parts of the program can interact with.
Instead of having a massive main.rs, i split it up into like 4 different modules, the biggest ones being GpuContext, which handles setting up the wgpu backend stuff, Renderer, which renders stuff through wgpu, and Application, which handles the window management stuff.

Replying to @Shuflduf

0
3
Open comments for this post

1h 13m 37s logged

Shapes and stuff! I’m actually making draw calls with like shader info or smth. Buffers are weird I still don’t get them. I got the famous triangle thing and textures both working (not at the same time).
The code is a mess that I no longer understand, and the docs I’ve been relying so much on are outdated for the latest version of wgpu, so that was painful (thank goodness for rust-analyzer).

Next steps are to organize the codebase so that I don’t have a massive 433 line main.rs and to properly understand uniforms and buffers and layouts and primitives and bind groups and views and queues and attachments and

Shapes and stuff! I’m actually making draw calls with like shader info or smth. Buffers are weird I still don’t get them. I got the famous triangle thing and textures both working (not at the same time).
The code is a mess that I no longer understand, and the docs I’ve been relying so much on are outdated for the latest version of wgpu, so that was painful (thank goodness for rust-analyzer).

Next steps are to organize the codebase so that I don’t have a massive 433 line main.rs and to properly understand uniforms and buffers and layouts and primitives and bind groups and views and queues and attachments and

Replying to @Shuflduf

0
158
Open comments for this post

42m 20s logged

Continuing to follow the docs

I’m now sending render passes to the window, which basically draws to the screen. Right now it just clears the screen with a certain color.

Next step would be shaders I think, so I can get a triangle soon

Continuing to follow the docs

I’m now sending render passes to the window, which basically draws to the screen. Right now it just clears the screen with a certain color.

Next step would be shaders I think, so I can get a triangle soon

Replying to @Shuflduf

0
7
Open comments for this post

52m 42s logged

First time using wgpu so I followed the docs to get started with it. So far I have a single window through winit, which should work cross platform on native. Might add web support later.

Next step is getting something on the screen.

First time using wgpu so I followed the docs to get started with it. So far I have a single window through winit, which should work cross platform on native. Might add web support later.

Next step is getting something on the screen.

Replying to @Shuflduf

0
7

Followers

Loading…