All projects

Operation: New Terra

In development

Real-time rendering for procedurally generated environments

Operation: New Terra is a single-player bullet-hell roguelike developed by a six-person team using a custom C++ and OpenGL engine. I designed and implemented the rendering system, contributed to the engine architecture, and developed NPC behaviour trees and the boss encounter.

Primary role
Engine development and rendering
Project type
Team project
Technologies
  • C++17
  • OpenGL 3.3
  • GLSL
  • ECS
A player craft beside the grassy bank of a winding river, with barrels reflected in the water
Grassland river bend with the player craft beside the left bank.

Engine architecture

The engine uses an entity-component-system architecture with packed component storage and a fixed 60 Hz simulation. The renderer consumes entity state from the shared registry, interpolating transforms between simulation steps and translating gameplay events into visual effects.

Planar simulation · fixed 60 Hz tick

Gameplay systems

Input, movement and combat

Visual systems

Motion and hit effects

Shared ECS registry

Packed storage by component type · motion, render data and effects

3D presentation · per frame

Registry state

Visual system events

Frame interpolation

Entity position and angle · camera follows interpolated player position

Render effects

Particles, trails and ripples

3D renderer

Meshes, materials and forward passes

Rendering pipeline

We built a multipass forward rendering pipeline to support procedurally generated environments, dynamic lighting and large numbers of instanced objects. The pipeline combines shadow maps, world-space effect textures, planar reflections and atmospheric scattering within an HDR rendering workflow.

Numbered execution order with inputs identified by their source pass.
  1. Directional shadows

    Shadow depth and grass visibility

  2. World-space fields

    Local light, interaction, ripples and trails

  3. Planar reflection

    Mirrored HDR when water is visible

    Inputs

    • Pass 1–2Shadows and light fields
  4. Forward HDR and resolve

    4× MSAA resolves to HDR colour and depth

    Inputs

    • Pass 1–2Shadows and fields
    • Pass 3Reflection
  5. Atmospheric scattering

    Half-resolution scattering and fog opacity

    Inputs

    • Pass 4Resolved depth
  6. Atmospheric particles

    Motes and fireflies blend into resolved HDR

    Inputs

    • Pass 4Resolved HDR and depth
    • Pass 5Fog opacity for motes
  7. Bright extraction and bloom

    Soft threshold and four blurred scales

    Inputs

    • Pass 6HDR with particles
  8. Final composition

    Composite, tone map and grade

    Inputs

    • Pass 5Scattering and fog
    • Pass 6HDR with particles
    • Pass 7Combined bloom

Procedural environments

The generated room and corridor layout provides a shared spatial representation for gameplay and rendering.

Matched room layout and biome overheads
Overhead diagram of connected rooms and corridors with labeled room roles

Grassland and Snowfield share a procedural river descriptor. Flooded Ruins turns the same walkable footprint into raised geometry.

View full resolution

We integrate these bounds with player movement constraints, while the renderer uses the same information to construct biome-specific environments.

BSP generation
Shared room and corridor bounds
Gameplay constraints
Environment rendering
BSP generation implemented by Arashveer Singh Garaya and David Wang.

Instanced environmental geometry

Vegetation follows the Grassland riverbank, and stepped platforms define the walkable geometry in Flooded Ruins.

Grassland riverbank

The same riverbank with the ground surface exposed
Instanced blades cover the riverbank around the craft

The two views share the same camera, terrain and lighting.

Procedural vegetation

Vegetation is generated in deterministic world-space chunks using jittered grid placement. Terrain and river conditions control blade density and height. A padded region around the camera target limits the resident chunks, while budgeted generation and uploads distribute preparation work across frames.

Each chunk draws a shared blade mesh using compact per-instance attributes. Wind and surface interaction deform the blades in the vertex shader.

Vegetation streaming pseudocode
for each queued chunk within frame budget:
    candidates = generateJitteredGrid(chunk)
    instances = applyTerrainAndRiverRules(candidates)
    uploadToReusableBufferRange(instances)

for each resident chunk:
    drawInstanced(sharedBladeMesh, chunk.instances)

Instanced platforms

Flooded Ruins generates stepped base blocks and smaller raised overlay plates from the walkable room and corridor bounds. Instances are grouped into spatial chunks, with a shared cube mesh and per-instance transforms and material variation. The main and mirrored views reuse the resident instance batches.

Layered world-space noise adds rust, grime, and stains. A per-instance seed varies the fine surface detail.

Flooded Ruins platform construction
Cyan room bounds and gold corridor bounds over water

Room bounds in cyan and corridor bounds in gold.

View full resolution
Close view of weathered slab tops and overlapping plates with raised edges
Material detail with overlapping plates and worn slab tops.View full resolution
Stepped platforms and smaller overlay plates meet at a reflective waterway
Room and corridor junction.View full resolution

Environmental motion and interaction

Shared wind field

Close view of white emissive grass tips with soft green motes above the clump
Emissive grass tips and wind-driven motes in the lobby at twilight.

A shared world-space wind field drives grass bending and mote displacement. A signed wave also modulates grass shading, while baseline flutter and drift continue between gusts.

Rendered vegetation at 0.75 s, active gust
0.75 s Active gust
Rendered vegetation at 3.25 s, advancing gust
3.25 s Advancing gust
Rendered vegetation at 6.00 s, calm interval
6.00 s Calm interval

Surface interaction

Player movement writes into persistent world-space textures sampled by terrain and vegetation shaders.

A craft follows a curved path from rippling water onto packed snow
A staged shoreline crossing with extended wake persistence.

Trail history is reprojected into the current mapped region, decayed and combined with new movement stamps. A separate ripple field generates expanding waves at water contact.

Both panels share the same world-space framing. The dashed line marks the edge of water contact, and the packed trail core drives the track visible on the snow.

Chain of ripple rings along the movement path, with a dashed shoreline guide
Ripple intensity 548 × 239
Curved trail core across the same shoreline guide
Packed trail core 548 × 239

Water and atmosphere

Reflections and shafts of scattered sunlight shape the Flooded Ruins scene.

Flooded Ruins light shafts

The same flooded arena with ordinary fog and surface lighting visible
Scattered sunlight crosses the slabs and water between submerged statues

The disabled state removes shaft scattering and shaft-specific fog modulation while retaining ordinary fog and surface lighting.

Planar reflections

Grassland and Snowfield use a procedural river, while Flooded Ruins places a continuous water surface beneath its raised platforms. A mirrored camera renders eligible scene geometry into a half-resolution HDR target. The water shader projects its surface into the reflected view and perturbs the reflection lookup using animated waves and interaction ripples.

Depth-aware light shafts

Atmospheric lighting is evaluated at half resolution along camera rays clipped by scene depth and a bounded height volume. Each sample projects along the light direction into a moving world-space cloud pattern. The integrated visibility is shaped into volumetric shafts, with separate fog opacity and scattering contributions.

S = Σ(wiVi) / Σwiwi = qi(1 − q)ρ(zi)q = exp(−σΔ)
Simplified visibility integration before beam shaping. Vi is projected cloud visibility, ρ(zi) is height-dependent density, and q is per-step transmission.

Flooded Ruins render targets

Display-mapped intermediate targets from the earlier capture shown alongside its matched final frame.

Flooded Ruins render targets
Finished Flooded Ruins frame with reflected statues, slab platforms and a shaft of light

Matched final · 1280 × 720

View full resolution

Day–night and ambient lighting

A continuous day–night cycle controls directional and ambient lighting, environmental colour, atmospheric parameters and exposure. Emissive vegetation and wind-driven motes add detail at twilight, while pulsing fireflies contribute localized illumination at night.

Lobby time of day
Low morning light casts long shadows across the lobby

The lobby from the same camera at four points in the lighting cycle.

View full resolution

Firefly population and illumination

Seeded world-space cells place isolated fireflies and groups. Selected individuals and weighted group centres contribute illumination. Sprites and lights share pulse timing.

Firefly diagnostics
Overhead view of the Grassland riverbank at night with fireflies

Matched overhead views of the Grassland riverbank.

View full resolution
1,000 world units
+X right · +Y up

Lighting, emission and bloom use stock settings.

Submitted sprites
72
Individual lights
19
Group lights
8
Firefly pulse timing
Two normalized plots over sixteen seconds. The upper plot shows the selected emitter’s carrier and flicker. The lower plot compares its shared sprite and light pulse with a second sprite in the group.

Upper plot

  • Slow carrier
  • Faster flicker

Lower plot

  • Selected sprite and light
  • Second sprite in group
  • Map capture at 3.833 s

World-space lighting and HDR

Projectile volleys and fireflies cast local light on the riverbank at night.

Nighttime illumination

The same airborne projectiles and fireflies glow above a darker riverbank
Red projectile light spills onto grass and the guard ring, with warm firefly light nearby

The off state disables accumulated projectile and firefly illumination. Projectile emission, visible fireflies, ordinary scene lighting, atmosphere and bloom remain.

Accumulated local illumination

Projectiles and fireflies contribute light through additive stamps into floating-point world-space textures. Surface shaders sample these accumulated fields by world position, illuminating nearby grass, ground, water and meshes independently of the emitters’ visible glow.

L(x) = Σ ciwi(x)
Each emitter contributes colour ci through a spatially weighted stamp wi.

Different fields support different material responses. The mesh field also retains height information for an approximate receiver response.

World-space light fields

Display-mapped targets from the enabled state.

Red projectile stamps scattered across the world-space interaction field
Projectile interaction 1024²
Pools of warm firefly light in the world-space firefly field
Firefly illumination 512²
Projectile and firefly light combined in the world-space field sampled by meshes
Combined mesh illumination 512²

HDR and bloom

Emissive geometry and lighting accumulate in an HDR scene buffer. Bright regions are extracted and blurred across four scales before contributing to the final composite, which is mapped into the display range using the Uchimura tone curve.

Display-mapped camera-space targets from the same enabled frame.

Matched HDR and bloom views
Nighttime riverbank with projectile and firefly lighting, atmosphere and bloom

Final composite of the enabled frame.

View full resolution

Boss encounter

The boss is implemented as a coordinated multi-entity encounter, with a central core, linked guards and attackers. A state machine manages behaviour transitions, timed skills and formation changes, while parameterized projectile emission produces structured bullet patterns.

A craft dashes between spiral projectiles above the flooded slab arena
Flooded Ruins. The craft dashes between spiral volleys as the guard ring retracts.View full resolution
The boss core and two attackers flank a craft dashing across the snow
Snowfield. The core pursues from one side while two attackers fire from the other.View full resolution

Behaviour architecture

Normal behaviour

Core drift, guard orbit and repositioning attackers

Queue a skill after more than 8 seconds in normal behaviour, with a permanent guard alive and the cooldown clear.

Skill entry

Enter a randomly chosen skill on the next tick, reset weapons and timer, set formation

Ring formation

Execute for 6.5 s

Corner formation

Execute for 5 s

Cleanup on timeout

Remove temporary parts and queue normal behaviour with a 4 s cooldown that counts down in normal behaviour

Independent encounter conditions

Health phase

At or below 50% core health, enter phase two and replenish permanent guards to four

Core vulnerability

The core can take damage when no permanent guards survive

Projectile generation

Successive volleys rotate their launch directions to form spiral patterns. Individual projectiles travel along straight paths at constant velocity. The apparent curvature emerges from the distribution of projectiles emitted over time.

One projectile over time

Constant velocity · 500 world units/s

A tracked projectile moves along one straight line from launch to 3.17 seconds

Eleven volleys at one instant

Six shots per volley · launch angle turns 4.17° per volley

Snapshot of six spiral arms. The tracked shot lies at the outer end of the dashed guide through successive volleys, with the most recent volley near the centre.
  • Tracked projectile
  • Successive shots along one arm
  • Other projectiles
Reconstruction of a representative stationary attacker using stock projectile parameters.Bullet pattern implementation by Arashveer Singh Garaya and Randiv Adhihetty.

Team and credits

Operation: New Terra was developed by shoot shoot shoot studios, with contributions across engine development, rendering, physics, procedural generation, gameplay, NPC systems and user interface development.

  • Kehan Hettiarachchi
  • Arashveer Singh Garaya
  • David Wang
  • Randiv Adhihetty
  • Ronaldo Kanegae Penha
  • Delsther James Edralin

Asset acknowledgments

Game assets from Kenney. The layout diagram uses Inconsolata, designed by Raph Levien and distributed under the SIL Open Font License 1.1.