Commit Graph

3559 Commits

Author SHA1 Message Date
460dd7a7bb Render Instancing
=================

Big commit, but little user visible changes.

- Dupliverts and duplifaces are now rendered as instances, instead
  of storing all of the geometry for each dupli, now an instance is
  created with a matrix transform refering to the source object.
  This should allow us to render tree leaves more memory efficient.

- Radiosity and to some degree raytracing of such objects is not
  really efficient still. For radiosity this is fundamentally hard
  to solve, but raytracing an octree could be created for each object,
  but the current octree code with it's fixed size doesn't allow this
  efficiently.

- The regression tests survived, but with I expect that some bugs will
  pop up .. hopefully not too many :).

Implementation Notes
====================

- Dupligroups and linked meshes are not rendered as instances yet,
  since they can in fact be different due to various reasons,
  instancing of these types of duplis that are the same can be added
  for them at a later point.

- Each ObjectRen now stores it's own database, instead of there being
  one big databases of faces, verts, .. . Which objects that are actually
  rendered are defined by the list of ObjectRenInstances, which all refer
  to an ObjectRen.

- Homogeneous coordinatess and clipping is now not stored in vertices
  anymore, but instead computed on the fly. This couldn't work for
  instances. That does mean some extra computation has to be done, but
  memory lookups can be slow too, and this saves some memory. Overall
  I didn't find a significant speed impact.

- OSA rendering for solid and ztransp now is different. Instead of e.g.
  going 8 times over the databases times and rendering the z-buffer, it
  now goes over the database once and renders each polygon 8 times. That
  was necessary to keep instances efficient, and can also give some
  performance improvement without instances.

- There was already instancing support in the yafray export code, now it
  uses Blender's render instances for export.

- UV and color layer storage in the render was a bit messy before, now
  should be easier to understand.

- convertblender.c was reorganized somewhat. Regular render, speedvector
  and baking now use a single function to create the database, previously
  there was code duplicated for it.

- Some of these changes were done with future multithreading of scene
  and shadow buffer creation in mind, though especially for scene creation
  much work remains to be done to make it threadsafe, since it also involves
  a lot of code from blenkernel, and there is an ugly conflict with the way
  dupli groups work here .. though in the render code itself it's almost there.
2007-12-15 20:41:45 +00:00
60972ad458 Bugfix for SSS crash with nan's. 2007-12-11 14:35:08 +00:00
51322964f4 Particles
=========

- Normalize strand coordinates over the length of the strand, not
  cut off when with e.g. length texture control.
- Weight paint and particle mode x-mirror now works with deformation
  and shape keys active.
- X-ray is now disabled in particle mode, messed up depth tests.
2007-12-06 17:43:47 +00:00
29d87d64ca Particles
=========

- Texture orco coordinates for particles are now actual orcos instead
  of just the vertex positions, which means they are the same under
  deformations and the same as the ones on the mesh.
- Particle distribution now uses these orcos to get consistent
  distributions independent of deformation.
- This required changing the way orco's are computed for meshes. Now
  instead of generating an orco derivedmesh separately, the derivedmesh
  is generated alongside the regular one and stored in an orco custom
  data layer.
2007-12-05 12:40:54 +00:00
25ea528a29 Bugfix: de-premul for image texture didn't happen for non-osa case. 2007-12-04 19:06:00 +00:00
d3bd96ba6c Strand render bugfixes:
- Fix compile error.
- Some changes to bucketing.
- Tweak acceleration button increase size.
2007-12-04 17:53:03 +00:00
09b9a1e3f7 Addition to previous strand render bugfix. 2007-12-04 17:19:30 +00:00
c50dfa4379 Strand render bugfixes:
- Accidentally made minimum blender unit strand size bigger again.
- Make layer option for lamps work.
2007-12-04 16:55:01 +00:00
43c7cb994e SSS now uses oversampling for textures in the preprocessing pass,
to fix noisy renders, to solve patch #7865.
2007-12-04 15:11:33 +00:00
32a8b4f8e6 Particles
=========

- Fix crash in particle transform with the particle system not editable.
- Particle child distribution and caching is now multithreaded.
- Child particles now have a separate Render Amount next to the existing
  Amount. The render amount particles are now only distributed and cached
  at render time, which should make editing with child particles faster.

- Two new options for diffuse strand shading:
	- Surface Diffuse: computes the strand normal taking the normal at
	  the surface into account.
	- Blending Distance: the distance in Blender units over which to
	  blend in the normal at the surface.
- Special strand rendering for more memory efficient and faster hair and
  grass. This is a work in progress, and has a number of known issues,
  don't report bugs to me for this feature yet.

More info:
http://www.blender.org/development/current-projects/changes-since-244/particles/
2007-12-04 13:57:28 +00:00
0412d62309 Blending mode "Overlay" was not coded yet for material blending. 2007-12-03 16:06:34 +00:00
eff09ae396 For the OpenGL render option in the 3d view, if a camera is active,
it now sets the viewport exactly the same as if rendering.
2007-12-01 19:29:50 +00:00
4ba215478f Italian community request: Area light fix!
http://peach.blender.org/index.php/area-light-fix-light-not-shadow/

Now, for every possible shadow sample, an area light calculation is 
done from that position.
2007-12-01 17:55:16 +00:00
04a009b047 Point cache was reset in many updates where it shouldn't have been reset.
Preview render crashed with "only render" children.
2007-11-30 07:41:22 +00:00
561319989e Render Baking
=============

A new "Selected to Active" option in the Bake panel, to (typically) bake
a high poly object onto a low poly object. Code based on patch #7339 by
Frank Richter (Crystal Space developer), thanks!.

Normal Mapping
==============

Camera, World, Object and Tangent space is now supported for baking, and
for material textures. The "NMap TS" setting is replaced with a dropdown
of the four choices in the image texture buttons.


http://www.blender.org/development/current-projects/changes-since-244/render-baking/
2007-11-28 22:21:12 +00:00
da3c35db47 Particles
=========

- Bugfix: synchronize modifier enable with particle enable flag to
  prevent crash.
2007-11-27 12:34:59 +00:00
e39b5f790d Particles
=========

- Fix for bug #7832: boids physics crashed.
- Bugfix for child particles not getting orco texture coords.
- Allow smaller strand sizes in blender units.
- Fix for a common but harmless uninitialized value warning in
  valgrind, in the event queue.
2007-11-27 09:59:18 +00:00
7da56f4a9b Particles
=========

Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:

- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.

.. and lots of other things, some more info is here:

http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc

The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.

Point Cache
===========

The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.

See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint

Documentation
=============

These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
af26256da4 Bugfix #7802
Fixed very old annoyance in alpha render: when using alpha textures images,
nicely premulled as Blender wants it, you still got dark outlines at the
edges. This because the blender shading pipeline also premultiplies.

Solution: de-premul image texture colors after sampling.
2007-11-23 14:48:26 +00:00
885593ca21 Fix for bugs #6709 and #7005:
- SSS not working with negative scale objects.
- Fluids + SSS not always rendering smooth normals correct.
2007-11-23 14:10:05 +00:00
cbceb9bf66 * Fixed own bug: glossy reflections was erroneously giving a
distorted copy of the original face normal, meaning that on 
smooth shaded faces, sometimes the check to keep rays 
reflected out away from the face wasn't working, and the ray 
would intersect when it shouldn't.
2007-11-15 06:07:02 +00:00
d273ae0571 * New material option: TexFace Alpha
This is an additional option for 'TexFace', which uses the alpha of 
the UV assigned faces as well as the colour. It appears in material 
buttons as a little 'A' button next to 'TexFace', when 'TexFace is 
switched on. It's a bit horrible, but no point tweaking that layout in 
isolation at this stage.

This image is using texface alpha, with different assigned images, all 
sharing the one material:
http://mke3.net/blender/devel/rendering/texface_alpha.jpg

Usually I consider texface (and teaching people to use it for UV 
mapping) to be pretty evil, but in some cases, when you have lots of 
separate images that you want to control in the one material, it can 
be quite handy.
2007-11-15 00:11:00 +00:00
0ca299439c Bugfix #7686
Render, Ortho, lamphalo position was off a bit due to missing correction
factor.
2007-11-14 10:20:13 +00:00
da7175476d Bugfix #7735
Spothalo sometimes gave black pixels. Error was using floating point
32 bits precision checks where double should be used.

(10e-7 vs 10e-16)
2007-11-12 09:37:46 +00:00
8a3f926938 Stampinfo: added correct redraw after adding stamp.
The issue: while renderprogress is in use, the rr->renlay has to be set
2007-10-29 13:11:42 +00:00
e448f20db5 Routine purge of compiler warnings. Yet again, they were mostly uninitialised vars. 2007-10-29 05:59:26 +00:00
7718b3d642 render stamp drawing is now done everywhere - (not just when saving
images)
separated stamp metadata and stamp draw functions.
2007-10-28 22:27:07 +00:00
a9110ee033 * Adaptive QMC AO feature - "Adapt from speed vectors"
This is a new feature that can make using AO a lot more attractive when rendering 
animations with vector blur. It uses the speed vector info calculated in the 'Vec' 
speed vector pass, in order to reduce AO samples where pixels are moving more 
quickly. There's not much point calculating all those AO samples when the result is 
going to be smeared anyway, so you can save a bit of render time by doing 
a more noisy render in those areas.


You can use this with a new slider in the Adaptive QMC settings 'Adapt Vec'. The 
higher the value, the more aggressively it will reduce samples. 0.0 means no 
reduction, and 1.0 reduces one sample per pixel of average displacement for that 
pixel. 0.25 or so generally gives decent results, but it depends on how fast things 
are moving.

Here's a demo (compare the final blurred result, and render times):
http://mke3.net/blender/devel/raytracing/adapt_speed_off2.jpg
http://mke3.net/blender/devel/raytracing/adapt_speed_on2.jpg

And a less contrived example, a short clip from macouno's 'petunia' bconf animation:
http://mke3.net/blender/devel/raytracing/petunia-adaptvec-noblur-h264.mov
http://mke3.net/blender/devel/raytracing/petunia-adaptvec-blur-h264.mov
2007-10-24 12:42:08 +00:00
00237a08e7 * Fix for bug #7633: SSS makes QMC crash
This occurred when using qmc shadows, full OSA, and sss - it was 
assuming full OSA was being used, even when (during the SSS prepass) 
osa is set to 0.

Fixed by tightening up the checks for full OSA.
2007-10-23 03:13:34 +00:00
c1b9b32b8b * Brought eeshlo's halton_sample fix into trunk 2007-10-23 01:52:26 +00:00
dac77c4749 * Fix for bug # 7396 "Refraction Pass Being added to combined when not told to"
For the record, I think the way these reflection and refraction passes are handled (as a difference against the diffuse pass) is not very useful - especially if you want to do colour corrections, blurring, etc. It would be much more practical for the passes to contain the ray result returned by the raytrace...
2007-10-18 09:18:04 +00:00
3a46c74a6e * Fix for bug #7445, black dots when using Constant QMC AO sampling
Was a bit of a typo that only showed up when ao samples UI value was less than oversample level
2007-10-03 14:55:00 +00:00
f7cd7bc1b9 * Adaptive QMC ray shadow sampling wasn't working with transparent shadows - fixed. 2007-09-24 13:17:42 +00:00
70edf4e293 fixing some compile problems with MSVC7.1/scons
* stupid misplacement of declaration
* replacing fmodf with fmod (fmodf not available with MSVC7.1 when compiling C-code)
* appending CXXFLAGS to CCFLAGS in tools/Blender.py to avoid linking errors with runtime library (/MT not set) 
  - jesterKing, could you please check if that's ok?
2007-09-23 13:52:08 +00:00
672a66905b Patch/Bugfix #7334 by 'gsr b3d:
Some more compiler warning fixes. Some of these seem to be specific to GCC 4.1
2007-09-17 06:11:06 +00:00
a36204e1b9 removed an unused function, was giving warnings. 2007-09-17 05:12:57 +00:00
90daa8f811 * Extra lamp falloff options, including custom curve!
This adds some new lamp attenuation options to the Lamp panel, replacing the old 'Quad' button. Yes, the panel layout is still nasty here, but I've ignored it for now to address properly in the panels cleanup work.

* Constant
http://mke3.net/blender/devel/rendering/falloff-constant.jpg
Lamp doesn't decay with distance

* Inverse Linear
http://mke3.net/blender/devel/rendering/falloff-invlinear.jpg
Default, and same as in older Blender without 'Quad' on. Decays linearly, with 'Dist' value as the lamp's half-energy-distance

* Inverse Square
http://mke3.net/blender/devel/rendering/falloff-invsquare.jpg
A sharper, more realistic decay, good for most electric lights (i.e. not sunlight). This is similar to the old Quad option with slight changes.

* Lin/Quad weighted
Exactly the same as in older Blenders with the old 'Quad' button enabled. When this setting is chosen, two sliders are shown, 'Linear' and 'Quad' (previously Quad1 and Quad2), which controls the 'linearness' or 'quadraticness' of the falloff curve. Lamps in old files with the 'Quad' button on will be initialised to this setting.

But much better for precise control over the lamp falloff now is:

* Custom Curve
This shows an extra 'Falloff Curve' panel, where you can use the standard Blender curve UI control to precisely control how the light falls off. The Y axis is intensity, and the X axis is distance, stretched over the length of the 'Dist' value.

Some example curves and renders:
http://mke3.net/blender/devel/rendering/falloff-curve1-curve.png
http://mke3.net/blender/devel/rendering/falloff-curve1.jpg

http://mke3.net/blender/devel/rendering/falloff-curve2-curve.png
http://mke3.net/blender/devel/rendering/falloff-curve2.jpg

http://mke3.net/blender/devel/rendering/falloff-curve3-curve.png
http://mke3.net/blender/devel/rendering/falloff-curve3.jpg (whee)
2007-09-16 13:50:34 +00:00
cbee57342f * Small fix for a slowdown when rendering fully glossy (1.0)
reflecting/refracting materials with ray shadows. Fully glossy 
materials get Full OSA on automatically, so extra redundant samples 
were being calculated for the shadows. This has now been fixed by 
reducing the shadow samples accordingly if Full OSA is on.

Thanks to Benjamin Thery who notified me of this!
2007-09-12 03:27:03 +00:00
c5ef3006b6 * AO bugfix - Constant QMC sampling wasn't getting initialised for bake rendering, causing a crash. 2007-09-11 00:26:15 +00:00
0ba5295404 * QMC Raytracing
This introduces QMC sampling for use in glossy reflections/refractions, soft raytraced shadows, and ambient occlusion.

This work includes many new features and speed-ups, so check out the nice docs here:

Glossy Reflection/Refraction
http://www.blender.org/development/current-projects/changes-since-244/glossy-reflectionrefraction/

Raytraced Soft Shadows
http://www.blender.org/development/current-projects/changes-since-244/raytraced-soft-shadows/

QMC Sampling
http://www.blender.org/development/current-projects/changes-since-244/qmc-sampling/

Many thanks to Brecht van Lommel for some initial code snippets and for reviewing the patch, and especially to Alfredo de Greef who gave me a lot of guidance and help along the way!
2007-09-07 03:48:50 +00:00
6cd6bf7d80 Updated the Makefiles removing some of the gcc specific stuff...
Basically I moved  -funsigned-char -fno-strict-aliasing
from individual Makefiles to nan_compile.mk defines for CFLAGS and CCFLAGS

Kent
2007-08-31 16:16:33 +00:00
6be4742653 * Slight change to lamp energy calculation - make lamps invisible
for shading if their 'visibility factor' is below 0.001. This
gives no perceptible visual difference in my tests, but can 
significantly speed up shading when using lots of omni lights 
with quad falloff over a large area. Since quad lamps never
actually fall off to 0, previously every lamp would be considered 
for shading each pixel, even if such lamps had a tiny falloff 
distance, and were miles away.
2007-08-30 01:47:14 +00:00
c4114780d4 Little code cleanup.
bsystem_time was being called with an extra variable, which was useless. Most of the places that called it, were passing NULL for that variable anyway.

I've also cleaned up that function a bit, but the underlying problems with that part of the code still exist (EVIL GLOBALS that are exported for frame_to_float), for mblur and fields rendering features. That remains for another time.
2007-08-05 09:21:29 +00:00
a84c598b35 Fix for bug in raytrace code refactoring, crash with empty octree. 2007-08-01 09:49:17 +00:00
2e6624a2b8 =Render Bugfix=
Previous bugfix of spec not being included in only shadow lamps had 2 errors.
There weren't any checks for if shi->spec and shi->shad go below 0 because of
an only shadow lamp, and also the code for including spec in only shadow lamps
was slightly wrong.
2007-07-31 05:27:41 +00:00
34e4388a5c Previous bugfix for shadows cast on objects with diffuse reflectivity set to 0
caused errors on only shadow lamps; fixed this by adding back in the original 
intensity > 0.0 check in the only shadow if statement, where it belonged in the
first place.

In addition, the specular pass was not correctly affected by only shadow lamps,
severely reducing the usefulness of this feature.  For example, using four
spotlamps to create an omnidirectional buffered shadow lamp didn't work.
2007-07-27 21:54:01 +00:00
Ken Hughes
c3457718a4 Remove spurious ";" in declaration, which causes warning in gcc and MSVC. Thanks Levi for catching this. 2007-07-27 18:29:58 +00:00
d63da45ca8 Refactor the raytracing code to split the tracing and shading parts into
two separate files, raytrace.c and rayshade.c. The tracing code can now
be used separately from the renderer (will be used in a later commit),
and the raytracing acceleration structure can now also be easily replaced,
if someone wants to experiment with that.
2007-07-26 13:38:24 +00:00
3c99fb6389 Bugfix #6918
- Multilayer EXR files:
  Rendering without "do composite" skipped to render the vector pass

- Also found a wrong loop, missing to clear speed vectors in the first 
  pixel of a tile, causing error print:
  "Found uninitialized speed in vector buffer... fixed"
2007-07-23 14:16:41 +00:00
56b340b45c =Rendering Bugfix=
For some odd reason, shadow calculation was skipped if diffuse was 0.0.  This
however would cause errors where specularity would ignore shadows.  After all,
just because the shaded diffuse of a point is fully black, doesn't mean
the specularity highlight doesn't include that point.

Ton: you might want to look at this, though it's just a one-liner.
2007-07-23 02:28:47 +00:00