{"action":"created","issue":{"url":"https://api.github.com/repos/mindbender-studio/core/issues/177","repository_url":"https://api.github.com/repos/mindbender-studio/core","labels_url":"https://api.github.com/repos/mindbender-studio/core/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/mindbender-studio/core/issues/177/comments","events_url":"https://api.github.com/repos/mindbender-studio/core/issues/177/events","html_url":"https://github.com/mindbender-studio/core/issues/177","id":235135522,"number":177,"title":"Surface intersections identification tools","user":{"login":"HenrikSkymne","id":28897435,"avatar_url":"https://avatars2.githubusercontent.com/u/28897435?v=3","gravatar_id":"","url":"https://api.github.com/users/HenrikSkymne","html_url":"https://github.com/HenrikSkymne","followers_url":"https://api.github.com/users/HenrikSkymne/followers","following_url":"https://api.github.com/users/HenrikSkymne/following{/other_user}","gists_url":"https://api.github.com/users/HenrikSkymne/gists{/gist_id}","starred_url":"https://api.github.com/users/HenrikSkymne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HenrikSkymne/subscriptions","organizations_url":"https://api.github.com/users/HenrikSkymne/orgs","repos_url":"https://api.github.com/users/HenrikSkymne/repos","events_url":"https://api.github.com/users/HenrikSkymne/events{/privacy}","received_events_url":"https://api.github.com/users/HenrikSkymne/received_events","type":"User","site_admin":false},"labels":[{"id":522384519,"url":"https://api.github.com/repos/mindbender-studio/core/labels/feature","name":"feature","color":"bfd4f2","default":false},{"id":561167644,"url":"https://api.github.com/repos/mindbender-studio/core/labels/Maya","name":"Maya","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-12T06:29:00Z","updated_at":"2017-06-12T07:00:40Z","closed_at":null,"body":"**Goal:**\r\nMake it easier and faster to spot and correct surface intersections that causes render issues when using sub Surface scattering.\r\n\r\n**Motivation:**\r\nComplex rigs that have surfaces that uses sub Surface scattering are sensitive to intersections between meshes.\r\nThe rigs cannot be bullet proof against this without becoming overly complex, and animators have a hard time seeing where this effect happens.\r\nOften the issues are only spotted upon render and it would be beneficial to be able to spot these issues earlier.\r\nIf these issues can be spotted directly when animating the animator can avoid or correct poses that will later on cause issues.\r\nIf issues can easily be spotted without expensive renders time can be saved.\r\n\r\n**implementation**\r\nSeveral possible Tools could be made to facilitate in locating these issues:\r\n\r\n- A shader, cgfx or other, that locates these issues. \r\nThe light inside a proper working SSS model will work as this: Light hits facing poly, Light hits rearwards facing poly, repeat.\r\nThe light inside a Surface where shapes intersect will work as this: Light hits facing poly, light hits facing poly, light hits rearwards facing poly. In this instance the entry Point for the light could be highlighted to show an issue with intersections by flagging the Surface in a contrasting color.\r\nFor this to work care would have to be taken to make sure all SSS items in the scene are evaluated at the same time, as characters are often made by many different objects, and many shader solutions work on object by object basis. Care also needs to be taken to include non SSS objects where they intersect.\r\n\r\n- Quick render with SSS solution.\r\nA complement or replacement for a realtime shader that will still reduce the later render times would be to have a quick implement SSS render that highlights issues.\r\nObjects should assigned either SSS or non SSS material properties. Shaders would be assigned for a quick render pass that is not meant for final render, but only to isolate the future intersection issues. Again, a solution that uses contrasting colors to highlight the issues would be beneficial.\r\n\r\n- Mesh intersection indentification.\r\nTools that does not work on a shader level, but on model basis, that isolates and displays where intersections happen, would serve the same purpose. Again, care needs to be taken to only do this on SSS Surfaces.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mindbender-studio/core/issues/comments/307706114","html_url":"https://github.com/mindbender-studio/core/issues/177#issuecomment-307706114","issue_url":"https://api.github.com/repos/mindbender-studio/core/issues/177","id":307706114,"user":{"login":"mottosso","id":2152766,"avatar_url":"https://avatars2.githubusercontent.com/u/2152766?v=3","gravatar_id":"","url":"https://api.github.com/users/mottosso","html_url":"https://github.com/mottosso","followers_url":"https://api.github.com/users/mottosso/followers","following_url":"https://api.github.com/users/mottosso/following{/other_user}","gists_url":"https://api.github.com/users/mottosso/gists{/gist_id}","starred_url":"https://api.github.com/users/mottosso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mottosso/subscriptions","organizations_url":"https://api.github.com/users/mottosso/orgs","repos_url":"https://api.github.com/users/mottosso/repos","events_url":"https://api.github.com/users/mottosso/events{/privacy}","received_events_url":"https://api.github.com/users/mottosso/received_events","type":"User","site_admin":false},"created_at":"2017-06-12T07:00:40Z","updated_at":"2017-06-12T07:00:40Z","body":"Here's what I showed Calle a while back.\r\n\r\n![untitled project](https://user-images.githubusercontent.com/2152766/27021952-8d0538c8-4f43-11e7-84d2-1525ef1c75f2.gif)\r\n\r\n**Careful, this clears your current scene**\r\n\r\n```python\r\nfrom maya import cmds, mel\r\n\r\ncmds.file(new=True, force=True)\r\ncube, _ = cmds.polyCube()\r\nsphere, _ = cmds.polySphere()\r\ncmds.move(1, 0, 0, cube)\r\n\r\ncmds.select([cube, sphere])\r\nmel.eval(\"assignNewPfxToon\")\r\n\r\nfor attr, value in {\"intersectionLines\": 1,\r\n                    \"creaseLines\": 0,\r\n                    \"profileLineWidth\": 0,\r\n                    \"intersectionLineWidth\": 4}.items():\r\n    cmds.setAttr(\"pfxToonShape1.\" + attr, value)\r\n```\r\n"}}
{"actor":{"display_login":"mottosso"}}