Conversation
…u,v) position in the viewing plane
…ns for the internal color buffer index
- moved color buffer creation & pooling to the new class
- moved the statistics printing to a separate method
… size, instead of the pool instance
- rename variables - calculate the square root of the normal length only if needed - avoid recalculating view direction, take instead the negated ray direction
porst17
requested changes
Jun 7, 2018
Member
porst17
left a comment
There was a problem hiding this comment.
Please adjust the commit messages of your commits (e.g. by interactive rebase + force push). The general rule of thumb in most git projects (including the Linux kernel) is to split the commit messages in two parts separated by a blank line:
Short description (Subject line)
Long description or additional information
A properly formed git commit subject line should always be able to complete the following sentence:
If applied, this commit will <your subject line here>
It starts with a capital letter and has no period at the end.
It never starts with a dash -
You can find more details here.
By pushing synchronization down to each individual bucket instad of the pool class, the granularity of locking should be increased, reducing the chances of threads being blocked.
Separating shading logic makes de code more readable, and opens the doors to later implementing multiple shading algorithms.
The ray already contains the viewing direction, so it does not need to be recalculated. By changing which parameters are passed to the shade function, it's possible to avoid some vector operations.
…/jsurf into rendering_task_updates
This will remove the need for most other instance variables, and allow to remove parameters from some functions
When vOld == 0, the CSP will have only null pointers, which are never used. When vOld == the old v, then it will just overwrite the previous CSP set for v. This does not happen when the hashmap is cleared, but doing so prevents the reuse of the CS and CSG for different pixels in the same column.
This removes the responsibilities of the rendering methods, as how the CSP is stored can be considered a different concern. Also, this change opens the doors to changing how the CSPs are cached, as a hashmap might not be the most efficient solution.
Remove unused and commented out code, replace .* imports with just the needed ones.
A small optimization to avoid creating a new vector and two vector class function calls every time the similarity of colors is evaluated.
Avoid doing too many conditions inside the tightest loop. Instead, pre-calculate always the corner rays and then skip them when iterating over the SamplingPoints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several small and medium changes to optimize the rendering. The most important one is the use of a pool for Color3f arrays, which reduces considerably garbage collection and allows it to run without problems with less memory.
Other changes include some refactoring / reorganization of the code, and a reduction in the amount of operations needed for some rendering tasks.