{"action":"created","comment":{"url":"https://api.github.com/repos/ros-visualization/rviz/pulls/comments/114187036","pull_request_review_id":35633045,"id":114187036,"diff_hunk":"@@ -59,9 +59,162 @@\n namespace rviz\n {\n \n+// helper class to set alpha parameter on all renderables.\n+class AlphaSetter: public Ogre::Renderable::Visitor\n+{\n+public:\n+  AlphaSetter( float alpha )\n+  : alpha_vec_( alpha, alpha, alpha, alpha )\n+  {}\n+\n+  void visit( Ogre::Renderable *rend, ushort lodIndex, bool isDebug, Ogre::Any *pAny=0)\n+  {\n+    rend->setCustomParameter( ALPHA_PARAMETER, alpha_vec_ );\n+  }\n+private:\n+  Ogre::Vector4 alpha_vec_;\n+};\n+\n+\n+Swatch::Swatch(MapDisplay* parent, unsigned int x, unsigned int y, unsigned int width, unsigned int height, float resolution)\n+  : parent_(parent), manual_object_( NULL ), x_(x), y_(y), width_(width), height_(height)\n+{\n+  // Set up map material\n+  static int material_count = 0;\n+  std::stringstream ss;\n+  ss << \"MapMaterial\" << material_count++;\n+  material_ = Ogre::MaterialManager::getSingleton().getByName(\"rviz/Indexed8BitImage\");\n+  material_ = material_->clone( ss.str() );\n+\n+  material_->setReceiveShadows(false);\n+  material_->getTechnique(0)->setLightingEnabled(false);\n+  material_->setDepthBias( -16.0f, 0.0f );\n+  material_->setCullingMode( Ogre::CULL_NONE );\n+  material_->setDepthWriteEnabled(false);\n+\n+  static int map_count = 0;\n+  std::stringstream ss2;\n+  ss2 << \"MapObject\" << map_count++;\n+  manual_object_ = parent_->scene_manager_->createManualObject( ss2.str() );\n+\n+  static int node_count = 0;\n+  std::stringstream ss3;\n+  ss3 << \"NodeObject\" << node_count++;\n+\n+  scene_node_ = parent_->scene_node_->createChildSceneNode(ss3.str());\n+  scene_node_->attachObject( manual_object_ );\n+\n+  manual_object_->begin(material_->getName(), Ogre::RenderOperation::OT_TRIANGLE_LIST);\n+  {\n+    // First triangle\n+    {\n+      // Bottom left\n+      manual_object_->position( 0.0f, 0.0f, 0.0f );\n+      manual_object_->textureCoord(0.0f, 0.0f);\n+      manual_object_->normal( 0.0f, 0.0f, 1.0f );\n+\n+      // Top right\n+      manual_object_->position( 1.0f, 1.0f, 0.0f );\n+      manual_object_->textureCoord(1.0f, 1.0f);\n+      manual_object_->normal( 0.0f, 0.0f, 1.0f );\n+\n+      // Top left\n+      manual_object_->position( 0.0f, 1.0f, 0.0f );\n+      manual_object_->textureCoord(0.0f, 1.0f);\n+      manual_object_->normal( 0.0f, 0.0f, 1.0f );\n+    }\n+\n+    // Second triangle\n+    {\n+      // Bottom left\n+      manual_object_->position( 0.0f, 0.0f, 0.0f );\n+      manual_object_->textureCoord(0.0f, 0.0f);\n+      manual_object_->normal( 0.0f, 0.0f, 1.0f );\n+\n+      // Bottom right\n+      manual_object_->position( 1.0f, 0.0f, 0.0f );\n+      manual_object_->textureCoord(1.0f, 0.0f);\n+      manual_object_->normal( 0.0f, 0.0f, 1.0f );\n+\n+      // Top right\n+      manual_object_->position( 1.0f, 1.0f, 0.0f );\n+      manual_object_->textureCoord(1.0f, 1.0f);\n+      manual_object_->normal( 0.0f, 0.0f, 1.0f );\n+    }\n+  }\n+  manual_object_->end();\n+\n+  scene_node_->setPosition( x*resolution, y*resolution, 0 );\n+  scene_node_->setScale( width*resolution, height*resolution, 1.0 );\n+\n+  if( parent_->draw_under_property_->getValue().toBool() )\n+  {\n+    manual_object_->setRenderQueueGroup(Ogre::RENDER_QUEUE_4);\n+  }\n+\n+  // don't show map until the plugin is actually enabled\n+  manual_object_->setVisible( false );\n+\n+\n+}\n+\n+Swatch::~Swatch()\n+{\n+    delete manual_object_;","path":"src/rviz/default_plugin/map_display.cpp","position":105,"original_position":105,"commit_id":"14c290ccb6c0686597f10e6d1a6caec19cb7b0d1","original_commit_id":"14c290ccb6c0686597f10e6d1a6caec19cb7b0d1","user":{"login":"wjwwood","id":100427,"avatar_url":"https://avatars2.githubusercontent.com/u/100427?v=3","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"body":"I think this should probably use http://www.ogre3d.org/docs/api/1.8/class_ogre_1_1_scene_manager.html#a75d15c3ac882f78f0001d9d007f403be","created_at":"2017-05-01T19:48:10Z","updated_at":"2017-05-01T20:01:53Z","html_url":"https://github.com/ros-visualization/rviz/pull/1007#discussion_r114187036","pull_request_url":"https://api.github.com/repos/ros-visualization/rviz/pulls/1007","_links":{"self":{"href":"https://api.github.com/repos/ros-visualization/rviz/pulls/comments/114187036"},"html":{"href":"https://github.com/ros-visualization/rviz/pull/1007#discussion_r114187036"},"pull_request":{"href":"https://api.github.com/repos/ros-visualization/rviz/pulls/1007"}}},"pull_request":{"url":"https://api.github.com/repos/ros-visualization/rviz/pulls/1007","id":70053555,"html_url":"https://github.com/ros-visualization/rviz/pull/1007","diff_url":"https://github.com/ros-visualization/rviz/pull/1007.diff","patch_url":"https://github.com/ros-visualization/rviz/pull/1007.patch","issue_url":"https://api.github.com/repos/ros-visualization/rviz/issues/1007","number":1007,"state":"open","locked":false,"title":"Create multiple textures if map doesn't fit in a single texture","user":{"login":"DLu","id":1016143,"avatar_url":"https://avatars2.githubusercontent.com/u/1016143?v=3","gravatar_id":"","url":"https://api.github.com/users/DLu","html_url":"https://github.com/DLu","followers_url":"https://api.github.com/users/DLu/followers","following_url":"https://api.github.com/users/DLu/following{/other_user}","gists_url":"https://api.github.com/users/DLu/gists{/gist_id}","starred_url":"https://api.github.com/users/DLu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DLu/subscriptions","organizations_url":"https://api.github.com/users/DLu/orgs","repos_url":"https://api.github.com/users/DLu/repos","events_url":"https://api.github.com/users/DLu/events{/privacy}","received_events_url":"https://api.github.com/users/DLu/received_events","type":"User","site_admin":false},"body":"If you attempt to display a large `rviz::Map`, and your graphics card is not super-powerful, it will downsample your map. \r\n```\r\n[ WARN] [1487954079.336034022]: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture MapTexture0 face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at /build/buildd/ogre-1.8-1.8.1+dfsg/RenderSystems/GL/src/OgreGLTexture.cpp (line 420)\r\n[ WARN] [1487954079.336585615]: Failed to create full-size map texture, likely because your graphics card does not support textures of size > 2048.  Downsampling to [2048 x 1314]...\r\n```\r\n![world1](https://cloud.githubusercontent.com/assets/1016143/23311940/d3b92bf2-fa85-11e6-9414-93aa9d8abfc8.png)\r\n\r\nYou can get around the limitations of your graphics card by creating multiple objects, each with their own texture, which I call Swatches. The result:\r\n![world2](https://cloud.githubusercontent.com/assets/1016143/23311978/0123c1d8-fa86-11e6-8ac2-bad5387e9fac.png)\r\n\r\nHere is my sample data:\r\n[the_world.png](https://cloud.githubusercontent.com/assets/1016143/23312007/20bec2d6-fa86-11e6-8683-2f760f0ea0ee.png)\r\n\r\n[the_world.yaml.txt](https://github.com/ros-visualization/rviz/files/799934/the_world.yaml.txt)\r\n\r\n\r\n","created_at":"2016-05-13T20:28:49Z","updated_at":"2017-05-01T20:01:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2505fcef6445899fb986f20f8bb803e3f58183a","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ros-visualization/rviz/milestones/102","html_url":"https://github.com/ros-visualization/rviz/milestone/102","labels_url":"https://api.github.com/repos/ros-visualization/rviz/milestones/102/labels","id":580464,"number":102,"title":"untargeted","description":"If an issue is set to `untargeted`, this means that there is no plan to address currently and will not make progress unless someone claims it, sets a target version for it to be implemented in, and does the work of opening a pull request, getting it reviewed and tested and merged.","creator":{"login":"wjwwood","id":100427,"avatar_url":"https://avatars2.githubusercontent.com/u/100427?v=3","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"open_issues":95,"closed_issues":45,"state":"open","created_at":"2014-02-25T23:29:03Z","updated_at":"2017-05-01T19:45:33Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/ros-visualization/rviz/pulls/1007/commits","review_comments_url":"https://api.github.com/repos/ros-visualization/rviz/pulls/1007/comments","review_comment_url":"https://api.github.com/repos/ros-visualization/rviz/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros-visualization/rviz/issues/1007/comments","statuses_url":"https://api.github.com/repos/ros-visualization/rviz/statuses/14c290ccb6c0686597f10e6d1a6caec19cb7b0d1","head":{"label":"DLu:indigo-biiiiiig-maps","ref":"indigo-biiiiiig-maps","sha":"14c290ccb6c0686597f10e6d1a6caec19cb7b0d1","user":{"login":"DLu","id":1016143,"avatar_url":"https://avatars2.githubusercontent.com/u/1016143?v=3","gravatar_id":"","url":"https://api.github.com/users/DLu","html_url":"https://github.com/DLu","followers_url":"https://api.github.com/users/DLu/followers","following_url":"https://api.github.com/users/DLu/following{/other_user}","gists_url":"https://api.github.com/users/DLu/gists{/gist_id}","starred_url":"https://api.github.com/users/DLu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DLu/subscriptions","organizations_url":"https://api.github.com/users/DLu/orgs","repos_url":"https://api.github.com/users/DLu/repos","events_url":"https://api.github.com/users/DLu/events{/privacy}","received_events_url":"https://api.github.com/users/DLu/received_events","type":"User","site_admin":false},"repo":{"id":44685905,"name":"rviz","full_name":"DLu/rviz","owner":{"login":"DLu","id":1016143,"avatar_url":"https://avatars2.githubusercontent.com/u/1016143?v=3","gravatar_id":"","url":"https://api.github.com/users/DLu","html_url":"https://github.com/DLu","followers_url":"https://api.github.com/users/DLu/followers","following_url":"https://api.github.com/users/DLu/following{/other_user}","gists_url":"https://api.github.com/users/DLu/gists{/gist_id}","starred_url":"https://api.github.com/users/DLu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DLu/subscriptions","organizations_url":"https://api.github.com/users/DLu/orgs","repos_url":"https://api.github.com/users/DLu/repos","events_url":"https://api.github.com/users/DLu/events{/privacy}","received_events_url":"https://api.github.com/users/DLu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DLu/rviz","description":"ROS 3D Robot Visualizer","fork":true,"url":"https://api.github.com/repos/DLu/rviz","forks_url":"https://api.github.com/repos/DLu/rviz/forks","keys_url":"https://api.github.com/repos/DLu/rviz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DLu/rviz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DLu/rviz/teams","hooks_url":"https://api.github.com/repos/DLu/rviz/hooks","issue_events_url":"https://api.github.com/repos/DLu/rviz/issues/events{/number}","events_url":"https://api.github.com/repos/DLu/rviz/events","assignees_url":"https://api.github.com/repos/DLu/rviz/assignees{/user}","branches_url":"https://api.github.com/repos/DLu/rviz/branches{/branch}","tags_url":"https://api.github.com/repos/DLu/rviz/tags","blobs_url":"https://api.github.com/repos/DLu/rviz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DLu/rviz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DLu/rviz/git/refs{/sha}","trees_url":"https://api.github.com/repos/DLu/rviz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DLu/rviz/statuses/{sha}","languages_url":"https://api.github.com/repos/DLu/rviz/languages","stargazers_url":"https://api.github.com/repos/DLu/rviz/stargazers","contributors_url":"https://api.github.com/repos/DLu/rviz/contributors","subscribers_url":"https://api.github.com/repos/DLu/rviz/subscribers","subscription_url":"https://api.github.com/repos/DLu/rviz/subscription","commits_url":"https://api.github.com/repos/DLu/rviz/commits{/sha}","git_commits_url":"https://api.github.com/repos/DLu/rviz/git/commits{/sha}","comments_url":"https://api.github.com/repos/DLu/rviz/comments{/number}","issue_comment_url":"https://api.github.com/repos/DLu/rviz/issues/comments{/number}","contents_url":"https://api.github.com/repos/DLu/rviz/contents/{+path}","compare_url":"https://api.github.com/repos/DLu/rviz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DLu/rviz/merges","archive_url":"https://api.github.com/repos/DLu/rviz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DLu/rviz/downloads","issues_url":"https://api.github.com/repos/DLu/rviz/issues{/number}","pulls_url":"https://api.github.com/repos/DLu/rviz/pulls{/number}","milestones_url":"https://api.github.com/repos/DLu/rviz/milestones{/number}","notifications_url":"https://api.github.com/repos/DLu/rviz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DLu/rviz/labels{/name}","releases_url":"https://api.github.com/repos/DLu/rviz/releases{/id}","deployments_url":"https://api.github.com/repos/DLu/rviz/deployments","created_at":"2015-10-21T15:29:07Z","updated_at":"2015-10-21T15:29:11Z","pushed_at":"2017-02-23T21:48:06Z","git_url":"git://github.com/DLu/rviz.git","ssh_url":"git@github.com:DLu/rviz.git","clone_url":"https://github.com/DLu/rviz.git","svn_url":"https://github.com/DLu/rviz","homepage":null,"size":9824,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"indigo-devel"}},"base":{"label":"ros-visualization:indigo-devel","ref":"indigo-devel","sha":"1804cbf63241dcf174b1b76449a302e4321c50d8","user":{"login":"ros-visualization","id":2328629,"avatar_url":"https://avatars1.githubusercontent.com/u/2328629?v=3","gravatar_id":"","url":"https://api.github.com/users/ros-visualization","html_url":"https://github.com/ros-visualization","followers_url":"https://api.github.com/users/ros-visualization/followers","following_url":"https://api.github.com/users/ros-visualization/following{/other_user}","gists_url":"https://api.github.com/users/ros-visualization/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-visualization/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-visualization/subscriptions","organizations_url":"https://api.github.com/users/ros-visualization/orgs","repos_url":"https://api.github.com/users/ros-visualization/repos","events_url":"https://api.github.com/users/ros-visualization/events{/privacy}","received_events_url":"https://api.github.com/users/ros-visualization/received_events","type":"Organization","site_admin":false},"repo":{"id":5860736,"name":"rviz","full_name":"ros-visualization/rviz","owner":{"login":"ros-visualization","id":2328629,"avatar_url":"https://avatars1.githubusercontent.com/u/2328629?v=3","gravatar_id":"","url":"https://api.github.com/users/ros-visualization","html_url":"https://github.com/ros-visualization","followers_url":"https://api.github.com/users/ros-visualization/followers","following_url":"https://api.github.com/users/ros-visualization/following{/other_user}","gists_url":"https://api.github.com/users/ros-visualization/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-visualization/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-visualization/subscriptions","organizations_url":"https://api.github.com/users/ros-visualization/orgs","repos_url":"https://api.github.com/users/ros-visualization/repos","events_url":"https://api.github.com/users/ros-visualization/events{/privacy}","received_events_url":"https://api.github.com/users/ros-visualization/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros-visualization/rviz","description":"ROS 3D Robot Visualizer","fork":false,"url":"https://api.github.com/repos/ros-visualization/rviz","forks_url":"https://api.github.com/repos/ros-visualization/rviz/forks","keys_url":"https://api.github.com/repos/ros-visualization/rviz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros-visualization/rviz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros-visualization/rviz/teams","hooks_url":"https://api.github.com/repos/ros-visualization/rviz/hooks","issue_events_url":"https://api.github.com/repos/ros-visualization/rviz/issues/events{/number}","events_url":"https://api.github.com/repos/ros-visualization/rviz/events","assignees_url":"https://api.github.com/repos/ros-visualization/rviz/assignees{/user}","branches_url":"https://api.github.com/repos/ros-visualization/rviz/branches{/branch}","tags_url":"https://api.github.com/repos/ros-visualization/rviz/tags","blobs_url":"https://api.github.com/repos/ros-visualization/rviz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros-visualization/rviz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros-visualization/rviz/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros-visualization/rviz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros-visualization/rviz/statuses/{sha}","languages_url":"https://api.github.com/repos/ros-visualization/rviz/languages","stargazers_url":"https://api.github.com/repos/ros-visualization/rviz/stargazers","contributors_url":"https://api.github.com/repos/ros-visualization/rviz/contributors","subscribers_url":"https://api.github.com/repos/ros-visualization/rviz/subscribers","subscription_url":"https://api.github.com/repos/ros-visualization/rviz/subscription","commits_url":"https://api.github.com/repos/ros-visualization/rviz/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros-visualization/rviz/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros-visualization/rviz/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros-visualization/rviz/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros-visualization/rviz/contents/{+path}","compare_url":"https://api.github.com/repos/ros-visualization/rviz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros-visualization/rviz/merges","archive_url":"https://api.github.com/repos/ros-visualization/rviz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros-visualization/rviz/downloads","issues_url":"https://api.github.com/repos/ros-visualization/rviz/issues{/number}","pulls_url":"https://api.github.com/repos/ros-visualization/rviz/pulls{/number}","milestones_url":"https://api.github.com/repos/ros-visualization/rviz/milestones{/number}","notifications_url":"https://api.github.com/repos/ros-visualization/rviz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros-visualization/rviz/labels{/name}","releases_url":"https://api.github.com/repos/ros-visualization/rviz/releases{/id}","deployments_url":"https://api.github.com/repos/ros-visualization/rviz/deployments","created_at":"2012-09-18T18:15:03Z","updated_at":"2017-04-29T12:21:39Z","pushed_at":"2017-05-01T19:45:33Z","git_url":"git://github.com/ros-visualization/rviz.git","ssh_url":"git@github.com:ros-visualization/rviz.git","clone_url":"https://github.com/ros-visualization/rviz.git","svn_url":"https://github.com/ros-visualization/rviz","homepage":null,"size":9903,"stargazers_count":98,"watchers_count":98,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":159,"mirror_url":null,"open_issues_count":109,"forks":159,"open_issues":109,"watchers":98,"default_branch":"kinetic-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ros-visualization/rviz/pulls/1007"},"html":{"href":"https://github.com/ros-visualization/rviz/pull/1007"},"issue":{"href":"https://api.github.com/repos/ros-visualization/rviz/issues/1007"},"comments":{"href":"https://api.github.com/repos/ros-visualization/rviz/issues/1007/comments"},"review_comments":{"href":"https://api.github.com/repos/ros-visualization/rviz/pulls/1007/comments"},"review_comment":{"href":"https://api.github.com/repos/ros-visualization/rviz/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros-visualization/rviz/pulls/1007/commits"},"statuses":{"href":"https://api.github.com/repos/ros-visualization/rviz/statuses/14c290ccb6c0686597f10e6d1a6caec19cb7b0d1"}}}}
{"actor":{"display_login":"wjwwood"}}