{"action":"created","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/gltf-pipeline/issues/331","repository_url":"https://api.github.com/repos/AnalyticalGraphicsInc/gltf-pipeline","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/gltf-pipeline/issues/331/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/gltf-pipeline/issues/331/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/gltf-pipeline/issues/331/events","html_url":"https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/331","id":264383645,"number":331,"title":"Provide a super simple way for engines to add support for spec gloss","user":{"login":"pjcozzi","id":782098,"avatar_url":"https://avatars2.githubusercontent.com/u/782098?v=4","gravatar_id":"","url":"https://api.github.com/users/pjcozzi","html_url":"https://github.com/pjcozzi","followers_url":"https://api.github.com/users/pjcozzi/followers","following_url":"https://api.github.com/users/pjcozzi/following{/other_user}","gists_url":"https://api.github.com/users/pjcozzi/gists{/gist_id}","starred_url":"https://api.github.com/users/pjcozzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjcozzi/subscriptions","organizations_url":"https://api.github.com/users/pjcozzi/orgs","repos_url":"https://api.github.com/users/pjcozzi/repos","events_url":"https://api.github.com/users/pjcozzi/events{/privacy}","received_events_url":"https://api.github.com/users/pjcozzi/received_events","type":"User","site_admin":false},"labels":[{"id":287017381,"url":"https://api.github.com/repos/AnalyticalGraphicsInc/gltf-pipeline/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-10-10T21:31:37Z","updated_at":"2018-03-28T00:05:13Z","closed_at":null,"author_association":"MEMBER","body":"See\r\n* https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_pbrSpecularGlossiness/examples\r\n* https://github.com/KhronosGroup/glTF/tree/master/extensions/Khronos/KHR_materials_pbrSpecularGlossiness#best-practices"},"comment":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/gltf-pipeline/issues/comments/376715008","html_url":"https://github.com/AnalyticalGraphicsInc/gltf-pipeline/issues/331#issuecomment-376715008","issue_url":"https://api.github.com/repos/AnalyticalGraphicsInc/gltf-pipeline/issues/331","id":376715008,"user":{"login":"emackey","id":1235080,"avatar_url":"https://avatars2.githubusercontent.com/u/1235080?v=4","gravatar_id":"","url":"https://api.github.com/users/emackey","html_url":"https://github.com/emackey","followers_url":"https://api.github.com/users/emackey/followers","following_url":"https://api.github.com/users/emackey/following{/other_user}","gists_url":"https://api.github.com/users/emackey/gists{/gist_id}","starred_url":"https://api.github.com/users/emackey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emackey/subscriptions","organizations_url":"https://api.github.com/users/emackey/orgs","repos_url":"https://api.github.com/users/emackey/repos","events_url":"https://api.github.com/users/emackey/events{/privacy}","received_events_url":"https://api.github.com/users/emackey/received_events","type":"User","site_admin":false},"created_at":"2018-03-28T00:05:12Z","updated_at":"2018-03-28T00:05:12Z","author_association":"MEMBER","body":"@lilleyse I think I understand what's needed in the shader.  If you or someone can get a branch of gltf-pipeline going with the mechanical hookup of specGloss, to get those textures/factors loaded into uniforms and the corresponding metal/rough textures/factors properly ignored for such models, I think the shader changes will be fairly simple from there.  Up to you if/when you want to prioritize this.\r\n\r\nhttps://github.com/AnalyticalGraphicsInc/gltf-pipeline/blob/25177db38c6c7874969acc02da339176d72b2607/lib/processPbrMetallicRoughness.js#L533-L536\r\n\r\nIn the above snippet, `roughness` is simply `1.0 - glossiness`, and `alpha` is still the square of that.  Glossiness comes from the alpha channel of the spec/gloss texture map, multiplied by the last component of the spec/gloss factor.  `f0` becomes identical to `specularColor`, which no longer uses `mix` and is now just the raw inputs from the specular texturemap's RGB channels multiplied by the specular factor.  The only gotcha is the `diffuseColor` above, which is the diffuse texture map multiplied by the diffuse factor, multiplied by `(1 - max(specular.r, specular.g, specular.b))`."}}
{"actor":{"display_login":"emackey"}}