Commit Graph

1399 Commits

Author SHA1 Message Date
9aa8d06259 Fix for unitialized variable and resulting render artifacts
when setting project x/y/z to none with a procedural texture.
2009-11-20 15:07:16 +00:00
c9d2186561 - sequencer speed effect back using fcurves, still needs manual reloading to refresh.
- added a function id_data_find_fcurve() to get the fcurve without RNA vars. Aligorith: this could be made to use a path rather then a property name.
2009-11-14 14:58:19 +00:00
6dcb4ac7a4 * Fixing various compiler warnings under scons+mingw. Mostly unused variables and functions.
* Added missing lib-linking code for Grease Pencil in nodetrees
* Uncommented some code for curve shapekeys
2009-11-11 09:59:51 +00:00
37e4a311b0 Math Lib
* Convert all code to use new functions.
* Branch maintainers may want to skip this commit, and run this
  conversion script instead, if they use a lot of math functions
  in new code:
  http://www.pasteall.org/9052/python
2009-11-10 20:43:45 +00:00
bc006655ba * Finished (well, almost ;) RNA wrapping and layout-engine-ing all the nodes.
Still a few quirks, including redraw issues on multilayer image input nodes, but it's pretty much there.
Would also be good to wrap the input/output sockets, too, will check on it.

This fixes bug [#19740] INPUT NODE: Cannot load images / motion pictures
2009-11-10 04:01:44 +00:00
6dd96fcfa8 Update of older commit (23102) from Bob Holcomb -- fix for Darken mode blending was only in place for nodes, not for general texture blending. This updates texture blending to reflect the fix. Now results don't trend toward black on Darken anymore as factor approaches 0. 2009-11-09 19:20:48 +00:00
539a68f6c0 Fix for [#19793] Resolution Sliding Crashes Blender 2.5 SVN 24256 2009-11-05 04:07:58 +00:00
38f7839218 Fix for [#19299] Color render bug
Caused by very evil AO subtractive mode going negative once again...
2009-11-05 03:39:42 +00:00
e9ce90c238 Fix bug #19699: point density texture doesn't save particle system.
Non-ID pointers in DNA can only point to data from own ID block, so
now instead it uses an index into the particle system list, but still
exposed as a pointer through RNA.
2009-11-04 08:44:42 +00:00
8cbad63c22 Fix [#19759] Point Density Texture
Use derivedmesh functions to get object vertices, rather than objectren verts (which can not exist if object is non-renderable)
2009-11-03 06:04:42 +00:00
5fb73d8b81 Make compiler happy, remove doubtful non init usage. 2009-10-21 17:56:26 +00:00
9327dd9112 Bugfix: render clipping was not using correct matrix, own mistake
in recent commit.
2009-10-20 19:14:55 +00:00
022be64517 Bugfix: raytracer building could crash (abort due to an assert), when
using for example a text object scaled down to size zero. This was due
to nan's generated through division by zero.
2009-10-20 18:27:46 +00:00
401c185fbc Get 2.5 trunk to compile. this C++ code failed for gcc 3.3.
Error log:

/usr/include/gcc/darwin/3.3/c++/cmath: In function `float std::ceil(float)':
/usr/include/gcc/darwin/3.3/c++/cmath:175: error: parse error before `(' token
/usr/include/gcc/darwin/3.3/c++/cmath: In function `float std::floor(float)':
/usr/include/gcc/darwin/3.3/c++/cmath:249: error: parse error before `(' token
/usr/include/gcc/darwin/3.3/c++/cmath: In function `float std::fmod(float, 
   float)':
/usr/include/gcc/darwin/3.3/c++/cmath:267: error: parse error before `(' token
2009-10-19 17:47:24 +00:00
60c50dda70 Fix #19678: full sample / save buffers was crashing due to two issues:
* Nested write lock on render results.
* RayHits pass was always enabled, commented it out now.
2009-10-19 13:09:24 +00:00
243e024a63 Fix #19683: rendering with compo nodes but no render layer node crashed. 2009-10-19 11:04:56 +00:00
256348eb6b Fix #19657: crash when cancelling volume material render, raytree
is invalid if it cancels during build, so don't use it then.

Also fixes some use of unitialized variables in raytracing code.
2009-10-19 09:54:25 +00:00
29e738f60c Bugfix: deep shadow buffer commit made mixed solid/ztransp rendering
not work correct without OSA.
2009-10-15 09:56:10 +00:00
3d57e84088 Bugfix: new bump mapping with UV coordinates wasn't working
correct, my mistake in merging the patch.
2009-10-14 11:17:59 +00:00
8884f3fe5c Bugfix: compositing nodes + border render + crop didn't work correct. 2009-10-14 09:40:09 +00:00
f4d2926986 Fix [#19602] Rayshadow that goes through transparent plane disappears
(some bugs may show on other places if some of the code isnt prepared to handle non-normalized is->vec)
2009-10-13 10:52:18 +00:00
10198e99ff Deep Shadow Buffer
Since the deep shadow buffer summer of code project is not actively under
development anymore, I decided to build my own DSM implementation from
scratch, based on reusing as much existing shadow buffer code as possible.
It's not very advanced, but implements the basic algorithm. Just enough so
we can do shading tests with it, optimizations and other improvements can
be done later.

Supported:
* Classical shadow buffer options: filter, soft, bias, ..
* Multiple sample buffers, merged into one.
* Halfway trick to support lower bias.
* Compression with user defined threshold.
* Non-textured alpha transparency, using Casting Alpha value.
* Strand render.

Not Supported:
* Tiling disk cache, so can use a lot of memory.
* Per part rendering for lower memory usage during creation.
* Colored shadow.
* Textured color/alpha shadow.
* Mipmaps for faster filtering.
* Volume shadows.

Usage Hints:
* Use sample buffers + smaller size rather than large size.
* For example 512 size x 9 sample buffers instead of 2048 x 1.
* Compression threshold 0.05 works, but is on the conservative side.
2009-10-12 19:41:40 +00:00
0c0aa79cb9 * crash fix in volume render, less reliance on global R 2009-10-11 23:04:01 +00:00
deb30e8f9e Fix #19571 (reported by Markus Ilmola):
Added missing callbacks. Was leading to crashs when the raytree was empty.
2009-10-10 18:42:20 +00:00
0b23e65e86 * more small raytrace fixes 2009-10-09 22:06:23 +00:00
a5b30906ad Bugfix: texture nodes render without OSA was using uninitialized
variables, giving incorrect results.
2009-10-09 20:59:44 +00:00
208d57323e Fixed #19571
(was crashing when building a raytree from a scene withouth any geometry)
2009-10-08 11:24:06 +00:00
ef13a40fed Makefile: Add missing raytrace directory. 2009-10-07 19:29:39 +00:00
cf4f00b2fa Preview Render:
* Fixes for texture and material nodes.
* Texture node previews now work more like materials.
2009-10-07 14:48:29 +00:00
f5a9f420fb * More fixes post-raytrace commit 2009-10-07 12:17:29 +00:00
91400d9da8 * Fix for crash with new raytree 2009-10-06 23:05:53 +00:00
9e38ec2506 Add raytrace subdir to Makefiles.
The makefile is a copy of the source one, not tuned, just to unbreak build.
This raises some questions: why separate dirs? why each build system takes
a different approach (different libs vs all source files into one)?
2009-10-06 17:01:00 +00:00
2011ba50c8 Last fix still failed to link under mingw.
This time it works! (gcc and mingw can handle compile and link)
2009-10-06 12:23:25 +00:00
ba3ec58d01 *Added memset's to make sure counters start on zero
*Disabled ray counter (can be enabled on render/extern/include/RE_raytrace.h by commenting out the define)
*marked bvh_node_merge() as static inline (hopping it now compiles on gcc and mingw)
2009-10-06 10:52:14 +00:00
08deeee455 One last try - this should fix the remaining issues:
* Made bvh_node_merge() in svbvh.h static (fix suggested by jaguarandi). This makes mingw link again.

* Also, patched my previous fix for  ... = {}; since mingw didn't like the other fix (which was for msvc).
2009-10-06 10:32:07 +00:00
c93127d06f Some more compile fixes for jaguarandi's commit, this time for msvc+scons
* Replaced ... = {}; with ... = {0}; 

* Solved problem with logf(), where msvc couldn't figure out which version of log() to call (solved by casting the int argument to a float, but could also have been to double)...

* The cflags and cxxflags for scons when compiling the rendering module were only valid for gcc compiles. These will still need to get added for msvc sometime, but for now, there are no more warnings about unknown options...
2009-10-06 10:23:25 +00:00
1c940d7677 Attempts at some compile fixes for jaguarandi's code:
* mingw almost compiles again cleanly, except for a linking error when linking blender http://www.pasteall.org/8297
* win64 should compile again too to a similar degree?
* silenced warnings about no newlines...
2009-10-06 03:40:50 +00:00
63a88075b5 svn merge -r 23528:23646 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2009-10-06 01:58:22 +00:00
11bdf6ea10 Added #ifdef __SSE__ so it can still build when SSE is disabled at compile time 2009-10-06 00:28:07 +00:00
a62e37bfbe blibvh safe for 64bits 2009-10-05 23:30:00 +00:00
af522abf33 * changes/additions to volume lighting
Volumes can now receive shadows from external objects, either raytraced shadows or shadow maps.

To use external shadows, enable 'external shadows' in volume material 'lighting' panel. This an extra toggle since it causes a performance hit, but this can probably be revisited/optimised when the new raytrace accelerator is integrated. For shadow maps at least, it's still very quick.

Renamed 'scattering mode' to 'lighting mode' (a bit simpler to understand), and the options inside. Now there's:

- Shadeless
  takes light contribution, but without shadowing or self-shading (fast)
  good for fog-like volumes, such as mist, or underwater effects
  
- Shadowed (new)
  takes light contribution with shadows, but no self-shading. (medium)
  good for mist etc. with directional light sources
  eg. http://vimeo.com/6901636
  
- Shaded
  takes light contribution with internal/external shadows, and self shading (slower)
  good for thicker/textured volumes like smoke
  
- Multiple scattering etc (still doesn't work properly, on the todo).
2009-10-05 02:59:47 +00:00
55541d8a81 Added some test_break during the build process.
(Maybe later this should be done with some thread_cancel function instead of doing variable/callbacks tests)
2009-10-04 16:56:00 +00:00
8da55763b5 *Updated UI options and added UI options to:
control whether instances are used or not
	control whether vertexs are stored localy or not

*Removed unsused code
2009-10-01 18:30:59 +00:00
022a343223 Texture stack influences are now all separate values, and negative
mapped values now have their influence negated instead. Also a few
RNA changes for TextureSlot.

Bumped subversion for the version patch.
2009-10-01 17:15:23 +00:00
b466286c3e Render & Compositing Thread Fixes
* Rendering twice or more could crash layer/pass buttons.
* Compositing would crash while drawing the image.
* Rendering animations could also crash drawing the image.
* Compositing could crash 
* Starting to rendering while preview render / compo was
  still running could crash.
* Exiting while rendering an animation would not abort the
  renderer properly, making Blender seemingly freeze.
* Fixes theoretically possible issue with setting malloc
  lock with nested threads.
* Drawing previews inside nodes could crash when those nodes
  were being rendered at the same time.

There's more crashes, manipulating the scene data or undo can
still crash, this commit only focuses on making sure the image
buffer and render result access is thread safe.


Implementation:
* Rather than assuming the render result does not get freed
  during render, which seems to be quite difficult to do given
  that e.g. the compositor is allowed to change the size of
  the buffer or output different passes, the render result is
  now protected with a read/write mutex.
* The read/write mutex allows multiple readers (and pixel
  writers) at the same time, but only allows one writer to
  manipulate the data structure.
* Added BKE_image_acquire_ibuf/BKE_image_release_ibuf to access
  images being rendered, cases where this is not needed (most
  code) can still use BKE_image_get_ibuf.
* The job manager now allows only one rendering job at the same
  time, rather than the G.rendering check which was not reliable.
2009-09-30 18:18:32 +00:00
71b3088596 Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.

Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.

There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering

Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)

More revisions to come later...
2009-09-29 22:01:32 +00:00
15d07720e5 Sorry, three commits in one, became difficult to untangle..
Editors Modules

* render/ module added in editors, moved the preview render code there and
  also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
  making a single physics_ops.c for operators and keymaps. Also move all
  particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
  specificially.

Updates & Notifiers

* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
  which will go back to a callback in editors. Eventually these should
  be in the depsgraph itself, but for now this gives a unified call for
  doing updates.
* GLSL materials are now refreshed on changes. There's still various
  cases missing, 
* Preview icons now hook into this system, solving various update cases
  that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
  problem is avoided in the new system.

Icon Rendering

* On systems with support for non-power of two textures, an OpenGL texture
  is now used instead of glDrawPixels. This avoids problems with icons get
  clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
  and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
  with the default setup. The glDrawPixels implementation on Mac seems to
  have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
  you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
  be used with threads reliably.
2009-09-29 19:12:12 +00:00
04fdec2017 svn merge -r 23207:23528 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2009-09-28 13:05:03 +00:00
82198721d6 Raycounters fix 2009-09-28 10:25:12 +00:00
1305715d2d *Added VlakPrimitive (this rayobject rimitive only stores ObjectRenderInstance and VlakRen pointers)
- it difers from RayFace that localy stored the vertex coordinates.
- basicaly this reduces memory usage
2009-09-24 22:55:57 +00:00