-
Notifications
You must be signed in to change notification settings - Fork 7
Rendering task updates #11
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
base: master
Are you sure you want to change the base?
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.