{"id":2911,"date":"2014-03-10T12:32:16","date_gmt":"2014-03-10T12:32:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/10\/rendering-lightmaps-at-runtime-collection-of-common-programming-errors\/"},"modified":"2014-03-10T12:32:16","modified_gmt":"2014-03-10T12:32:16","slug":"rendering-lightmaps-at-runtime-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/10\/rendering-lightmaps-at-runtime-collection-of-common-programming-errors\/","title":{"rendered":"Rendering lightmaps at runtime-Collection of common programming errors"},"content":{"rendered":"<p>There isn&#8217;t a way to bake lightmaps at runtime using Beast (Unity&#8217;s lightmap engine). Beast only works in the editor. However, you can run editor functions from the command line using <code>-executeMethod<\/code> so if your procedural level was XML you could send it to a server, run an editor method similar to this (javascript):<\/p>\n<pre><code>static void PerformBuild () {\n    Lightmapping.Bake()\n}\n<\/code><\/pre>\n<p>I didn&#8217;t compile this yet, so it might not be all the code neccesary. Here are a few links that I used as a reference:<\/p>\n<p>http:\/\/docs.unity3d.com\/Documentation\/ScriptReference\/Lightmapping.html http:\/\/docs.unity3d.com\/Documentation\/Manual\/CommandLineArguments.html http:\/\/docs.unity3d.com\/Documentation\/Components\/gui-ExtendingEditor.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There isn&#8217;t a way to bake lightmaps at runtime using Beast (Unity&#8217;s lightmap engine). Beast only works in the editor. However, you can run editor functions from the command line using -executeMethod so if your procedural level was XML you could send it to a server, run an editor method similar to this (javascript): static [&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-2911","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2911"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2911\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}