Re: Terrain Editing
Posted: 06 Feb 2019, 14:33
So, the terrain texture selection -feature has it's basics done.
PR: https://github.com/OpenMW/openmw/pull/1769
Video showing what it does: https://youtu.be/D7Ya1McDwVw
These related issues (features) are still missing from the current PR.
https://gitlab.com/OpenMW/openmw/issues/3873
https://gitlab.com/OpenMW/openmw/issues/3869
Now thinking about transient change support, I've done a bit of research on how the terrain is drawn, and will post my findings also here. I'm not taking this issue yet, but maybe in the future.
At CSVRender::Cell::updateLand(), in file cell.cpp, mTerrain is used to draw stuff to CellNode, and load cell data, through component TerrainGrid (terraingrid.cpp) which uses component ChunkManager (chunkmanager.cpp) to create a grid of terrain by using component BufferCache (buffercache.cpp) which finally sets the diamond shapes for the vertices. Component ResourceManager is also involved, likely managing also other data than terrain.
Does anyone know if the openmw game engine uses Terrain::ChunkManager (openmw/components/chunkmanager.cpp) to render terrain? I get the feeling that for opencs being able to draw another "altered" terrain layer, the component level (chunkmanager, resourcemanager etc.) might require some changes, but I'd hate to burden the game engine with opencs-stuff. Overloading chunkmanager functions or making separate opencs-functions might do the job.
Another way would be to have two resourcemanagers/chunkmanagers handled by opencs (cell.cpp choosing which to use and when). Calling the new one perhaps TransientChangeResourceManager? One chunk/resourcemanger handling the actual data, another handling the temporary "altered data".
PR: https://github.com/OpenMW/openmw/pull/1769
Video showing what it does: https://youtu.be/D7Ya1McDwVw
These related issues (features) are still missing from the current PR.
https://gitlab.com/OpenMW/openmw/issues/3873
https://gitlab.com/OpenMW/openmw/issues/3869
Now thinking about transient change support, I've done a bit of research on how the terrain is drawn, and will post my findings also here. I'm not taking this issue yet, but maybe in the future.
At CSVRender::Cell::updateLand(), in file cell.cpp, mTerrain is used to draw stuff to CellNode, and load cell data, through component TerrainGrid (terraingrid.cpp) which uses component ChunkManager (chunkmanager.cpp) to create a grid of terrain by using component BufferCache (buffercache.cpp) which finally sets the diamond shapes for the vertices. Component ResourceManager is also involved, likely managing also other data than terrain.
Does anyone know if the openmw game engine uses Terrain::ChunkManager (openmw/components/chunkmanager.cpp) to render terrain? I get the feeling that for opencs being able to draw another "altered" terrain layer, the component level (chunkmanager, resourcemanager etc.) might require some changes, but I'd hate to burden the game engine with opencs-stuff. Overloading chunkmanager functions or making separate opencs-functions might do the job.
Another way would be to have two resourcemanagers/chunkmanagers handled by opencs (cell.cpp choosing which to use and when). Calling the new one perhaps TransientChangeResourceManager? One chunk/resourcemanger handling the actual data, another handling the temporary "altered data".