mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
wiki update
@@ -18,6 +18,7 @@ This is a place for developers, a hub for documentation and code conventions for
|
|||||||
|
|
||||||
### Rendering
|
### Rendering
|
||||||
* [[Rendering Pipeline]] — Graphics system and tile rendering
|
* [[Rendering Pipeline]] — Graphics system and tile rendering
|
||||||
|
* [[Lighting Engine]] — Lighting and shading simulation
|
||||||
* [[OpenGL Considerations]] — GL 3.2 requirements and shader syntax
|
* [[OpenGL Considerations]] — GL 3.2 requirements and shader syntax
|
||||||
|
|
||||||
### Physics
|
### Physics
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class BlocksDrawer(
|
|||||||
|
|
||||||
### Tile Atlas System
|
### Tile Atlas System
|
||||||
|
|
||||||
Blocks use texture atlases for autotiling variants:
|
Blocks use texture atlantes for autotiling variants:
|
||||||
|
|
||||||
#### Atlas Formats
|
#### Atlas Formats
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ Autotiling tiles have a "barcode" pixel in the atlas (position 6,5) encoding:
|
|||||||
|
|
||||||
### Seasonal Variation
|
### Seasonal Variation
|
||||||
|
|
||||||
224×224 atlases support seasonal colour blending:
|
224×224 atlantes support seasonal colour blending:
|
||||||
|
|
||||||
```
|
```
|
||||||
┌─────────┬─────────┐
|
┌─────────┬─────────┐
|
||||||
@@ -509,7 +509,7 @@ if (actor.hitbox.intersects(camera.bounds)) {
|
|||||||
|
|
||||||
### Texture Atlas
|
### Texture Atlas
|
||||||
|
|
||||||
Use texture atlases to reduce texture switches:
|
Use texture atlantes to reduce texture switches:
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
val atlas = TextureAtlas("sprites/packed.atlas")
|
val atlas = TextureAtlas("sprites/packed.atlas")
|
||||||
@@ -599,7 +599,7 @@ batch.shader = null // Reset to default
|
|||||||
## Best Practises
|
## Best Practises
|
||||||
|
|
||||||
1. **Batch draw calls** — Group similar sprites together
|
1. **Batch draw calls** — Group similar sprites together
|
||||||
2. **Use texture atlases** — Reduce texture binding overhead
|
2. **Use texture atlantes** — Reduce texture binding overhead
|
||||||
3. **Cull off-screen objects** — Don't render invisible actors
|
3. **Cull off-screen objects** — Don't render invisible actors
|
||||||
4. **Cache sprite references** — Don't recreate textures every frame
|
4. **Cache sprite references** — Don't recreate textures every frame
|
||||||
5. **Reset batch colour** — Always reset to white after tinting
|
5. **Reset batch colour** — Always reset to white after tinting
|
||||||
@@ -620,7 +620,7 @@ batch.shader = null // Reset to default
|
|||||||
- Texture binding issues
|
- Texture binding issues
|
||||||
|
|
||||||
### Performance Issues
|
### Performance Issues
|
||||||
- Too many draw calls (use atlases)
|
- Too many draw calls (use atlantes)
|
||||||
- Large lightmap calculations
|
- Large lightmap calculations
|
||||||
- Excessive particle count
|
- Excessive particle count
|
||||||
- Missing culling
|
- Missing culling
|
||||||
|
|||||||
Reference in New Issue
Block a user