Currently grass objects are hardcoded into BSP file and toggled via kill/create, this also means every level tdx file stores a copy of all grass layers to be shown (kinda same in th4 though).
Possible solution:
pre bake various known grass variants from th2x, th4 in separate shared tdx files
mark bsp materials as grass, store grass height param
generate extra mesh at runtime, auto detect amout of layers by loading proper tdx file
grass tdx path can go to level loading struct, if no grass tdx given, can omit grass routines entirely
Texture naming should follow the same convention, like grass<layerNumber_2_digits>.png, this way can swap grass files and keep it compatible. It would also make it as easy as if (GrassEnabled) RenderGrassObjects() without additional scrits on QScript side.
Currently grass objects are hardcoded into BSP file and toggled via kill/create, this also means every level tdx file stores a copy of all grass layers to be shown (kinda same in th4 though).
Possible solution:
Texture naming should follow the same convention, like
grass<layerNumber_2_digits>.png
, this way can swap grass files and keep it compatible. It would also make it as easy asif (GrassEnabled) RenderGrassObjects()
without additional scrits on QScript side.