Commit Graph

687 Commits

Author SHA1 Message Date
902a69a7d3 Numerous fixes in Render code:
- Bug: material emit was ignored (showed in preview render backdrop)
- Bug: world exposure was ignored
- Bug: lamp halo was ignoring 'render layer light override'.

Further reshuffled the way shadows are being pre-calculated, this to enable
more advanced (and faster) usage of Material lightgroups. Now shadows are
being cached in lamps, using a per-sample counter to check if a recalc is
needed. Will also work (later) for Raytracing node shaders.

- New: Material LightGroup option "Always", which always shades the lights
  in the group, independent of visibility layer. (so it allows to move such
  lights to hidden layer, not influencing anything).
2006-12-08 09:40:44 +00:00
fb261464b0 Bug, caused by render recode for passes: raytraced transparency didn't
clear osa vectors for UV, causing textures to not show correct when
traced.
2006-12-07 21:48:31 +00:00
aae544e9f4 Pass render errors (thanks to irc review, thanks ZanQdo!)
- Color for refraction was added wrong (was using 3 x r, instead of rgb)
- Refraction was added on top of specular in Combined, should not.
2006-12-07 17:54:15 +00:00
40c77590f9 Small plumiferos wishlist item.
Adds a button next to the threads button to disable texture processing
in a render.  If anyone doesn't like the button feel free to revert this
one, its pretty simple.

Kent
2006-12-07 16:48:15 +00:00
17231f83f3 Work on RenderLayer and Pass control:
Full log:
http://www.blender3d.org/cms/Render_Passes.829.0.html

In short:
- Passes now have option to be excluded from "Combined".
- RenderLayers allow to override Light (Lamp groups) or Material.
- RenderLayers and Passes are in Outliner now, (ab)using Matt's nice
  'restriction collumns'. :)
2006-12-07 14:17:38 +00:00
49f1375638 Another fix for pass recode: lamp shadow for lamps not in visible
render-layers or with option "only layer" was still calculated, giving
unnecessary slowdowns.
2006-12-06 15:48:40 +00:00
a720296999 Another 3-in-one commit:
- Unitialized variable in new shadow code caused Sun lamp shadow to not
  work.
- Ipo handle bug: when the handle was vertical it flipped around
- Loop select: unitialized variable caused it to work unpredictable in
  cases. Also found an unitialized var in collaps_edgeuvs().
2006-12-06 11:17:34 +00:00
54e946e839 Three fixes:
- Crash, caused by commit of 1 hour ago to fix 'All Z' render problem
- Bug: yesterday's fix for node material renders caused some issues with
  precalculating correct shadow.
- Composite Translate node: input sockets allowed multiple inputs
2006-12-06 09:56:20 +00:00
cf1cbbd979 Render error: option "All Z" for render layers crashed. I forgot it uses
face index -1 for it... :)
2006-12-06 08:10:13 +00:00
5e52bee5a7 Node shaders bug: using 'shadeless' material inside of node tree, a mode
flag messed up that tried to detect if shadow was needed.
2006-12-05 19:47:45 +00:00
084179bb39 Bugfix, irc report:
OSA 16 crashed. Wrong sizeof() for memset...
2006-12-05 18:58:58 +00:00
2c816da097 Two fixes:
- Shaded view was black, needed to tell it to use 'combined' pass :)
- Crash when deleting in compositor all nodes with an output.
2006-12-05 18:02:43 +00:00
4f8079d49c Modifier Stack: Limit calculation to required data.
This commit upgrades the modifier stack to only calculate the data which is
needed, either by modifiers further down the stack or by other functions at
the end of the stack (e.g. drawing functions).

This speeds up modifier stack recalculation, especially where vertex
groups and UV coordinates are concerned. For example, a mesh with an Armature
modifier followed by a Subsurf modifier would previously have required the
Subsurf modifier to interpolate all the vertex groups in the mesh, slowing
down modifier calculations considerably. With this update, vertex group data
is not propagated beyond the Armature modifier, so calculations are faster.

Note that this depends on the order of modifiers in the stack. If the Armature
and Subsurf modifiers were swapped in the above example, the Subsurf modifier
would have to interpolate vertex groups, as they are needed by the Armature
modifier.
2006-12-05 17:42:03 +00:00
3177c4f69f Next stage of RenderPipe refactor: now everything within the pixel was
tackled.

Resulting features:
- render passes
- new pass: Object Index, for masking
- sub-sample alpha masks

Docs:
http://mediawiki.blender.org/index.php/BlenderDev/RenderPipeline
http://www.blender3d.org/cms/Render_Passes.829.0.html
http://www.blender3d.org/cms/New_Render_features.774.0.html

Note that these changes might mean things to not render fully identical...
For the next days a lot of testing is needed!
2006-12-05 16:43:01 +00:00
b4b6dd2654 Simplified/fixed code for rendering with multires+modifiers, no more unfree memory warnings 2006-12-01 21:35:27 +00:00
20ac94e8f0 Two hours of fixing details based on Klocwork source review. Useful report,
although it has a lot of noise. Not to mention our bad string code gives
a load of warnings.

I've reviewed specifically:
- file reading/write
- dna and library code
- node system
- entire render module

Done a couple of files in src/ too, seemed to be nice errors.
2006-12-01 19:52:04 +00:00
5a3959e54b Thread support for commandline:
-t <threads>

It overrides the settings as saved in scenes. Only works for background
rendering, to force thread amounts to match the cpus in system.
For funny jokers: amount is clipped for MAXTHREADS :)
2006-11-29 19:31:45 +00:00
6543d3e220 Render Monster support: (part 1)
Removed all limitations from render code for maximum threads. The only
define for this now is in BLI_threads.h, and currently set to 8.
Note that each thread renders an entire tile, and also allocates the
buffers for the tiles, so; more threads might work better with smaller
tiles.

IMPORTANT: node system won't work yet with more than 2 threads! So, don't
try material nodes or compositing with over 2 threads. That I'll commit
later today.

What does work (should work :) is AO and soft shadow now.
2006-11-29 17:01:09 +00:00
401a42b698 Bake Render bug: check for which image to filter (bleed) used wrong
flag, picking wrong images (or even ones without buffer, so crashing).
2006-11-28 18:28:23 +00:00
c1258980a4 Render Baking upgrade:
- Now baking itself is threaded too (like for render, max 2 cpus. Moving
  this to 4 cpus is on todo. Goes twice as fast!

- fix: ESC from bake was broken...

- other fix: toolbox menus didn't treat sublevel string lengths OK,
  truncating items like for Group library names.
2006-11-28 10:16:24 +00:00
3ccfa7709e Bugfix #5311
AO with option "Use Distances" gave artefacts. This because the raytracer
was still returning on any hit, instead of find the closest hit.
2006-11-27 12:06:35 +00:00
e600fdb882 Bugfix #5292
Crash is irregular shadow buffer, due to using un-initialized memory
2006-11-24 15:11:29 +00:00
7cb76f4bf9 Render Baking candy: while baking, the UV Image window shows the progress
in rendered images, once per second. Also switches to other images.

This happens threaded, so might need a good test :)
2006-11-22 18:45:34 +00:00
967869fecd Bugfix #5277
Bake-render:
Quad faces still didn't get handled properly, error visible for vertex
color or UV textures.

Also: added error meny when a Bake cannot work because there are no Images
or no Images with buffers
2006-11-21 18:09:32 +00:00
20e6dc7f57 Bugfix, own collection:
Random seeding is still not perfect in render, especially lack of good
thread support still.

- VectorBlur node was calling seed for each exec, causing other nodes to
  get fixed random too.
- added seed in non-OSA main loop for render
- use BLI_srandom, is better than BLI_srand
2006-11-21 15:52:45 +00:00
e75a2773fa Bugfix #5265
3D window, preview panel, didn't give correct specular for Ortho.
The view-vector was flipped negative then, so more view-depending
code (like tracing) would go wrong then.
2006-11-21 12:41:07 +00:00
c57d5bca73 Step one in migrating to use glArray calls in Blender
- Curve/Nurbs/Font/MBall now all draw arrays.
- had to flip abgr to rgba in shaded drawing
- Mesh drawing can't be easily done; the indices for faces are not in
  in one chunk. Also need a way to gether trias/quads, per material.

Speedup results are mixed. Something between 2-4 times. Especially for
text it seems to help.
2006-11-20 21:25:02 +00:00
5428f2eb6c * Object level restrictions in outliner
This adds the ability to restrict an individual object from:
- being visible in the 3D View
- being selectable in the 3D View
- being renderable
with 3 columns of buttons in the outliner.

These restrictions are further down the hierarchy than layers, so for example if an object is in an invisible layer, it will be invisible regardless of whether the object's own visibility setting is on or off. This works on a different conceptual level than layers, being better for more quick interaction (like temporarily making a mesh unselectable while you're posing its armature), rather than so much for scene organisation.

The 3 columns of icons can be turned off in the Outliner View menu.

Along with this is some small cleaning up in interface_icons.c and outliner.c.
2006-11-20 05:12:58 +00:00
e435fbc3c5 Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.

Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData


Replaced TFace by MTFace:

This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.


Removed DispListMesh:

This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.


Removed ssDM and meshDM DerivedMesh backends:

The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.


This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00
4ebf5223ba Render Baking:
- Bugfix: vertex normals were still flipped around, to match viewpoint
  rendering.
- New: option to bake a texture+material only
2006-11-19 18:44:54 +00:00
c47fa4d0ec Long waited feature: Render Baking
Here's the full release log with example file.
http://www.blender3d.org/cms/Render_Baking.827.0.html

For people who don't read docs; just press ALT+CTRL+B on a Mesh
with texture faces!

Todos:
- maybe some filter options extra?
- Make normal maps in Tangent space
2006-11-19 14:12:56 +00:00
28769382d2 Fix for use of an unitialised variable, added this myself some time ago
changing to threaded MEM_malloc.
2006-11-17 18:17:56 +00:00
206f2cab67 Group duplicator fix: the invisible group objects didn't draw, but were
still visible in render.
2006-11-15 08:20:53 +00:00
d43ca75b8a Bugfix 5182
Mist option and "Ray Transp" didn't work together yet. Transparency
during tracing should not be influenced with mist though (as is for
Ztransp), so for this case an extra color blending after raytrace is
added. Still pretty primitive... mostly because mist isn't volumetric
in Blender at all... just an alpha trick.
2006-11-13 14:33:36 +00:00
8e487f3e29 Ooops, previous commit of mine forgot to commit the .h file. 2006-11-12 16:24:59 +00:00
a56b95c049 Bugfix #5107
Autosmooth didn't copy additional texture coordinates such as sticky
correctly. This was part of the vertex struct in 2.41 and older, but it
became dynamic in 2.42.
2006-11-12 11:41:43 +00:00
72f620fef3 Bugfix #5207
Silly error in code initialized envmap "Render" struct wrong. It didn't
work for ortho render, so also crashed on previews in ortho 3d window.
2006-11-12 11:03:34 +00:00
2a0ef5454d Bugfix #5199
Irregular shadow buffer, for solid OSA case, suffered aliasing. This caused
by optimized storage of shadow factors in 1 pixel (averaged for all sub
samples). That didn't work well really...

Now the code uses same method as for transparent faces, storing results for
each sample.
2006-11-10 14:21:27 +00:00
ac14a2c2b7 Bugfix #5197
Radiosity tool or render was using an uninitialized variable, causing clip
to work incorrect. (black lines in radiosity).

Error caused by commit in august, after 2.42a release.
2006-11-10 11:54:36 +00:00
cea2b6752b Bugfix #5188
Material type OnlyShadow didn't work yet for irregular shadow buffer.
2006-11-08 18:47:38 +00:00
71d7409fda Patch #4940, by Wybren van Keulen
The 2-point perspecitve Architecture Camera!
http://www.funnyfarm.tv/patch_lens_shift/patch_lens_shift.mov

Full log:
https://projects.blender.org/tracker/index.php?func=detail&aid=4940&group_id=9&atid=127
2006-11-06 15:42:38 +00:00
8e97a2955b Merged Google Summer of Code sculptmode/multires/retopo tools.
From the tracker:
https://projects.blender.org/tracker/index.php?func=detail&aid=5018&group_id=9&atid=127
2006-11-06 01:08:26 +00:00
9d67a597bc Irregular shadow fix: the MemArena module didn't give callocs, only malloc.
Made nice crashes that way... but not in !@%@$ OSX because it seems to
clear memory unwanted. Solve dit with adding API call in MemArena to default
to callocs.

Also removed malloc() from MemArena, replaced with MEM_mallocN().
2006-10-24 15:17:14 +00:00
da12c9571b Bug provided by Plumiferos team on conference:
In some cases faces were skipped from rendering, when using multiple
RenderLayers. Was caused by a "don't render" flag hanging. Error was
introduced with the "All Z" RenderLayer option.
2006-10-24 14:14:20 +00:00
Nathan Letwory
88446eeca4 Patch 5105 by Joshua Leung (Aligorith), slightly modified by me
* Add WITH_BF_YAFRAY, which per default is 'true', so no visible changes for developers (and users).

Set WITH_BF_YAFRAY to 'false', and you'll save some major compile time :) Also handy if you're strapped for memory and compilation fails on yafray compilation due
 to this.

- this commit also has a few whitespace changes and
- made BF_NO_ELBEEM a proper BoolOption. This will be renamed to WITH_BF_ELBEEM in the near future...
2006-10-18 05:45:47 +00:00
9fa438b4e9 Another shadowbuffer goodie: the "Halfway trick"
http://www.blender3d.org/cms/Shadow_buffer__Halfway.786.0.html

Simply said: by using the average of the nearest and 2nd nearest Z value
in Shadowbuffers you can reduce bias errors very well.
For backwards compatibility it is a new buffer type though.
2006-10-15 11:50:46 +00:00
05ee7d9053 =translate hoek to angle=
renamed the dutch variable hoek to angle globally arithb.c changes done by Matt Plough
2006-10-14 23:27:18 +00:00
bc10cf38b9 Irregular shadow bug: mixing up zmin and zmax in optimize caused larger
faces to miss casting shadow.
2006-10-14 15:26:15 +00:00
e868f223dc New shadow feature: Irregular Shadow Buffers
Full log:
http://www.blender3d.org/cms/Irregular_Shadow_Buffe.785.0.html

In short: this is a shadow buffer approach that always results in crispy
shadows, independent of lamp buffer size or zoom level. This shadow buffer
system also supports transparent shadow.

This is part of work on refreshing Shadow Buffers in Blender. You now can
choose of two types (Classical, Irregular). More types will follow. Also
quality issues for Classical shadow buffers are going to be reviewed,
especially to solve the lousy Biasing.

For the CVS log record; it is based on articles:
Gregory Johnson et al, University of Texas, Austin. (Regular grid method).
Timo Aila and Samuli Laine, Helsinki University of Technology. (BSP method).
2006-10-14 10:21:19 +00:00
dfa01a56ba Fix for bug #5044: random crashes when rendering.
This one is of my own making, removed too many locks. Thanks Malefico for reporting.
2006-09-30 21:29:47 +00:00