Opened 18 years ago

Closed 13 years ago

Last modified 13 years ago

#144 closed task (fixed)

Visualize player controlled units that are hidden behind other objects

Reported by: Nicolai Hähnle Owned by:
Priority: Should Have Milestone: Alpha 5
Component: Core engine Keywords:
Cc: Patch:

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 (7)

comment:1 by Kieran P, 14 years ago

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 by (none), 14 years ago

Milestone: Advanced Playability Demo

Milestone Advanced Playability Demo deleted

comment:3 by Andrew, 14 years ago

Milestone: Backlog

comment:4 by Philip Taylor, 13 years ago

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 by Philip Taylor, 13 years ago

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

comment:6 by philip, 13 years ago

Resolution: fixed
Status: newclosed

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

comment:7 by Kieran P, 13 years ago

Milestone: BacklogAlpha 5
Note: See TracTickets for help on using tickets.