Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
421 commits
Select commit Hold shift + click to select a range
bbaa636
Move DoLevelWindow from debug.cpp to editor.cpp
scallyw4g Feb 16, 2025
fccfc36
Remove some now-defunct datatypes and ser/des code
scallyw4g Feb 16, 2025
8cb0aaf
Level import/export nominally working
scallyw4g Feb 18, 2025
ef17288
Remove SoftResetEngine in favor of HardResetEngine and fix NoiseReadb…
scallyw4g Feb 19, 2025
144dc97
Move a couple helper functions into util.h
scallyw4g Feb 19, 2025
e979a77
Fix a block_array bug when contained type is a pointer
scallyw4g Feb 19, 2025
8dd8fdf
Couple minor bugfixes
scallyw4g Feb 19, 2025
c087c37
Update stdlib
scallyw4g Feb 19, 2025
25f0e13
Continue implementing world edit shader
scallyw4g Feb 27, 2025
716caff
Fix some world edits being stale when editing a brush
scallyw4g Feb 27, 2025
3f9a20d
Improve brush layer UI with more information
scallyw4g Feb 27, 2025
9f88060
Cut out a pile of now-dead code
scallyw4g Feb 27, 2025
57de5b3
Implement rect brush in world edit shader
scallyw4g Mar 5, 2025
e4f29a9
Fix a few bugs
scallyw4g Mar 6, 2025
c55ac4f
Get rid of an old boolean that was causing problems
scallyw4g Mar 6, 2025
6ff7ba9
Only re-queue nodes that are going to actually draw
scallyw4g Mar 6, 2025
74d95f5
Readme
scallyw4g Mar 6, 2025
1fff8ab
Sort and apply edits in order
scallyw4g Mar 6, 2025
c3b4978
Properly sort using ordinal on Edit instead of Brush
scallyw4g Mar 6, 2025
62e502b
No longer hard reset editor on terrain shader reload
scallyw4g Mar 6, 2025
1f3bd16
Change world_chunk *PickedChunk -> octree_node *PickedNode
scallyw4g Mar 7, 2025
4c378b3
Load all brushes at startup
scallyw4g Mar 7, 2025
bc5c244
Fix boundary case in world_edit shader
scallyw4g Mar 7, 2025
b995c8f
Add @ui_display_as tag and display world_edit_brush::NameBuf as a CS
scallyw4g Mar 7, 2025
0825b45
Fix chunks flickering when they're still being initialized
scallyw4g Mar 7, 2025
6a40dcc
Clean out some garbage from world_chunk
scallyw4g Mar 7, 2025
5a3adb0
Move voronoi noise into header.glsl and changes to cliffy_hills.fragm…
scallyw4g Mar 7, 2025
a8f7b90
Fix a minor bug with Threshold
scallyw4g Apr 7, 2025
aac4661
Fix two typos in world_edit.fragmentshader
scallyw4g Apr 13, 2025
bc54f9f
Split terrain gen into two phase shaping/decoration.
scallyw4g Apr 14, 2025
8da5f46
Remove a redundant texture and FBO
scallyw4g Apr 14, 2025
9008aeb
Fix InputTex index bug
scallyw4g Apr 14, 2025
7001c5b
Computing normals on the GPU
scallyw4g Apr 15, 2025
d226759
Flip normal so it points the right way
scallyw4g Apr 15, 2025
a818c1c
Change terrain shaping to write into its own texture
scallyw4g Apr 15, 2025
d1bb9b5
Change terrain shaping to operate on 68^3 so the derivatives are correct
scallyw4g Apr 16, 2025
3cb1ef4
Fix calling CosineInterpolatePointSet wrong
scallyw4g Apr 16, 2025
b1ab7e4
Fix order-of-operations bug which let noise readback jobs leak throug…
scallyw4g Apr 16, 2025
c29e4fc
Fix several bugs affecting the world_edit shader execution
scallyw4g Apr 27, 2025
7cfc7cf
Rename LoadShaders -> CompileShaderPair
scallyw4g May 1, 2025
c4fc2cb
Change shader to have a `shader_uniform_buffer` instead of linked lis…
scallyw4g May 1, 2025
ed9f110
Cleanup genereated
scallyw4g May 1, 2025
2194e9e
Back out repro for bug
scallyw4g May 1, 2025
729efc9
Add Layers
scallyw4g May 3, 2025
60fece4
Add enum that drives visible region size
scallyw4g May 3, 2025
32cb400
Change VR to 32 in terrain_gen
scallyw4g May 3, 2025
6779b61
Update stdlib
scallyw4g May 3, 2025
cd39ad0
Add logo
scallyw4g May 4, 2025
7d897d9
Update README
scallyw4g May 4, 2025
575f65b
More screens
scallyw4g May 4, 2025
7e6a4ec
WIP start implementing button bars
scallyw4g May 4, 2025
b82d2f3
Add toolbars
scallyw4g May 4, 2025
d35e8fc
Update README
scallyw4g May 5, 2025
12adc1b
Add sphere brush, dottedboxguy comment pointers
scallyw4g May 5, 2025
cf8d6d0
Update logo style
scallyw4g May 5, 2025
7bfa90c
Rename WorldspaceBasis -> WorldspaceChunkBasis
scallyw4g May 6, 2025
cfed3f2
Remove manually programmed brush layers UI in favor of generated
scallyw4g May 6, 2025
7d2c68e
Add a ui_test example and do some tweaks to improve display of brush …
scallyw4g May 6, 2025
68e9754
Rewrite some groups of buttons with toolbar enums
scallyw4g May 7, 2025
13da189
Update stdlib
scallyw4g May 11, 2025
1b85c81
Respect ui_skip in toggle buttons for enums
scallyw4g May 11, 2025
4644897
Fix Color Picker interaction id collision
scallyw4g May 11, 2025
08b9fed
Improve color picker in brush_settings somewhat
scallyw4g May 11, 2025
b71b2b7
Update stdlib
scallyw4g May 11, 2025
4efaf96
WIP debugging with dottedboxguy
scallyw4g May 11, 2025
ce8e22c
WIP debugging with dbg
scallyw4g May 11, 2025
23ab60c
WIP
scallyw4g May 11, 2025
7da7eea
Cleanup on my machine from the dottedboxguy debug session
scallyw4g May 11, 2025
65439b8
Start implementing layer actions toolbar
scallyw4g May 12, 2025
3fe6a7f
Improve layer UI
scallyw4g May 12, 2025
4baa154
Update readme.md
scallyw4g May 14, 2025
c5e707a
Random fafing in world gen shader
scallyw4g May 13, 2025
f2e5c2d
Implement SDF line
scallyw4g May 13, 2025
bf3af5e
Implement sdf Cylinder
scallyw4g May 14, 2025
209440b
Fix additional axes on Cylinder
scallyw4g May 14, 2025
b69befd
Improve layers panel -- pretty solid at this point
scallyw4g May 19, 2025
b3f9a5f
Tombstone world_edits instead of removing them, refine brush_layer op…
scallyw4g May 19, 2025
b8a9f8a
Add shape_axis
scallyw4g May 19, 2025
7c75723
Improve layers UX further
scallyw4g May 21, 2025
9564a72
Move toolbar enums into bonsai from stdlib
scallyw4g May 21, 2025
f48e6d4
Remove a pile of dead editor code
scallyw4g May 21, 2025
9897cad
Fix editor highlighting
scallyw4g May 22, 2025
5460850
Update stdlib; block_array change; layers panel working
scallyw4g Jun 1, 2025
403cbd5
Fixes for linux
scallyw4g Jun 2, 2025
b6cc307
Update stdlib
scallyw4g Jun 2, 2025
b315442
Multi-select edits nominally working
scallyw4g Jun 4, 2025
e183711
WIP bulk edit edits
scallyw4g Jun 4, 2025
5adaa4e
Editor multi-select and edit nominally working
scallyw4g Jun 4, 2025
de0198a
Factor ModState update code out of DoSelectonModification
scallyw4g Jun 5, 2025
0b709fb
Minor code shuffle and comments
scallyw4g Jun 5, 2025
b46e6aa
Drawing code shuffle
scallyw4g Jun 5, 2025
cb104a4
Much bigness -- multiselect with enclosing selection region working
scallyw4g Jun 5, 2025
87dd9a6
WIP debugging PBO race condition
scallyw4g Jun 6, 2025
47d50c1
Fix a couple bugs
scallyw4g Jun 6, 2025
11c9687
Editor UX improvements
scallyw4g Jun 7, 2025
96c860f
Continue polishing editor UX
scallyw4g Jun 7, 2025
9dc3e2f
Update stdlib
scallyw4g Jun 7, 2025
86edc83
Fix ser/des for levels
scallyw4g Jun 8, 2025
2cbf4c3
Change editor::CurrentBrush to always be set
scallyw4g Jun 8, 2025
8b76f11
Add plane shape
scallyw4g Jun 8, 2025
59231ed
Debug plane shader
scallyw4g Jun 8, 2025
52cf880
Remove some debug code, cleanup plane impl.
scallyw4g Jun 8, 2025
f157668
Fix bogus plane parameter
scallyw4g Jun 9, 2025
390a6f2
Fix assertion when trying to load levels with tombstoned edits
scallyw4g Jun 9, 2025
05883de
Update plane to have an orientation
scallyw4g Jun 9, 2025
a9330df
Rename Axis -> Orientation
scallyw4g Jun 9, 2025
cddaf86
Update stdlib
scallyw4g Jun 9, 2025
bb063cf
Remove some debug drawing code
scallyw4g Jun 9, 2025
47c23a5
Rename Axis->Orientation in shader
scallyw4g Jun 10, 2025
5205d08
Start significant cleaning up of selection code
scallyw4g Jun 10, 2025
5333177
Cleanup edit & layer duplication; respect mutli-select behavior
scallyw4g Jun 10, 2025
05ada12
Change camera rotation controls to RMB
scallyw4g Jun 10, 2025
8894bd0
Remove some dead debug code in editor
scallyw4g Jun 10, 2025
7053645
Muck out some dead members and code from editor, fix a couple minor bugs
scallyw4g Jun 10, 2025
eaae42f
Rejig controls such that ctrl is free for multi-select
scallyw4g Jun 10, 2025
ffbffa3
Highlight all selected edit faces when hovering
scallyw4g Jun 10, 2025
3c8628a
Dynamic selection box sizes
scallyw4g Jun 10, 2025
29ac0cd
Save out SelectedLayerIndex, fix more bugs
scallyw4g Jun 11, 2025
e3d1d01
Fix edit ordering, fix stale edit when reordering
scallyw4g Jun 11, 2025
6856091
Prefer initializing nodes with edits
scallyw4g Jun 11, 2025
8ef533c
Start tightening down SDF interactions
scallyw4g Jun 11, 2025
3139ea8
Fix color not getting applied when BlendMode is Disabled
scallyw4g Jun 11, 2025
3f0b04a
Juggle some members around and polish edit mode interactions
scallyw4g Jun 12, 2025
c768ecf
Tighten down Sphere and Rect SDFs, significantly improve blending int…
scallyw4g Jun 13, 2025
7ac6665
Add Torus
scallyw4g Jun 13, 2025
425a74f
Continue refining editor
scallyw4g Jun 14, 2025
dc0960e
Changed daytime colors to HSV and tune
scallyw4g Jun 14, 2025
b8522c5
Update debug
scallyw4g Jun 14, 2025
c5a3f73
Working on eliminating flashing when editing world
scallyw4g Jun 15, 2025
1a55d7a
Move chunk_flags from world_chunk -> octree_node
scallyw4g Jun 15, 2025
c2edab7
Get rid of HadNoVisibleSurface and cleanup chunk state machine
scallyw4g Jun 16, 2025
e538054
Finally fix intermittently flashing chunks on reinitialization
scallyw4g Jun 16, 2025
101851e
Add terrain_render.cpp and DispatchTerrainShaders()
scallyw4g Jun 16, 2025
6cfaf00
Make 3 ping-pong buffers
scallyw4g Jun 16, 2025
ad50f08
Respect layered_brush::AffectExisting
scallyw4g Jun 17, 2025
a92bb77
Fix camera order-of-operations problem
scallyw4g Jun 17, 2025
561fd59
Cleanup SDFs a little
scallyw4g Jun 17, 2025
e4382bc
Minor debugging/tuning in PushOctreeNodeToPriorityQueue
scallyw4g Jun 20, 2025
549af93
WIP debugging shadow maps
scallyw4g Jun 20, 2025
8730e63
Change lighting shader to use `shader_magic` (so we get hot reload)
scallyw4g Jun 20, 2025
90329cc
Cleanup & polish in stdlib
scallyw4g Jun 20, 2025
f333ff6
Rename MVP -> ViewProjection in shadow map
scallyw4g Jun 20, 2025
010625f
Remove DistanceSquared in DrawLod
scallyw4g Jun 20, 2025
387b47a
Fix some jank : @duplicate_shadow_map_MVP_calculation
scallyw4g Jun 20, 2025
9040d0c
Get rid of opengl and engine_resources globals
scallyw4g Jun 21, 2025
255de62
Update submodules
scallyw4g Jun 21, 2025
891de48
Minor cleanup
scallyw4g Jun 21, 2025
e760997
Remove Global_ThreadStates and make Global_Stdlib primal
scallyw4g Jun 21, 2025
d0d349d
Kill thread_startup_params
scallyw4g Jun 21, 2025
18b8571
Remove Global_ThreadStates
scallyw4g Jun 21, 2025
05420e5
Re-enable context switch tracing
scallyw4g Jun 21, 2025
d04533b
Add assert_fail in stdlib
scallyw4g Jun 21, 2025
749d806
WIP
scallyw4g Sep 11, 2025
0d18936
Update docs
scallyw4g Sep 11, 2025
94400b6
Cleanup terrain shaders, add controls.md
scallyw4g Sep 11, 2025
bc85025
Cleanup
scallyw4g Sep 11, 2025
e4d4e28
Update stdlib
scallyw4g Sep 11, 2025
7da1eaa
Readme and fix 2 terrain shaders
scallyw4g Sep 11, 2025
bf92225
Minor docs updates
scallyw4g Sep 11, 2025
02301d3
Display which terrain shaders are currently selected
scallyw4g Sep 11, 2025
0f83ccb
WIP
scallyw4g Sep 22, 2025
7d36bcf
Updates for all examples to build
scallyw4g Sep 22, 2025
aebf957
Update stdlib
scallyw4g Sep 22, 2025
20bacd1
Asyncify CompileShaderPair
scallyw4g Sep 22, 2025
bd05d70
Update stdlib and draw untextured quad with custom cosine easing shader
scallyw4g Sep 22, 2025
2720744
Minor tweaks getting custom shaders working
scallyw4g Sep 22, 2025
6d9b623
Update stdlib
scallyw4g Sep 29, 2025
ea6a4bc
Update stdlib
scallyw4g Oct 2, 2025
5ea13df
Use updated gpu_element_buffer_handles
scallyw4g Oct 4, 2025
2312057
UI back to baseline functional state
scallyw4g Oct 11, 2025
aff0ccc
Automatically register shaders for hot-reload
scallyw4g Oct 11, 2025
026167a
Fix bugs in MapToFinal
scallyw4g Oct 11, 2025
a374281
Hacking on steep_ravines
scallyw4g Oct 11, 2025
b60bdbc
Random fafing on shader code
scallyw4g Oct 11, 2025
af86b77
Draw nicer line in the easing window
scallyw4g Oct 12, 2025
6fc4abe
Fafing on shaders, add Discord link to readme
scallyw4g Oct 13, 2025
8d2681e
Update stdlib; move towards async_render_pass
scallyw4g Oct 14, 2025
3823f8b
Drive shader_magic and asyncify_render_function from struct defs
scallyw4g Oct 16, 2025
4fd2187
Setup to drive array uniforms
scallyw4g Oct 16, 2025
158a0dd
Plumbing dynamic easing functions to GPU nominally working
scallyw4g Oct 17, 2025
461ab47
Respect shader_uniform::Count in BindEngineUniform
scallyw4g Oct 17, 2025
e809bea
Update stdlib
scallyw4g Oct 17, 2025
b8b202a
Add parent hashing to DoEditorUi interface
scallyw4g Oct 17, 2025
ceb7aac
Add runtime check for Queue in asyncify_render_function
scallyw4g Oct 17, 2025
bc91958
Add ctags.sh
scallyw4g Oct 18, 2025
1c0e433
Update poof; for_datatypes changes
scallyw4g Oct 22, 2025
9ea1807
Update stdlib
scallyw4g Oct 22, 2025
53e21db
WIP
scallyw4g Oct 24, 2025
90d69ec
Update poof
scallyw4g Oct 24, 2025
6856204
Update poof
scallyw4g Oct 24, 2025
71e5b0c
Updated poof, synthesize shader uniforms from struct
scallyw4g Oct 27, 2025
9b7aa47
Random hacking on world gen shaders
scallyw4g Oct 27, 2025
2eabeb3
Setup for sending normal data to CPU
scallyw4g Oct 28, 2025
461469f
Plumb up sending normal data to CPU
scallyw4g Oct 28, 2025
095eb68
Change to per-voxel normals
scallyw4g Oct 28, 2025
3b9e1d2
Optimize BuildWorldChunkMeshFromMarkedVoxels_Naieve (~3m -> 600k)
scallyw4g Oct 28, 2025
ca6cff1
Optimize FinalizeOccupancyMasksFromNoiseValues (7.6m -> 600k)
scallyw4g Oct 28, 2025
c0582f2
Add frustum culling back in
scallyw4g Oct 28, 2025
0b08539
Reinstate frustum culling, fix a race condition at startup
scallyw4g Oct 29, 2025
40c12df
Minor bugfix and optimization in FinalizeOccupancyMasksFromNoiseValues
scallyw4g Oct 29, 2025
ebccb0b
Hunting for bug in LoD'd normals
scallyw4g Oct 29, 2025
5f4912f
Fix overflow in length computation in frustum intersection test
scallyw4g Oct 29, 2025
67568ad
Rework ComputePriorityIndex
scallyw4g Oct 29, 2025
affc02f
Minor tuning
scallyw4g Oct 29, 2025
1c7134f
Fix a bug in "Render Settings" window
scallyw4g Oct 29, 2025
44f1b3c
Make OCTREE_CHUNKS_PER_RESOLUTION_STEP a runtime variable, change dra…
scallyw4g Oct 29, 2025
d93c317
FAFing with world gen
scallyw4g Oct 29, 2025
b0b90a5
More terrain gen hacking
scallyw4g Oct 30, 2025
5b3bd23
Add mountain.png
scallyw4g Oct 30, 2025
71d078f
Add ridgeline.png
scallyw4g Oct 30, 2025
19f5b93
Tuning for release
scallyw4g Oct 30, 2025
7e75f67
Add getting_started.md, erosion terrain shader
scallyw4g Oct 30, 2025
33c5f80
Update issue link
scallyw4g Oct 30, 2025
da84914
Fixup examples
scallyw4g Oct 30, 2025
fd45d8a
Cleanup release packaging
scallyw4g Oct 30, 2025
98d37b5
Update stdlib/debug with new debug arena code
scallyw4g Oct 31, 2025
09723da
Update debug
scallyw4g Oct 31, 2025
23a9726
Remove voxels and voxel lighting from world_chunk
scallyw4g Oct 31, 2025
26f3796
Add triple_buffered and triple-buffer UI
scallyw4g Nov 1, 2025
a2ab4f9
Move to triple buffered UI and Immediate geometry; move to VAOs
scallyw4g Nov 2, 2025
c0c86ff
Profiling
scallyw4g Nov 3, 2025
a72e04f
Split renderer into high/low priority queue
scallyw4g Nov 3, 2025
9288a7b
Update profiler screenshot
scallyw4g Nov 3, 2025
c6553d6
Tuning
scallyw4g Nov 3, 2025
cd10e19
Tuning
scallyw4g Nov 3, 2025
b0ddd53
Homogenize floor height in terrain shaping shaders
scallyw4g Nov 3, 2025
2f41925
Tuning
scallyw4g Nov 3, 2025
a1870d7
Fix total chunk init jobs growing forever if we never get called back
scallyw4g Nov 3, 2025
ea92d17
Tuning
scallyw4g Nov 3, 2025
b23a0c1
Add bent normals back in
scallyw4g Nov 3, 2025
1e99a8c
Couple minor bugfixes
scallyw4g Nov 4, 2025
c8a26e2
Fix a couple init issues
scallyw4g Nov 4, 2025
7435104
Change RenderGate to a futex, fix "Textures" window
scallyw4g Nov 4, 2025
360f757
Hunting for memory leaks and add @do_editor_ui tag to a pile of structs
scallyw4g Nov 4, 2025
b7de446
Fix memory leak in renderer (not deleting VAOs)
scallyw4g Nov 4, 2025
9a9fa93
Add an assertion, call FreeOctreeChildren on soft reload
scallyw4g Nov 4, 2025
31ea706
Remove a shit-ton of stale code from generated/
scallyw4g Nov 4, 2025
21697b6
Fix examples
scallyw4g Nov 4, 2025
c0c255e
Call FreeOctreeChildren before reloading level
scallyw4g Nov 4, 2025
6bc481c
Cleanup node finalize code
scallyw4g Nov 4, 2025
979ba4b
Deallocate stale meshes
scallyw4g Nov 4, 2025
e1bcac9
Fix FinalizeNodeInitializaion getting called early
scallyw4g Nov 4, 2025
536cfd3
Fix out of bounds draw
scallyw4g Nov 4, 2025
3a00fff
Hacking on UI
scallyw4g Nov 5, 2025
43f7fe5
docs/editor.md and do some editor tuning
scallyw4g Nov 5, 2025
f61c025
Fix rect
scallyw4g Nov 5, 2025
2bce637
Tweak Punchy tonemapping, fog, do SplitAndQueueOctreeNodesForInit at …
scallyw4g Nov 5, 2025
5cfe14a
Update stdlib
scallyw4g Nov 5, 2025
df4a6b4
Docs
scallyw4g Nov 5, 2025
2b8981c
Quick linux fixes, readme update
scallyw4g Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ levels/

brushes/_untitled.brush

runtime_settings/*

bin/
tmp/

Expand Down
Binary file added assets/white.bmp
Binary file not shown.
Binary file removed brushes/black_castle_wall.brush
Binary file not shown.
Binary file removed brushes/black_castle_wall_broken.brush
Binary file not shown.
Binary file removed brushes/black_castle_wall_rough.brush
Binary file not shown.
Binary file removed brushes/dirt_path.brush
Binary file not shown.
Binary file removed brushes/eraser.brush
Binary file not shown.
Binary file removed brushes/foliage.brush
Binary file not shown.
Binary file removed brushes/granite_wall.brush
Binary file not shown.
Binary file removed brushes/granite_wall_paint.brush
Binary file not shown.
Binary file removed brushes/grass.brush
Binary file not shown.
Binary file removed brushes/small_gravel.brush
Binary file not shown.
Binary file removed brushes/spackled_base.1.brush
Binary file not shown.
Binary file removed brushes/spackled_base.brush
Binary file not shown.
Binary file removed brushes/spackled_stone.1.brush
Binary file not shown.
Binary file removed brushes/spackled_stone.brush
Binary file not shown.
Binary file removed brushes/spackled_stone_green.1.brush
Binary file not shown.
Binary file removed brushes/spackled_stone_green.brush
Binary file not shown.
Binary file removed brushes/spackled_stone_green2.brush
Binary file not shown.
Binary file removed brushes/stone_path.brush
Binary file not shown.
Binary file removed brushes/test.brush
Binary file not shown.
Binary file removed brushes/vines.brush
Binary file not shown.
Binary file removed brushes/wood_horizontal.brush
Binary file not shown.
Binary file removed brushes/wood_horizontal.brushdw.brush
Binary file not shown.
Binary file removed brushes/wood_vertical.1.brush
Binary file not shown.
Binary file removed brushes/wood_vertical.brush
Binary file not shown.
Binary file removed brushes/wooden_door.1.brush
Binary file not shown.
Binary file removed brushes/wooden_door.brush
Binary file not shown.
4 changes: 4 additions & 0 deletions ctags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /usr/bin/env bash

# This tells ctags abouit the poof macro, which frequently confuses its parser
ctags -R -I poof+ .
25 changes: 25 additions & 0 deletions docs/00_getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# Getting Started

## Prebuilt Binaries

The fastest way to get started with Bonsai is to grab the prebuilt binaries from
the [Latest Releases](../../releases/latest) page. Windows and Linux are supported.


## Running an Example

Bonsai ships with several pre-built example projects, under the `bin/game_libs`
folder. To run an example, simply launch `bin/game_loader.exe` and select the
example from the menu presented. Alternatively, you may specify which example
to run from a command line as an argument. For example,
`bin/game_loader.exe bin/game_libs/terrain_gen_loadable.dll`

## Terrain Generation

The terrain_gen example provides users with a convenient playground for
experimenting with terrain generation. Just fire up your favorite editor,
navigate to `shaders/terrain/shaping/default.fragmentshader`, and edit away!
Terrain shaders hot-reload, so you have a fast edit-compile-run loop for
experimentation.

64 changes: 64 additions & 0 deletions docs/controls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Legend

This is notation for the single keystroke 'a'
```
a
```

This is notation for a single keystroke of any of 'w', 'a', 's', 'd',
```
wasd
```

This is notation for the chord 'Ctrl + s'
```
<C-s>
```

This is notation for the chord 'Alt + Shift + s'
```
<A-S-s>
```


# General

`f1` : toggle debug menu

`escape` : load "project\_and\_level\_picker", or quit

# Camera Controls

`wasd` : move camera on a horizontal plane

`q` : move camera down

`e` : move camera up

hold `rmouse` : rotate camera


# Editor

Select the 'World Edit' tab from the top menu

`<C-s>` : Begin area selection

`lclick` : Finish area selection

`<C-g>` : Center camera on selection

`<C-lclick>` : Multi-select

## With area selected

`<S-lclick>` : Scale along axis

`<S-C-lclick>` : Scale along axis; both sides

`<S-C-A-lclick>` : Scale along all axies

`<A-lclick` : Translate in plane

`<A-C-lclick>` : Translate along axis

51 changes: 51 additions & 0 deletions docs/editor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Editor

To enter world edit mode, select "World Edit" from the menu in the top-left corner
of the screen.

## Brushes

Brushes are the backbone of the world editing system. Brushes describe how a
world edit affects the selected area.

### Creation

To create a brush, select "New" from the "Brush Settings" window.

### Brush Settings Window

Here we'll detail each option in the "Brush Settings window, in order.

* Brush Name
The name of the brush, on disk.

* Layer Count
The number of layers the brush has

* Affect World
Should the brush interact with voxels from world-gen, or strictly voxels from
edits.

---

### ----- LAYERS ------

* Brush Type : Noise | Shape
Changes the type of the brush

* Brush Type(Noise)
* Noise Type : Perlin | Voronoi | White


* Value Modifier
* ClampPos : max(0, sample), after applying ValueBias and Power
* ClampNeg : min(0, sample), after applying ValueBias and Power
* Threshold : Set sample to 0 if it does not pass threshold, before Power and ValueBias
* Discard : Set sample to 0

* Blend Mode
* Additive : output = sample + previous
* Subtractive : output = previous - sample
* Multiply : output = previous * sample
* Threshold : output = sample > threshold ? threshold : sample
* Disabled : output = output
40 changes: 40 additions & 0 deletions docs/world_gen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# World Generation

Terrain generation in Bonsai is composed of several stages, some of which are
user reconfigurable. The stages are as follows:

1. Terrain Shaping
2. Terrain Normal Calculation
3. Terrain Decoration
5. World Edit applications
6. Meshing
7. Drawing


Stages (1) and (3) are easily configurable by users of the engine. There is an
example project named `terrain_gen` that makes it easy to switch between
different shaping and decoration shaders.


## Terrain Shaping

The Terrain Shaping stage is typically responsible for the overall shape of the
terrain. Set the `NoiseValue` and `ColorValue` variables inside the block
marked ` -- user code -- ` to any values you like. A final value above zero is
solid, a value below zero is air.

To add a new Terrain Shaping shader, copy `shaders/terrain/shaping/default.fragmentshader`
to a new file in the same directory.


## Terrain Decoration

The Terrain Decoration stage has the `NoiseValue` and `ColorValue` passed through
from the previous Shaping stage, as well as an additional `NormalValue`, which
is the normal to the surface at that point. The Terrain Decoration stage is
typically used to apply small details, coloring, and texturing to the final terrain.

To add a new Terrain Decoration shader, copy `shaders/terrain/decoration/default.fragmentshader`
to a new filename in the same directory.


7 changes: 7 additions & 0 deletions dottedboxguy.make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /usr/bin/env bash

# OPT="-O2"

./make.sh $OPT \
BuildSingleExample examples/terrain_gen \
BuildExecutables \
10 changes: 5 additions & 5 deletions examples/blank_project/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#define BONSAI_DEBUG_SYSTEM_API 1

#include <bonsai_types.h>

#include <game_constants.h>
#include <game_types.h>

// NOTE(Jesse): This is an optional function that gets called for each worker
Expand Down Expand Up @@ -32,8 +30,10 @@ BONSAI_API_WORKER_THREAD_CALLBACK()
// NOTE(Jesse): Render commands should never end up on a general purpose work queue
InvalidCase(type_work_queue_entry__bonsai_render_command);

case type_work_queue_entry_build_chunk_mesh:
case type_work_queue_entry_finalize_noise_values:
case type_work_queue_entry_async_function_call:
case type_work_queue_entry_update_world_region:
/* case type_work_queue_entry_update_world_region: */
case type_work_queue_entry_rebuild_mesh:
case type_work_queue_entry_init_asset:
case type_work_queue_entry_init_world_chunk:
Expand Down Expand Up @@ -68,9 +68,9 @@ BONSAI_API_MAIN_THREAD_INIT_CALLBACK()
world_position WorldCenter = {};
canonical_position CameraTargetP = {};

StandardCamera(Graphics->Camera, 10000.0f, 1000.0f);
StandardCamera(Graphics->Camera, 30000.0f, 1000.0f);

AllocateWorld(World, WorldCenter, WORLD_CHUNK_DIM, g_VisibleRegion);
AllocateWorld(World, WorldCenter, VisibleRegionSize_128);

GameState = Allocate(game_state, Resources->GameMemory, 1);
return GameState;
Expand Down
15 changes: 0 additions & 15 deletions examples/blank_project/game_constants.h

This file was deleted.

10 changes: 5 additions & 5 deletions examples/project_and_level_picker/game.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include <bonsai_types.h>

#include <game_constants.h>
#include <game_types.h>

BONSAI_API_WORKER_THREAD_CALLBACK()
Expand All @@ -17,8 +15,10 @@ BONSAI_API_WORKER_THREAD_CALLBACK()
Result = True;
} break;

case type_work_queue_entry_build_chunk_mesh:
case type_work_queue_entry_finalize_noise_values:
case type_work_queue_entry_async_function_call:
case type_work_queue_entry_update_world_region:
/* case type_work_queue_entry_update_world_region: */
case type_work_queue_entry_rebuild_mesh:
case type_work_queue_entry_init_asset:
case type_work_queue_entry_copy_buffer_ref:
Expand All @@ -33,9 +33,9 @@ BONSAI_API_MAIN_THREAD_INIT_CALLBACK()
{
UNPACK_ENGINE_RESOURCES(Resources);

AllocateWorld(World, {}, WORLD_CHUNK_DIM, g_VisibleRegion);

AllocateWorld(World, {}, VisibleRegionSize_128);
GameState = Allocate(game_state, Resources->GameMemory, 1);

return GameState;
}

Expand Down
15 changes: 0 additions & 15 deletions examples/project_and_level_picker/game_constants.h

This file was deleted.

Loading
Loading