Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformation refactor #63

Merged
merged 3 commits into from Sep 26, 2011

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Sep 19, 2011

This refactors the way we handle LLVM code generation for spatial transformations -- the point/vector/normal constructor with optional space name, and the transform() function itself.

The driving motivation here is the addition of a new RendererServices function that allows a renderer (that supports the feature, it's optional) to have nonlinear transformations, i.e. those that cannot be expressed with a 4x4 matrix. Our code generation is smart enough to query the renderer about whether nonlinear transformations are supported at all, and in the particular cases of compile-time-known space names, and in those situations will not generate unnecessary code that checks for them at shader execution time. Renderers that do not have any nonlinear transformations do not need to change -- the default implementation of RendererServices::transform_points is simply to say "none supported".

(For the curious, we do have a particular case for our volumetric fluid simulation tools where the local-to-world transformations are not describable by a 4x4 matrix!)

In the process, the new code is more carefull with some optimizations, such as not generating needless matrix multiplies when the space names are "common" or the approved synonym thereof.

Also we have modified the implementation so that unknown coordinate system names will trigger an appropriate error message, which had been requested by the Shading department.

Also opportunistically fix a problem with certain debug output and constant string variables containing escape sequences. (I'll keep that a separate commit when I merge.)

@lgritz lgritz merged commit 8b06631 into AcademySoftwareFoundation:master Sep 26, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant