{"id":70,"date":"2020-08-26T06:08:02","date_gmt":"2020-08-26T06:08:02","guid":{"rendered":"https:\/\/blogs.scummvm.org\/gunnar\/?p=70"},"modified":"2022-05-26T06:08:34","modified_gmt":"2022-05-26T06:08:34","slug":"wrapping-it-up","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/gunnar\/2020\/08\/26\/wrapping-it-up\/","title":{"rendered":"Wrapping it up"},"content":{"rendered":"<div class=\"entry-content\">\n<p>GSoC is almost over, less than a week now. Time to wrap things up and have a look at what has been done and what is still missing.<\/p>\n<p>The overall goal was to bring the 3d functionality of the original Wintermute Engine to ResidualVM after the 2d parts had already been ported to ScummVM during previous GSoC events (based on Wintermute Lite instead), using OpenGL. Major steps include:<\/p>\n<p>Rendering of 2d sprites using OpenGL. Also adding some of the 2d transformations supported by WME. Some functions are still not implemented although it is not clear if a 3d game is actually using them.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1643\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1643<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1651\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1651<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1674\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1674<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1678\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1678<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1679\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1679<\/a><\/p>\n<p>Loading of scene geometry and camera settings from a .3ds file and being able to display it for debugging purposes. A lot of the code here was taken from the original engine and adjusted where necessary. The .3ds loader was written from scratch as well as all OpenGL code.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1647\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1647<\/a><\/p>\n<p>Loading of models from a .X file, rendering and animating such models. In the first PR, again a lot of code was integrated from WME with minor adjustments (changing the math code or everything related to coordinate systems, for example). Most of my work consisted of the .X loader and everything mesh related like rendering and animation updates of the mesh. The first PR also contains some work related to path-finding. Again, a lot of the code was imported here but parts of it had to be changed.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1649\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1649<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1662\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1662<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1663\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1663<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1665\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1665<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1666\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1666<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1668\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1668<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1670\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1670<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1672\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1672<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1676\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1676<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1680\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1680<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1681\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1681<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1682\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1682<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1683\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1683<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1684\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1684<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1686\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1686<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1687\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1687<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1688\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1688<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1689\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1689<\/a><\/p>\n<p>Object selection and attachment of items to 3d actors.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1653\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1653<\/a><\/p>\n<p>Lighting and shadows. Lights are loaded from a .3ds file and set accordingly to script input. Stencil shadow volumes have been implemented and seem to be very stable. Shadow mapping, as supported by the original engine is still missing. Simple shadow textures which are displayed at the position of an actor are implemented but potentially buggy.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1657\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1657<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1669\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1669<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1691\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1691<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1692\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1692<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1671\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1671<\/a><\/p>\n<p>A shader based renderer has been implemented and the a 3d renderer interface was added to make the rest of the code independent of the specific renderer. Plenty of shader related stuff can be found in the above mentioned PR\u2019s as missing function were implemented or bugs fixed only after the renderer was added.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1659\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1659<\/a><\/p>\n<p>Persistence for the ported 3d classes was implemented in a way that there would be compability between savefiles of ScummVM and ResidualVM.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1655\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1655<\/a><\/p>\n<p>Some somewhat unrelated PR\u2019s, mainly smaller fixes and cleanup of the code.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1660\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1660<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1661\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1661<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1664\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1664<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1667\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1667<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1677\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1677<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1690\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1690<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1693\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1693<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1697\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1697<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1698\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1698<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1699\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1699<\/a><\/p>\n<p>The following PR did not go directly in ResidualVM, but first into ScummVM and was then synchronized as the fixes touched the common code between the two Wintermute ports.<\/p>\n<p><a href=\"https:\/\/github.com\/scummvm\/scummvm\/pull\/2345\">https:\/\/github.com\/scummvm\/scummvm\/pull\/2345<\/a><\/p>\n<p>This PR was just about integrating the existing ScummVM port into ResidualVM, so none of this code was actually written by me. It is included here for completeness sake.<\/p>\n<p><a href=\"https:\/\/github.com\/residualvm\/residualvm\/pull\/1644\">https:\/\/github.com\/residualvm\/residualvm\/pull\/1644<\/a><\/p>\n<h3>Displayable results<\/h3>\n<p>The Wintermute games \u201cAlpha Polaris\u201d and \u201cMental Repair\u201d have been successfully completed with the current port. The graphical output matches the original, at least to my current knowledge.<\/p>\n<h3>Known issues<\/h3>\n<p>Shadow mapping is used by a lot of games instead of shadow volumes and was not implemented, as mentioned above.<\/p>\n<p>Sorting of rendered objects does not work correctly in some games, meaning that objects appear in the wrong order on the screen. At least in one case this seems to be related to viewport settings and 2d &lt;-&gt; 3d coordinate transformation. Also there seem to be issues with general 3d object transformations, leading to models being placed incorrectly on the screen or in the wrong position.<\/p>\n<p>One game uses an unknown blend mode.<\/p>\n<p>Viewport settings are still incomplete and don\u2019t handle mismatches between requested dimensions by games and actual window sizes. The original has some code here which should be ported as well.<\/p>\n<h3>Future plans<\/h3>\n<p>I plan to tackle the above issues after taking a break from the code base for a few weeks and depending on how much spare time I will have available. Complete support for all Wintermute 3D games will probably be a more long term task, although I kind of like the idea of maintaining such a project.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>GSoC is almost over, less than a week now. Time to wrap things up and have a look at what has been done and what is still missing. The overall goal was to bring the 3d functionality of the original Wintermute Engine to ResidualVM after the 2d parts had already been ported to ScummVM during [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/comments?post=70"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":72,"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/posts\/70\/revisions\/72"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/media?parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/categories?post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/gunnar\/wp-json\/wp\/v2\/tags?post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}