FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

View matrix not accessible in shader by default · Issue #5504 · processing/processing · GitHub

Repository navigation

View matrix not accessible in shader by default #5504

Closed as not planned
Closed as not planned

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 example when working in world space (reflection/refraction with env mapping).

It is possible to set them manually:

pg = (PGraphicsOpenGL) this.g;
...
shader.set("view", pg.camera);
shader.set("viewInv", pg.cameraInv);
shader.set("cameraPos", pg.modelviewInv.m03, pg.modelviewInv.m13, pg.modelviewInv.m23);

And then the model matrix can be calculated in the shader like this: viewInv * modelview

I'm going to make the required changes during the next week.
My question is, how should I call them according to the conventions (alternative names)?

Activity

  1. github-actions commented on Jul 15, 2026

    This issue has been automatically closed and locked.

    Processing 3.x is no longer actively developed. Since January 2020, development moved to the Processing 4 repository.

    If this issue is still relevant to Processing 4, we'd love to hear from you. Please open a new issue at:
    https://github.com/processing/processing4/issues/new/choose

    Thank you for helping improve Processing.

  2. locked as resolved and limited conversation to collaborators on Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL