Fix lighting of units in FoW, with shadows enabled
Get some objects to render in fog-of-war (i.e. explored but not still visible). With shadows disabled, they look much darker than objects in visible regions. With shadows enabled, they look almost the same as in visible regions.
The dark colour is set via CModel::SetShadingColor
. It looks like PlainRenderModifier
applies the shading colour to ambient+diffuse via ModelRenderer::BuildColor4ub
, whereas PlainLitRenderModifier
applies it only to diffuse and then applies shadow and then adds ambient. It'd probably be okay if the shading colour was folded into the ambient value.
Need to make sure this works for all the other variations of the renderer (player colour, transparency, shader vs FF).
Change History
(10)
Milestone: |
Alpha 4 → Alpha 5
|
Milestone: |
Alpha 5 → Alpha 6
|
Milestone: |
Alpha 6 → Alpha 7
|
Owner: |
set to philip
|
Priority: |
Should Have → If Time Permits
|
Milestone: |
Alpha 7 → Alpha 8
|
Milestone: |
Alpha 8 → Alpha 9
|
Milestone: |
Alpha 9 → Backlog
|
Description: |
modified (diff)
|
Resolution: |
→ wontfix
|
Status: |
new → closed
|
The problem now is when
renderpath=fixed
- objects in fog-of-war are fully bright. Maybe a reasonable solution is for the renderer to sample the LOS texture and multiply the object shading colour by that, rather than having the renderer query the simulation state directly or having the simulation code compute the rendering colour itself.