Ticket #936 (new defect)

Opened 9 months ago

prevent MaterialList from rendering light tangents when no normal map in use

Reported by: ArcRiley Owned by:
Priority: High Milestone: beta3
Component: soy._datatypes Version: Trunk
Keywords: Cc:

Description

The current code calculates per-vertex light tangents each frame, regardless of whether a normals map is in use. To fix this, generate only if _hasBumps > 0, and modify this value:

  • increase whenever a Material is added to MaterialList which contains a normals texture
  • increase each MaterialList using a Material when the normals texture is added
  • decrease each MaterialList using a Material when the normals texture is removed
  • decrease whenever a Material containing a normals texture is removed from a MaterialList

Note that materials are added to MaterialList when a face using them is added to a mesh and removed when the last face using that material is removed from a mesh. Or, it should.

Note: See TracTickets for help on using tickets.