{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/8117","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/8117/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/8117/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/8117/events","html_url":"https://github.com/mrdoob/three.js/pull/8117","id":133293075,"number":8117,"title":"Allow textures to be encoded/decoded in Linear,sRGB,RGBE,RGBM, etc","user":{"login":"bhouston","id":588541,"avatar_url":"https://avatars.githubusercontent.com/u/588541?v=3","gravatar_id":"","url":"https://api.github.com/users/bhouston","html_url":"https://github.com/bhouston","followers_url":"https://api.github.com/users/bhouston/followers","following_url":"https://api.github.com/users/bhouston/following{/other_user}","gists_url":"https://api.github.com/users/bhouston/gists{/gist_id}","starred_url":"https://api.github.com/users/bhouston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhouston/subscriptions","organizations_url":"https://api.github.com/users/bhouston/orgs","repos_url":"https://api.github.com/users/bhouston/repos","events_url":"https://api.github.com/users/bhouston/events{/privacy}","received_events_url":"https://api.github.com/users/bhouston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-02-12T17:03:34Z","updated_at":"2016-02-20T20:41:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/8117","html_url":"https://github.com/mrdoob/three.js/pull/8117","diff_url":"https://github.com/mrdoob/three.js/pull/8117.diff","patch_url":"https://github.com/mrdoob/three.js/pull/8117.patch"},"body":"This PR implements the idea discussed here a year ago:\r\n\r\nhttps://github.com/mrdoob/three.js/issues/6593\r\n\r\nTo understand the theory behind this, please read this page:\r\n\r\nhttp://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\r\n\r\nI have created functions for texelEncode and texelDecode.  I have not filled out all the formats in both situations, but I think that is really easy for others to contribute there on a need basis.\r\n\r\nRight now I only use the encoding when accessing textures that are expected to be outside of the standard [0-1] range, which are generally light generating textures, either EnvMaps or Emissivemaps.  I applied the encoding sparingly for now because I didn't want to unnecessarily use uniforms (all other maps generaly do not use such encodings) when they may be at a premium on mobile devices.\r\n\r\nClara.io uses this change in its custom ThreeJS in order to support HDR IBL maps without requiring the float texture extension.  I believe SketchFab and Marmoset do similar things as well.  Thus this is an industry standard change.\r\n\r\nAll existing code works as it did, so this should be a safe merge.  I think it is also something that can easily be improved upon by others on this project as it is a very clean design.\r\n\r\n/ping @WestLangley @spidersharma03"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/186678893","html_url":"https://github.com/mrdoob/three.js/pull/8117#issuecomment-186678893","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/8117","id":186678893,"user":{"login":"WestLangley","id":1000017,"avatar_url":"https://avatars.githubusercontent.com/u/1000017?v=3","gravatar_id":"","url":"https://api.github.com/users/WestLangley","html_url":"https://github.com/WestLangley","followers_url":"https://api.github.com/users/WestLangley/followers","following_url":"https://api.github.com/users/WestLangley/following{/other_user}","gists_url":"https://api.github.com/users/WestLangley/gists{/gist_id}","starred_url":"https://api.github.com/users/WestLangley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WestLangley/subscriptions","organizations_url":"https://api.github.com/users/WestLangley/orgs","repos_url":"https://api.github.com/users/WestLangley/repos","events_url":"https://api.github.com/users/WestLangley/events{/privacy}","received_events_url":"https://api.github.com/users/WestLangley/received_events","type":"User","site_admin":false},"created_at":"2016-02-20T20:41:34Z","updated_at":"2016-02-20T20:41:34Z","body":"Nice work, @bhouston !"}}