{"action":"created","issue":{"url":"https://api.github.com/repos/playcanvas/engine/issues/335","labels_url":"https://api.github.com/repos/playcanvas/engine/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/playcanvas/engine/issues/335/comments","events_url":"https://api.github.com/repos/playcanvas/engine/issues/335/events","html_url":"https://github.com/playcanvas/engine/pull/335","id":90985267,"number":335,"title":"Material system refactor 2","user":{"login":"guycalledfrank","id":7008423,"avatar_url":"https://avatars.githubusercontent.com/u/7008423?v=3","gravatar_id":"","url":"https://api.github.com/users/guycalledfrank","html_url":"https://github.com/guycalledfrank","followers_url":"https://api.github.com/users/guycalledfrank/followers","following_url":"https://api.github.com/users/guycalledfrank/following{/other_user}","gists_url":"https://api.github.com/users/guycalledfrank/gists{/gist_id}","starred_url":"https://api.github.com/users/guycalledfrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guycalledfrank/subscriptions","organizations_url":"https://api.github.com/users/guycalledfrank/orgs","repos_url":"https://api.github.com/users/guycalledfrank/repos","events_url":"https://api.github.com/users/guycalledfrank/events{/privacy}","received_events_url":"https://api.github.com/users/guycalledfrank/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-25T14:46:00Z","updated_at":"2015-06-25T14:50:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/playcanvas/engine/pulls/335","html_url":"https://github.com/playcanvas/engine/pull/335","diff_url":"https://github.com/playcanvas/engine/pull/335.diff","patch_url":"https://github.com/playcanvas/engine/pull/335.patch"},"body":"- fixed a few bugs from previous PR.\r\n\r\n- phongmaterial.getUniform(\"phongmaterial property name\", value to set)\r\nreturns you a \"uniform object\", that looks like this: {name:uniformName, value:uniformValue} or an \r\narray: [uniformObject, uniformObject].\r\n- material.setParameter accepts such objects/arrays.\r\n\r\ncan be used to simplify usage of https://github.com/playcanvas/engine/pull/318\r\nSo instead of writing:\r\n```javascript\r\n            var tform = new pc.Vec4(0.11, 1, this.offset, 0);\r\n            obj.setParameter(\"texture_diffuseMapTransform\", tform.data);\r\n```\r\nYou can write:\r\n```javascript\r\n            var overrideOffset = obj.material.getUniform(\"diffuseMapOffset\", new pc.Vec2(this.offset, 0));\r\n            obj.setParameter(overrideOffset);\r\n```\r\nor Instead of\r\n```javascript\r\nobj.setParameter(\"material_diffuse\", color.data);\r\n```\r\nyou can do\r\n```javascript\r\n            var override = obj.material.getUniform(\"diffuse\", color);\r\n            obj.setParameter(override);\r\n```"},"comment":{"url":"https://api.github.com/repos/playcanvas/engine/issues/comments/115282781","html_url":"https://github.com/playcanvas/engine/pull/335#issuecomment-115282781","issue_url":"https://api.github.com/repos/playcanvas/engine/issues/335","id":115282781,"user":{"login":"guycalledfrank","id":7008423,"avatar_url":"https://avatars.githubusercontent.com/u/7008423?v=3","gravatar_id":"","url":"https://api.github.com/users/guycalledfrank","html_url":"https://github.com/guycalledfrank","followers_url":"https://api.github.com/users/guycalledfrank/followers","following_url":"https://api.github.com/users/guycalledfrank/following{/other_user}","gists_url":"https://api.github.com/users/guycalledfrank/gists{/gist_id}","starred_url":"https://api.github.com/users/guycalledfrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guycalledfrank/subscriptions","organizations_url":"https://api.github.com/users/guycalledfrank/orgs","repos_url":"https://api.github.com/users/guycalledfrank/repos","events_url":"https://api.github.com/users/guycalledfrank/events{/privacy}","received_events_url":"https://api.github.com/users/guycalledfrank/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T14:50:50Z","updated_at":"2015-06-25T14:50:50Z","body":"No. Because it gets uniform. It doesn't change anything. It returns you a structure with uniform name + value (possibly processed, like shininess rescale from 0-100 to 0-1 etc)."}}