Skip to content

Commit

Permalink
Update docs; Fix clearing import
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Jan 6, 2025
1 parent e09d684 commit 76ef290
Show file tree
Hide file tree
Showing 14 changed files with 242 additions and 70 deletions.
1 change: 1 addition & 0 deletions Terrain3D.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<None Include="doc\docs\nightly_builds.md" />
<None Include="doc\docs\press.md" />
<None Include="doc\docs\data_format.md" />
<None Include="doc\docs\heightmaps.md" />
<None Include="doc\docs\texture_painting.md" />
<None Include="doc\docs\user_interface.md" />
<None Include="doc\index.rst" />
Expand Down
3 changes: 3 additions & 0 deletions Terrain3D.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@
<None Include="project\addons\terrain_3d\extras\minimum.gdshader">
<Filter>4. Shaders</Filter>
</None>
<None Include="doc\docs\heightmaps.md">
<Filter>2. Docs</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include=".readthedocs.yaml">
Expand Down
6 changes: 3 additions & 3 deletions doc/api/class_terrain3d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1104,13 +1104,13 @@ The main caveats of using this mode is that the call to get_intersection() reque



This mode can also be used by your plugins and games, such as a space ship firing lasers at the terrain and causing an explosion at the hit point. However if the calls aren't continuous, you'll need to call once to capture the viewport image, wait for it to be drawn, then call again to get the result:
This mode can also be used by your plugins and games, such as a space ship firing lasers at the terrain and causing an explosion at the hit point. However if the calls aren't continuous, eg driven by the mouse, you'll need to call once to capture the viewport image, wait for it to be drawn, then call again to get the result:

::

var target_point = terrain.get_intersection(camera_pos, camera_dir)
var target_point = terrain.get_intersection(camera_pos, camera_dir, true)
await RenderingServer.frame_post_draw
target_point = terrain.get_intersection(camera_pos, camera_dir)
target_point = terrain.get_intersection(camera_pos, camera_dir, true)



Expand Down
2 changes: 1 addition & 1 deletion doc/api/class_terrain3ddata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ Returns ``Vector3(base texture id, overlay id, blend value)``.

Returns ``Vector3(NAN, NAN, NAN)`` if the position is a hole or outside of defined regions.

This is often used for playing footstep sounds. It's up to the gamedev to determine which is visually apparent based on shader settings.
This is often used for playing sounds on footsteps. It's up to the gamedev to determine which is visually apparent based on shader settings.

Due to blending, it won't be pixel perfect. Try having your player controller print this value while walking around to see how the blending values look. Perhaps you'll find that the overlay texture is visible starting at a blend value of .3 to .5, otherwise the base is visible. You can also observe the control blend debug view with :ref:`Terrain3DMaterial.show_control_blend<class_Terrain3DMaterial_property_show_control_blend>`.

Expand Down
2 changes: 1 addition & 1 deletion doc/doc_classes/Terrain3DData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
<description>
Returns [code skip-lint]Vector3(base texture id, overlay id, blend value)[/code].
Returns [code skip-lint]Vector3(NAN, NAN, NAN)[/code] if the position is a hole or outside of defined regions.
This is often used for playing footstep sounds. It's up to the gamedev to determine which is visually apparent based on shader settings.
This is often used for playing sounds on footsteps. It's up to the gamedev to determine which is visually apparent based on shader settings.
Due to blending, it won't be pixel perfect. Try having your player controller print this value while walking around to see how the blending values look. Perhaps you'll find that the overlay texture is visible starting at a blend value of .3 to .5, otherwise the base is visible. You can also observe the control blend debug view with [member Terrain3DMaterial.show_control_blend].
Observing how this is done in The Witcher 3, there are only about 6 sounds used (snow, foliage, dirt, gravel, rock, wood), and except for wood, they are not pixel perfect. Wood is easy to do by detecting if the player is walking on wood meshes. The other 5 sounds are played when the player is in an area where the textures are blending. So it might play rock while over a dirt area. This shows pixel perfect accuracy is not important. It will still provide a seamless audio visual experience.
</description>
Expand Down
1 change: 1 addition & 0 deletions doc/docs/controlmap_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ We process each uint32 pixel as a bit field with the following definition, start
* We use a FORMAT_RF 32-bit float Image or Texture to allocate the memory. Then in C++, we read or write each uint32 pixel directly into the "float" memory. The values are meaningless when interpreted as floats. We don't convert the integer values to float, so there is no precision loss. Godot shaders support usamplers so we can interpret the memory directly as uint32, without requiring any conversion.
* Gamedevs can use the conversion and testing functions found in Terrain3DUtil defined in [C++](https://github.com/TokisanGames/Terrain3D/blob/main/src/terrain_3d_util.h) and [GDScript](../api/class_terrain3dutil.rst).
* Possible future plans for reserved bits:
* 2 bits - Hole and Navigation might be stored elsewhere, freeing up 2 bits
* 5 bits - 32 paintable particles
* 3 bits - paintable slope array index+
* 2 bits - 4 layers (including Hole above, eg water, non-destructive, hole, normal mesh)
Expand Down
5 changes: 3 additions & 2 deletions doc/docs/games.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ Terrain3D is being used in the following games. To add yours, submit it to the #
| [Pest Apocalypse](https://store.steampowered.com/app/2506810/Pest_Apocalypse/) | [Kikimora Games](https://x.com/KikimoraGames) | Post-apocalyptic pizza delivery
| [Forg](https://store.steampowered.com/app/2807130/Forg/) | [Crow Games](https://www.youtube.com/@crowgamesdev) | FPS tower defense
| [open-fpsz](https://gitlab.com/open-fpsz/open-fpsz) | [anyreso](https://mastodon.gamedev.place/@anyreso) | Open-source, Tribes-like FPS multiplayer shooter
| [Element](https://devanew.itch.io/element) | [Luke Aaron](https://www.youtube.com/watch?v=b18jDnY1YS4) | Gamejam FPS tactial shooter

## Tech Demos
## Demos

| Game | Studio | Description |
|------|--------|-------------|
| [Landscape Demo](https://github.com/OverfortGames/LandscapeDemo) | [Overfort Games](https://x.com/OverfortGames) | Island demo w/ source
| [Island Demo](https://github.com/OverfortGames/LandscapeDemo) | [Overfort Games](https://x.com/OverfortGames) | Island demo w/ source
| [Jungle Demo](https://wrobot.itch.io/jungledemo) | [WrobotGames](https://x.com/wrobot123) | Godot rendering demo in a jungle
Loading

0 comments on commit 76ef290

Please sign in to comment.