Commit Graph

1389 Commits

Author SHA1 Message Date
9a23287fd8 SUN and HEMI lights back as trunk (i think) 2009-07-10 17:41:49 +00:00
81c3561513 *rtbuild now stores BB
*fix in ray/bb hit tests inside instances
2009-07-10 16:42:51 +00:00
c43fe4cca9 Should improve mirror rays (copy past error: was losing dive first heuristic sometimes) 2009-07-10 15:43:59 +00:00
b60bfd613e Cost of a BVH is calculated using SA(child)/SA(parent)
Although tests didnt showed this to be clearly superior to: cost(bvh) = log(size)
2009-07-10 15:33:35 +00:00
5e659c0b08 2.5
Monthly cleaning round to make it compile warning free.
Mostly it was const stuff (strings, Context), but also
a couple useful fixes, like wrong use of temp pointers.

Only Mathutils callback struct I left alone... design issue.
2009-07-09 15:40:04 +00:00
2e4b9f3be4 *set cost of transversing a BVH as log(size) 2009-07-08 21:56:24 +00:00
85f6c108ac *Added support for variable cost per RayObject
Suposedly usefull for creating trees of objects (where objects have very diferent size-NumFaces and shape-BB)
Altought the implemented costs maybe not be very correct (for now), as i didnt cared about following a specific "corrected" model
2009-07-08 20:04:40 +00:00
8105454cba Enabled #ifdefs to test LAST_HIT, LAST_HINT
Disable last_hint as it only slow downs
2009-07-08 19:39:37 +00:00
f13d11ab71 Hint support (only for first hiearchic level and shadow rays, lets see if this is useful)
That means each shadow ray tests:
	1st: last hit face
	2nd: last hit object
	3rd: tree of all objects
2009-07-08 15:34:41 +00:00
f90a0b8383 Added local stack during bvh transversal 2009-07-08 10:40:26 +00:00
5b75ea38ff made rtbuild object_heuristic_spliter faster
I think its something like:
	old was:  4*nlogn + 3*(n*6)
	new is:  (2*nlogn + 3*(n*6)) * f, with f<1

Still missing changing the sorting function to an introsort instead of qsort
Other options like bucketing sort may be worth trying (for very large trees)
2009-07-07 19:07:53 +00:00
08fa786251 *added Object SAH support to rtbuild:
only for 2childs splits
	with "worse case heuristic" means each child is considered to have a cost linear on the number of leafs
	no termination criteria

number of BB test/hits expected to "reduced" by some factor
tree building is also expected to be slower as previous split was "object mean", which is quite fast to evaluate
2009-07-07 15:42:08 +00:00
c65a3e3166 *Added BLI_memarena on bvh
*Median split support on rtbuild
2009-07-06 19:45:00 +00:00
aa12d2153f *fix (forgot to multiply by BB size) 2009-07-06 15:35:46 +00:00
e0e66f6b74 *"Fixed" rayobject_bvh memory organization of BB's
until now rayobject_bvh should be at least as fast as BLIBVH, this seemed to be the missing piece
2009-07-06 14:36:26 +00:00
ba1f3323bf *Added output of BB/primitves test/hits
*"Added" SCE_PASS_RAYHITS to visually see each pixel primitive and BB tests (not-completed for UI)
*Added runtime exchange of tree structure
*Removed FLOAT_EPSILON from BLI_bvhkdop BB's
2009-07-06 13:27:40 +00:00
6e1a81bc7a svn merge -r 21301:21372 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender 2009-07-05 15:20:19 +00:00
621b37bed6 *Added BIH 2009-07-05 00:38:53 +00:00
7055702530 Rendering animations with particle trails cached. 2009-07-04 12:09:21 +00:00
66918b3add A bunch of fun stuff now possible because of new pointcache code:
* Baked normal particles can now use the "Path" visualization.
* Path "max length" & "abs length" are now history:
	- New option to set path start & end times + random variation to length.
	- Much more flexible (and calculated better) than previous options.
	- This works with parents, children, hair & normal particles unlike old length option.
	- Only known issue for now is that children from faces don't get calculated correctly when using path start time.
* New option "trails" for "halo", "line" and "billboard" visualizations:
	- Draws user controllable number of particle instances along particles path backwards from current position.
	- Works with children too for cool/weird visualizations that weren't possible before.
* Normal particle children's velocities are now approximated better when needed so that "line" visualization trails will look nice.
* New particle instance modifier options:
	- "path"-option works better and has controllable (max)position along path (with random variation possible).
	- "keep shape"-option for hair, keyed, or baked particles allows to place the instances to a single point (with random variation possible) along particle path.
	- "axis" option to make rotation handling better (still not perfect, but will have to do for now).

Some fixes & cleanup done along the way:
* Random path length didn't work for non-child particles.
* Cached & unborn particles weren't reset to emit locations.
* Particle numbers weren't drawn in the correct place.
* Setting proper render & draw visualizations was lost somewhere when initializing new particle settings.
* Changing child mode wasn't working correctly.
* Some cleanup & modularization of particle child effector code and particle drawing & rendering code.
* Object & group visualizations didn't work.
* Child simplification didn't work.
2009-07-04 03:50:12 +00:00
3d06a104a4 rayobject_octree fixed 2009-07-03 18:16:59 +00:00
4a72557e6b Fixed memory aligns for 64bits 2009-07-03 17:10:54 +00:00
7da0d1a71e * Fixed a crazy memory leak in voxel data image sequence data source 2009-07-03 11:03:09 +00:00
44ef6c1eac *little fix 2009-07-03 02:56:54 +00:00
8394653ebd *No need of a BB if the underlying structure already has a BB 2009-07-03 02:26:40 +00:00
4b81d44282 *fixed crash 2009-07-02 22:12:26 +00:00
686a426cf0 *fixed rtbuild (there was a sorting bug introduced while adapting code from BLI_bvh)
This bvh should be at least as fast as BLI_kdopbvh now
2009-07-02 21:57:50 +00:00
5c207a61f3 *RTBuilder now supports splitting leafs in N leafs
something is wrong on rayobject_bvh as it looks slower than BLI_bvh and code is based on it
2009-07-02 15:45:15 +00:00
b14298f959 svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender 2009-07-02 11:28:42 +00:00
2acac0ff99 Reverted incorrect merge (missing files)
svn up -r 21247
svn merge -r 21247:21246 . (<= revert incorrect: merge -r 21041:21243)
svn up
2009-07-02 02:59:43 +00:00
1b557a61a5 fixed ray mirror/trans shadow on rayobject_bvh 2009-07-01 12:36:05 +00:00
91226e6807 *Added rayobject_bvh
A bvh structure to use on the raytracer
2009-07-01 11:27:43 +00:00
1deba75110 *Added initial code of rayobject_rtbuild
An helper class to build trees
2009-06-30 22:07:42 +00:00
021e0cc53f *reserved RayObject align offset 0 for private usage inside each structure
point is that other structures like trees can then distiguish between other nodes or rayobject primitives
withouth needing any other variable.
	(Note yet used but will reduce memory by a nice factor (linear to the number of primitives))
2009-06-30 14:05:33 +00:00
e0cfafa629 Measure build time...
*as expected it's a lot faster on BVH
2009-06-30 01:17:50 +00:00
dd7463bd4d svn merge -r 21041:21243 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender 2009-06-29 21:50:53 +00:00
f5f6850f23 *make type of acceleration structure changeable at runtime
*added some counter code (test/hits) for primitives and raycasts
2009-06-29 19:48:11 +00:00
912c2f440b Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
	- exact (not marked)
	- outdated (simulation is not done completely with current settings)
	- non-exact (frames were skipped during simulation)

* The parameter "cache step" effects the number of frames between saved cache frames.
	- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
	- Speeds up the "quick caching" very much.
	- Frames between cached frames are interpolated from the cached frames.
	- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.

* The caching can work in normal or "quick" mode:
	[Normal cache]
	- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
	- Becomes non-exact: After larger than 1 frame steps.
	- Becomes outdated: After any change effecting the simulation other than frame steps.
	- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.

	[Quick cache]
	- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
	- Becomes non-exact: Always from frame 1 (unless cache step = 1).
	- Becomes outdated: Never.
	- Pros/cons: Not very accurate, but super fast!
	- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.

* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
	- step forwards (to unknown) -> simulate from last exact frame, store result
	- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame

* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
	- Baking does the same, but runs the simulation all the way to the end of simulation.
	- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
	
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".

* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
165593931f *another blackdots fixed - had forgoted to enable skip-neighbour faces on ao. 2009-06-26 02:11:08 +00:00
8cda8abefe Bugfix, testing venom's lab .blends
Using LightGroups override for material doesn't work for preview
renders. Code didn't correctly return correct light listbase then,
crashing Blender on preview render.
2009-06-25 12:32:55 +00:00
edfb507088 *Fixed handling of HEMI and SUN lights shadows 2009-06-24 19:29:48 +00:00
d5e9eb7d76 * fix for small bug in volume texture stack 2009-06-21 22:17:06 +00:00
8ead648fd1 Spring Cleaning
* removed radiosity render code, DNA and RNA (left in radio render pass options), we'll get GI to replace this probably, better allow baking to vertex colors for people who used this.
* removed deprecated solid physics library, sumo integrations and qhull, a dependency
* removed ODE, was no longer being build or supported
* remove BEOS and AMIGA defines and references in Makefiles.
2009-06-21 16:18:38 +00:00
1f9368b37e Particle system parenting
* Allows moving, rotating & scaling of particle simulations.
* Setting in particle render options.
* Changes viewed & rendered particles from global space to parent space.
* Doesn't effect simulations at all.
2009-06-21 11:09:16 +00:00
10a4338936 *fixs ray_shadow_jitter (area soft shadow)
(detected with test249/render/arealight.blend)
2009-06-21 11:08:30 +00:00
6b15024f4a Pointcache refresh part 1:
* Particles support larger than 1 frame changes, bigger frame changes can result in inaccurate results, but it's super fast and you get a nice feeling of how the particles behave!
* "Cache to current frame" button calculates the exact result of particles at current frame.
* Current state of cache can be protected by making it a bake.
* Cache is now in memory by default, disk cache is an option.
* Only "viewport %" number of particles are calculated and cached in viewport, baking and rendering calculate all particles.
* Info on cached frames and memory usage given in ui.
* Support for exact "autocaching" of changes and large frame changes(disabled for now until exact place in event system is decided)
* "Continue physics" is probably deprecated after this and should be removed once sb & cloth use the new cache code.

Todo:
* Make softbody & cloth use the new cache things.

Other changes:
* Some cleanup of particle buttons.
2009-06-21 10:16:52 +00:00
2d68444da5 svn merge -r 20822:21041 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender 2009-06-20 21:53:57 +00:00
3b2ec94977 Voxel data & volume light cache
* Added support for additional file types in the voxel data texture. I added 
support for 8 bit raw files, but most notably for image sequences.

Image sequences generate the voxel grid by stacking layers of image slices on top 
of each other to generate the voxels in the Z axis - the number of slices in the 
sequence is the resolution of the voxel grid's Z axis. 

i.e. http://mke3.net/blender/devel/rendering/volumetrics/skull_layers.jpg

The image sequence option is particularly useful for loading medical data into 
Blender. 3d medical data such as MRIs or CT scans are often stored as DICOM 
format image sequences. It's not in Blender's scope to support the DICOM format, 
but there are plenty of utilities such as ImageMagick, Photoshop or OsiriX that 
can easily convert DICOM files to formats that Blender supports, such as PNG or JPEG.

Here are some example renderings using these file formats to load medical data:
http://vimeo.com/5242961
http://vimeo.com/5242989
http://vimeo.com/5243228

Currently the 8 bit raw and image sequence formats only support the 'still' 
rendering feature.

* Changed the default texture placement to be centred around 0.5,0.5,0.5, rather 
than within the 0.0,1.0 cube. This is more consistent with image textures, and it 
also means you can easily add a voxel data texture to a default cube without 
having to mess around with mapping.

* Added some more extrapolation modes such as Repeat and Extend rather than just clipping

http://mke3.net/blender/devel/rendering/volumetrics/bradybunch.jpg

* Changed the voxel data storage to use MEM_Mapalloc (memory mapped disk cache) 
rather than storing in ram, to help cut down memory usage.

* Refactored and cleaned up the code a lot. Now the access and interpolation code 
is separated into a separate voxel library inside blenlib. This is now properly 
shared between voxel data texture and light cache (previously there was some 
duplicated code).

* Made volume light cache support non-cubic voxel grids. Now the resolution 
specified in the material properties is used for the longest edge of the volume 
object's bounding box, and the shorter edges are proportional (similar to how 
resolution is calculated for fluid sim domains).

This is *much* more memory efficient for squashed volume regions like clouds 
layer bounding boxes, allowing you to raise the resolution considerably while 
still keeping memory usage acceptable.
2009-06-20 06:41:50 +00:00
a9b99ab01c coverity issue CID: 596
Checker: FORWARD_NULL (help)
File: base/src/source/blender/render/intern/source/texture.c
Function: do_lamp_tex
Description: Variable "dx" tracked as NULL was dereferenced.

Also found a typo the 3rd check was checking projx instead of projz
I also expanded the elses to set dyt as well as dxt.

Kent
2009-06-18 12:57:39 +00:00
a1cf7988c1 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20855:20928
Sequencer changes from source/blender/src coming next
2009-06-16 14:21:58 +00:00