Ticket #144 (closed task: fixed)

Opened 5 years ago

Last modified 11 months ago

Visualize player controlled units that are hidden behind other objects

Reported by: nicolai Owned by:
Priority: Should Have Milestone: Alpha 5
Component: Game engine Keywords:
Cc:

Description

We need a way to render player controled/obstructed (by trees, walls, terrain) units (player color/filled sillohettes), and some nifty effects to render enemy units hiding in 'trees' (some sort of transparency).

Change History

comment:1 Changed 17 months ago by k776

I think the easiest way to do this would be to have a key that toggles building visibility down to just the base of the building (i.e. you'd see the outline of the building on the ground, but not the walls/roof of the building). This would fix not only the issue of seeing units, but also selecting things like animals behind buildings.

comment:2 Changed 16 months ago by anonymous

  • Milestone Advanced Playability Demo deleted

Milestone Advanced Playability Demo deleted

comment:3 Changed 16 months ago by wacko

  • Milestone set to Backlog

comment:4 Changed 12 months ago by Philip

Hmm, I haven't been able to easily find any documentation of how people usually render unit silhouettes. The only way I can think to do it is:

  • Render all objects which block units (i.e. buildings and terrain and maybe trees) as normal.
  • Render all objects which have silhouettes (i.e. units) as a solid colour, with an inverted Z test (i.e. only draw when they're behind an already-rendered object).
  • Render all objects which have silhouettes as normal, plus any objects we haven't rendered yet.

That means we need to render all unit vertexes twice, but hopefully that won't be too expensive (and it's just a single batch per player colour) and it should be fairly straightforward.

comment:5 Changed 11 months ago by Philip

That won't work, because of alpha blending. Something like this should work better.

comment:6 Changed 11 months ago by philip

  • Status changed from new to closed
  • Resolution set to fixed

(In [9076]) # Render unit silhouettes when behind buildings. Fixes #144. Start using stencil buffer. Simplify materials a little.

comment:7 Changed 11 months ago by k776

  • Milestone changed from Backlog to Alpha 5
Note: See TracTickets for help on using tickets.