{"action":"created","issue":{"url":"https://api.github.com/repos/mikolalysenko/3d-camera-core/issues/1","labels_url":"https://api.github.com/repos/mikolalysenko/3d-camera-core/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/mikolalysenko/3d-camera-core/issues/1/comments","events_url":"https://api.github.com/repos/mikolalysenko/3d-camera-core/issues/1/events","html_url":"https://github.com/mikolalysenko/3d-camera-core/issues/1","id":53950354,"number":1,"title":"Shader Data","user":{"login":"hughsk","id":569817,"avatar_url":"https://avatars.githubusercontent.com/u/569817?v=3","gravatar_id":"","url":"https://api.github.com/users/hughsk","html_url":"https://github.com/hughsk","followers_url":"https://api.github.com/users/hughsk/followers","following_url":"https://api.github.com/users/hughsk/following{/other_user}","gists_url":"https://api.github.com/users/hughsk/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsk/subscriptions","organizations_url":"https://api.github.com/users/hughsk/orgs","repos_url":"https://api.github.com/users/hughsk/repos","events_url":"https://api.github.com/users/hughsk/events{/privacy}","received_events_url":"https://api.github.com/users/hughsk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-10T07:39:38Z","updated_at":"2015-01-10T13:42:29Z","closed_at":null,"body":"I think currently there's too much data being pushed into uniforms with the default camera interface in `index.glsl`, from experience I've only ever needed a view matrix and the camera's position.\r\n\r\n@mikolalysenko @mattdesl what're your thoughts?"},"comment":{"url":"https://api.github.com/repos/mikolalysenko/3d-camera-core/issues/comments/69456124","html_url":"https://github.com/mikolalysenko/3d-camera-core/issues/1#issuecomment-69456124","issue_url":"https://api.github.com/repos/mikolalysenko/3d-camera-core/issues/1","id":69456124,"user":{"login":"mikolalysenko","id":231686,"avatar_url":"https://avatars.githubusercontent.com/u/231686?v=3","gravatar_id":"","url":"https://api.github.com/users/mikolalysenko","html_url":"https://github.com/mikolalysenko","followers_url":"https://api.github.com/users/mikolalysenko/followers","following_url":"https://api.github.com/users/mikolalysenko/following{/other_user}","gists_url":"https://api.github.com/users/mikolalysenko/gists{/gist_id}","starred_url":"https://api.github.com/users/mikolalysenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikolalysenko/subscriptions","organizations_url":"https://api.github.com/users/mikolalysenko/orgs","repos_url":"https://api.github.com/users/mikolalysenko/repos","events_url":"https://api.github.com/users/mikolalysenko/events{/privacy}","received_events_url":"https://api.github.com/users/mikolalysenko/received_events","type":"User","site_admin":false},"created_at":"2015-01-10T13:42:29Z","updated_at":"2015-01-10T13:42:29Z","body":"This is a reasonable concern, however I think the extra data is still useful (I know I've made use of each of these coordinate transformations at some point) and it shouldn't hurt anything.\r\n\r\nThe rationale for this last point may require some explanation:\r\n\r\nBasically, if a shader does not use or reference a uniform variable, then it doesn't get linked.  So if you only use `camera.world.toView` and `camera.world.position`, then the rest of the camera object would not even get loaded and those variables would never even be computed.\r\n\r\nPart of why I wanted to stick all of these things in a common camera class is that they are variables which end up being repeatedly evaluated for various things (like unprojecting a ray for picking, computing the area of a triangle, etc.)\r\n\r\nCaching this data in the camera object can greatly speed up these computations, and also simplify code. \r\n\r\nThat said, it becomes a little more difficult to scope exactly what the camera's boundary is.  The perspective I am taking with this module is that it is responsible for coordinate transformations, and so it keeps track of the geometry of the viewing frustum in each frame of reference and the relations between these coordinate systems."}}