DarkRadiant: master 1704aeb7

Author Committer Branch Timestamp Parent
orbweaver orbweaver master 11.06.2024 19:20 master 66f7882c
Affected Issues  0005718: Vertex blended model material unable to support two bumpmaps.
Changeset 0005718: fix rendering of vertex blend between two materials

This required fixes in two places:

- Remove the sorting of material stages in OpenGLShader, which placed
  ALL bump maps before ALL diffuse maps. This discarded vital
  information about which pairs or triplets of maps needed to be bound
  together in interaction passes. Sorting of bump maps before diffuse
  maps is necessary, but this must be done by the artist in the MTR
  decl, otherwise the engine will not render the blend correctly.
- When we assemble the maps into D/B/S triplets in the RegularLight
  rendering code, treat bump maps as "delimiters" which start a new
  interaction pass (via a new clear() method). If we don't do this we
  end up with unwanted extra passes: a MTR which declares a sequence
  {B1, D1, B2, D2} generates interaction passes {B1, D1}, {D1, B2},
  {B2, D2} which gives the wrong result.

Note that 0005718 is actually a Dark Mod bug, but the investigation led to
the discovery of this incorrect rendering behaviour in DarkRadiant. The
actual engine renderer seems to produce correct results provided the
material stages are correctly sorted bumpmap-first in the decl.
mod - include/ishaderlayer.h Diff File
mod - radiantcore/rendersystem/backend/OpenGLShader.cpp Diff File
mod - radiantcore/rendersystem/backend/RegularLight.cpp Diff File
mod - radiantcore/rendersystem/backend/RegularLight.h Diff File