Commit Graph

769 Commits

Author SHA1 Message Date
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
6e0d977977 Use texture constants in the interface and added some missing texture constants. 2007-07-19 22:02:22 +00:00
b22a6da7b8 initalize texvec[2] even though its not used, imagewrap checks to make sure its
in a given range.

Kent
2007-06-05 19:39:19 +00:00
98a77bc9c6 Bugfix: SSS with negative lights gave artifacts. 2007-06-02 22:53:19 +00:00
17a219e3c0 == Shader nodes ==
* Geometry node: Front/back output
This is used as a mask for determining whether you're looking at the front side or back side of a mesh, useful for blending materials, my practical need was giving different materials to the pages of a magazine: http://mke3.net/blender/etc/frontback-h264.mov

Give 1.0 if it's the front side, and 0.0 if it's the back side.

* Extended material node
This is the same as the material node, but gives more available inputs and outputs, (basically just connecting up more of ShadeInput and ShadeResult to the node). I didn't want to add it to the normal simple Material node since you don't always need all that stuff, and it would make the node huge, but when you do need it, it's nice to have it.

== Comp nodes ==

* Invert node
Inverting is something that happens all the time in a node setup, and this makes it easier. It's been possible to invert previously by adding a mix node and subtracting the input from 1.0, but it's not the best way of doing it. This node:
 - makes it a lot faster to set up, rather than all the clicking required with the mix node
 - is a lot more usable amidst a complex comp setup, when you're looking at a node tree, it's very helpful to be able to see at a glance what's going on. Using subtract for inverting is easily mixed up with other nodes in which you are actually subtracting, not inverting, and looks very similar to all the other mix nodes that usually litter a comp tree.
 - has options to invert the RGB channels, the Alpha channel, or both. This saves adding lots of extra nodes (separate RGBA, subtract, set alpha) when you want to do something simple like invert an alpha channel. I'd like to add this option to other nodes too.

There's also a shader node version too.


* Also a few fixes that I committed ages ago, but seems to have been overwritten in Bob's node refactor:
 - adding new compbufs to the set alpha and alphaover nodes when you have only one noodle connected to the lower input
 - making the fac value on RGB curves still work when there's nothing connected to it
2007-05-31 06:55:02 +00:00
0907a0dba5 Bugfix #6739
Vector blur error in Ztransp: sometimes black lines (on edges) appeared,
which didn't get blurred away. Caused by zero-init of speed vectors in
sample buffers. (Zero speed -> no motion).

Error in Blender since vblur was added.
2007-05-23 15:27:34 +00:00
1e4057f6fd Bugfix: SSS did not work with panorama render. 2007-05-20 19:01:34 +00:00
33466557fc Disable SSS better for preview rendering, so it does not slow down
other preview renders at all.

Also added a flag to enable/disable SSS per scene. There is no
button for it yet, the Render panel has no space left .. will find
a place for it later.

The subversion number was also increased to enable the flag for
older .blends.
2007-05-17 16:51:09 +00:00
7ddc602ebf Second commit, now it should not bother me with passwords, according
to some person... :)
2007-05-14 19:52:21 +00:00
d90f0b1e16 Testing commit to see how it goes... 2007-05-14 19:50:33 +00:00
a8a8742f1c Showstoppper... mballs didn't get remade correct after render... it was
showing the orcos (size usally smaller).
2007-05-10 17:27:40 +00:00
2a94ae8a81 Fix preview rendering for SSS to not show preprocessing pass that
leads to flickering, and a bug that would display parts of the
preview render as black for interrupted preview renders.

(sorry for the late fix, i've triple checked the code ..)
2007-05-09 16:25:58 +00:00
0d51eb6ceb Bugfix #6663 yesterday, error: forgot to put back in if() for freeing data 2007-05-09 14:12:29 +00:00
e05125b9bd Bugfix #6663
Metaballs, when in editmode, didnt show correct after a render (it was
drawing render resol then).

The code here was confused some... this works, although it will take a
bit more cpu cycles when render resol = display resol. No biggie.
2007-05-08 18:51:40 +00:00
15e79ef4c8 SSS fixes:
- Radius R, G, B sliders had too small number increase on clicking.
- Preview render now renders with higher SSS error setting to speed it up a
  bit.
- bug #6664: 3d preview render had artifacts. re->viewdx/dy wasn't set then,
  which is needed to estimate the area of each point. Have set this now, not
  in the nicest way, there is some bit duplicated code, but I don't want to
  refactor existing code with the chance of breaking it at this point.
- bug #6665: grid like artifacts with parts rendering. The two extra pixels
  around parts used for filtering were used as well, leading to double points.
2007-05-08 10:15:51 +00:00
1e6b2ce207 Assorted SSS fixes:
- Bug #6652: SSS artifacts with ray shadow.
- Bug #6643: AO + SSS crash. couldn't redo this crash myself, but did find a
             bug that may cause a crash, please test.
- Tweak backscattering to avoid thin surfaces rendering too dark.
2007-05-06 05:04:07 +00:00
03040b54b3 Bugfix: SSS render crashed with option "Save buffers".
Apparently brecht wanted to disable it... but enabling it works just OK.
Gives at least uniform code for now.
2007-05-05 13:14:10 +00:00
3a8c6c81d8 Subsurface scattering:
Documentation on the settings, known limitations and implementation
info can be found here:
http://www.blender.org/development/current-projects/changes-since-243/subsurface-scattering/
2007-05-03 21:37:52 +00:00
a8756ba013 missed out with 2 active layers that should be active_rnd 2007-05-02 01:40:27 +00:00
c24aa10561 Made it so blender has an active render layer for Uv and Vertex color mesh layers.
This means changing the active UV/VCol layers wont change what renders.
needed to adjust the minor version so old files will copy the active layer to the render-uv/vcol layer.

boxpack2d.py - redoen in C now, dont need python version.
2007-05-02 00:01:23 +00:00
243d1a28c0 Casting fixes for 64 bits. Incomplete commit, discussion on proper casting
has to be finished.
2007-04-29 10:49:02 +00:00
7f9c872169 Bugfix, plumiferos report:
Strand texture coords (static particles) did not precisely go from -1 to 1
when random lifetime was used.
2007-04-25 16:12:34 +00:00
afdd54fa37 moved source and text to american spelling
* colour -> color
* centre -> center
* normalise -> normalize
* modelling -> modeling
2007-04-04 13:18:41 +00:00
f5b919e12e Long wanted feature; decent ESC processing in composite nodes.
Works simple; just check for

		if(node->exec & NODE_BREAK)
			break;

The main process (node processor) sets such a flag, checking for esc
20 times per second. That means you can check for ESC while doing image
processing without much cpu overhead.

Currently only added in blur nodes and defocus. Needs to be added all over,
nice for others... needs careful tests too.

What we now could do is even calling ESC on editing commands or mouseclicks
in composite editor? Could give user feeling of interactive app :) Further,
finished nodes are kept in memory anyway.
2007-03-28 13:48:01 +00:00