Releases: HenrYxZ/sombra
Releases · HenrYxZ/sombra
Multi-Threading Optimized
Optimization of rendering using multiprocessing. Now it's using about 30% of the memory it used before and it's faster.
That's because now rays are created and traced in the same function that goes in parallel.
Also now using imap_unordered function for memory optimization (https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.map)
Multi-Threading
- Use many processes with multiprocessing library
- This is a first version, it's not efficient with memory. It creates every ray at the beginning (memory expensive) and creates a pool with all of them, in the future maybe it would be better to create some of the rays, start the workers, wait for them, then create more rays, and assign to workers like that in a loop until the entire screen is finished
- At resolution of 720p it took ~10GB of RAM for 8 processes
Pathtracing + Caustics
- Pathtracing with Russian Roulette
- Caustics using Light Raytracing (Backwards Raytracing) with Illumination Maps
(see pathtracer.py inside examples)
Depth of Field
Add Depth of Field (an out of focus effect) by using a virtual camera lens, with parameters:
- f: focal distance, which is the distance from the view window (image plane) to the focal plane (where every object is in focus)
- ap_sx: aperture size in the horizontal coordinate
- ap_sy: aperture size in the vertical coordinate
Fix: Animation & Simulation
- Fix variable with same name, light for barycentric shading and light for scene lights in compute_color function
- Fix error when animation_out folder doesn't exist, in create_animation function
Animation & Simulation
- State class that stores position, velocity, rotation, angular velocity, scale and mass.
- Simulation module that include RigidBody with a simulate_physics function, which changes State using a given time delta. The Simulation has a run function that will simulate physics on each RigidBody of the system for the duration time of the simulation.
- Animation module which includes Keyframe and Transform, and can create a series of keyframes using a list of states and then use the list of keyframes to render a list of images.
Reflection
- Reflection for implicit surfaces
- Normal Maps
Textures
Shadows
Simple shapes and shaders
- Diffuse, specular and border shaders
- Sphere and plane objects
- Directional, point and spot lights