Title: View matrix not accessible in shader by default · Issue #5504 · processing/processing · GitHub
Open Graph Title: View matrix not accessible in shader by default · Issue #5504 · processing/processing
X Title: View matrix not accessible in shader by default · Issue #5504 · processing/processing
Description: By default a few useful uniforms don't get set for a shader. The defaults are: MVP (transform), MV, P, (MV)^-1T (normalMat) and textureMat. In addition it would be useful to set the view, viewInv matrices and the cameraPos vector. For ex...
Open Graph Description: By default a few useful uniforms don't get set for a shader. The defaults are: MVP (transform), MV, P, (MV)^-1T (normalMat) and textureMat. In addition it would be useful to set the view, viewInv m...
X Description: By default a few useful uniforms don't get set for a shader. The defaults are: MVP (transform), MV, P, (MV)^-1T (normalMat) and textureMat. In addition it would be useful to set the view, viewI...
Opengraph URL: https://github.com/processing/processing/issues/5504
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"View matrix not accessible in shader by default","articleBody":"By default a few useful uniforms don't get set for a shader.\r\nThe defaults are: **MVP** (transform), **MV**, **P**, **(MV)^-1T** (normalMat) and **textureMat**.\r\n\r\nIn addition it would be useful to set the **view**, **viewInv** matrices and the **cameraPos** vector. \r\nFor example when working in world space (reflection/refraction with env mapping).\r\n\r\nIt is possible to set them manually:\r\n``` Java\r\npg = (PGraphicsOpenGL) this.g;\r\n...\r\nshader.set(\"view\", pg.camera);\r\nshader.set(\"viewInv\", pg.cameraInv);\r\nshader.set(\"cameraPos\", pg.modelviewInv.m03, pg.modelviewInv.m13, pg.modelviewInv.m23);\r\n```\r\n\r\nAnd then the **model** matrix can be calculated in the shader like this: viewInv * modelview \r\n\r\nI'm going to make the required changes during the next week.\r\nMy question is, how should I call them according to the conventions (alternative names)?\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/Dawars","@type":"Person","name":"Dawars"},"datePublished":"2018-05-13T08:34:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/5504/processing/issues/5504"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:407b4c1e-c915-689a-2f99-71e73a8967f3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECF0:3BB2E8:C271B7:10F3593:6970BBBD |
| html-safe-nonce | b864385ffcc41fab833bcd36a3729079b1e7697ac3793197836715d164d7a8db |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0YwOjNCQjJFODpDMjcxQjc6MTBGMzU5Mzo2OTcwQkJCRCIsInZpc2l0b3JfaWQiOiI4ODQ2ODA0NDU4NzU1MTExODY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 636b2f1b1df5e738e28321af89544b9e76d8a301a6eec80ffb068e08eb1109f5 |
| hovercard-subject-tag | issue:322575197 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/processing/processing/5504/issue_layout |
| twitter:image | https://opengraph.githubassets.com/756dd3150fb4683b66ec8dd8baad5df50d55ed33906315970e4f6a33698f4095/processing/processing/issues/5504 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/756dd3150fb4683b66ec8dd8baad5df50d55ed33906315970e4f6a33698f4095/processing/processing/issues/5504 |
| og:image:alt | By default a few useful uniforms don't get set for a shader. The defaults are: MVP (transform), MV, P, (MV)^-1T (normalMat) and textureMat. In addition it would be useful to set the view, viewInv m... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Dawars |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8e0be80373b724b033cdf8a7b1f78bf5fb6a5d7a2182a9a403aa30894606e390 |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/processing git https://github.com/processing/processing.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 7807399 |
| octolytics-dimension-repository_nwo | processing/processing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7807399 |
| octolytics-dimension-repository_network_root_nwo | processing/processing |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84d9d5bf3b01412ea10f7c2429cbfc735ccce9ce |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width