Commit Graph

3000 Commits

Author SHA1 Message Date
f2d25975b5 Code cleanup: use 'const' for arrays (render) 2014-04-27 00:25:15 +10:00
1e6fa59e4f Fix T39852: Crash (Blender internal) large objects
Add check when bounds reached inf
2014-04-24 03:07:45 +10:00
7cdf5992dd Add asserts to raytrace get/set_cut functions 2014-04-24 02:30:39 +10:00
fc28732ba6 Blender Internal: Add material property "Cast" which can disable both ray and buffer shadows.
Also refactor:
- Material property UI related to shadows
- Preparation of OR-ed mode flags (ma->mode_l) of render materials

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D313
2014-04-23 15:03:34 +09:00
9b0ab89067 Follow up to previous commit: tweak RE_RAYTRACE_EPSILON (correction value used
when checking neighbor faces against shadowing).
2014-04-21 20:27:19 +02:00
3de8f255d7 Fix T39735: New auto smooth creates artifacts with flat shaded faces(BI)
This actually had nothing specific to new split normals, it was an internal limitation
of BI raytracer, which would check against neighbor face shadowing only when they shared
a common vertex, now it also performs checks when both faces have a vertex with a common
"ancestor" (org index).

Note this allows to also fix same issue when using SplitEdges modifier (and potentially
others?), but only when AutoSmooth is enabled (due to some compute/mem overhead, we
do not want to enable this code systematically).

Thanks to Brecht for advices and review!
2014-04-21 20:27:19 +02:00
55d75f5020 Code cleanup: correct abs use
also minor cleanup to rotation code
2014-04-21 02:02:21 +10:00
f7de9efb74 BI: cleanup in autosmooth area. 2014-04-17 18:23:14 +02:00
f270b34e99 Fix T37675: blender internal viewport render wrong for volumes after rotation.
We really should not have Object.imat_ren, that's the wrong place to put render
data. But just update it now on rotation rather than doing a bigger refactor to
remove it.
2014-04-15 15:56:56 +02:00
776f8d5a6f Split Normals I (4/5): Add support of split normals to BI renderer.
Note that this commit completely replaces old behavior of the auto_smooth feature in BI.

Also note that split normals are only handled when no "advanced geometry post-processing" is used
(something like Displace will obviously break it, since it has to re-compute normals after displacement...).

Reviewers: brecht

Reviewed By: brecht

CC: campbellbarton

Differential Revision: https://developer.blender.org/D368
2014-04-13 12:37:47 +02:00
15169c71a6 Blender Internal: remove BLI BVH for raytracing.
It has no benefits over other BVH types, as far as I know it was only added
because it was possible. This also fixes T39344.
2014-04-11 13:20:41 +02:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
6cd717e0a3 Fix T39521: Render with two Blender processes on same computer: compression issues?
We need to salt temp exr filenames with pid, else several instances of Blender rendering
the same scene on same machine and using "Save Buffers" option would use the same files!
2014-04-02 11:59:43 +02:00
35747ee3d5 Rename "BLI_cpu.h" to "BLI_system.h" and add to it BLI_getpid() helper.
There is not much sense to have a whole BLI file just to check SSE2 on CPUs...
So idea is to rename it to more generic "BLI_system", and add to it more system-related
utils, like e.g. an include helper for getpid(), which allows to hide unix/windows
internals from rest of the code...

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D439
2014-04-02 11:59:43 +02:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
482201d1a0 Style cleanup 2014-03-31 05:46:19 +11:00
faf529d036 BLI_rand: Add BLI_rng_get_float_unit_v3, was static rayshade func 2014-03-30 15:04:20 +11:00
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
a7242c3162 Code cleanup: add _v2 suffix to resolve_tri/quad functions 2014-03-26 11:15:21 +11:00
27e86ed832 Code cleanup: use bools 2014-03-20 22:56:28 +11:00
9767ff8916 Code cleanup: use true/false in sequencer functions 2014-03-20 15:46:38 +06:00
efb48fcbbb Fix for crash happening on blender exit after the bake
The issue is caused by 1a79abdad, and annoyingly it's a regression
since 2.69, so if we do 'a', this commit should be ported there.
2014-03-20 13:16:33 +06:00
7997e38917 Fix T39233: Face assigned textures bake too bright
Shade input wasn't initialized properly for texture baking.
2014-03-19 20:22:28 +06:00
a6e347177b Fix T39136: DupliFaces: Inconsistent handling of group member types
The issue was caused by assumption object matricies can be modified
by DupliObject->obmat outside of the duplilist iteration cycle.

This isn't really true. The thing is, old code used to modify object
matrix based on the duplicated matrix to make it so modifier evaluation
kind of works (it'll use proper matrix in most cases, but think there
might be some cases when this assumption also breaks).

Even when matrix is copied from dupliobject to object in advance
(to mimic old behavior or dupli system) you're still to use matrix
from dupliobject inside a cycle body. This is because the same object
might be modified multiple times by different dupliobject. For example,
in case of duplifaces loads of faces will modify object's matrix and
before this change matrix from the last face would have been used.

The fix is simple one-liner which makes it so render instance will
use proper matrix from dupliobject.

All the rest bits here (pre-loading matrices and restoring them in
the reverse order) totally matches old behavior of duplilist.

This is a regression and to be ported to 2.70 tag!
2014-03-18 18:15:02 +06:00
ec55074f89 Code cleanup: jitter, use 2d float array 2014-03-18 10:52:38 +11:00
8480bb64ec Code cleanup: style 2014-03-17 21:48:13 +11:00
fbf859518a Followup for fix T38318: Add back previous fix and fix a glitch.
The previous fix 162d6c73e3 has been cancelled because it caused a
problem that mesh deform cages and so on mess up the preview. To avoid
the problem, viewport doesn't show mesh object if its draw type is
bounding box or wireframe.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D375
2014-03-13 03:46:44 +09:00
89c793f70f Fix T39029: Blender Internal: Render tiles do not appear until render is finished if Save Buffers enabled 2014-03-11 19:56:03 +06:00
08444518e6 Removing ParticleSystem->frand arrays to avoid memory corruption issues
in threaded depgraph updates and effector list construction.

Gathering effectors during depgraph updates will call the
psys_check_enabled function. This in turn contained a DNA alloc call
for the psys->frand RNG arrays, which is really bad because data must be
immutable during these effector constructions.

To avoid such allocs the frand array is now global for all particle
systems. To avoid correlation of pseudo-random numbers the psys->seed
value is complemented with random offset and multiplier for the actual
float array. This is not ideal, but work sufficiently well (given that
random numbers were already really limited and show repetition quite
easily for particle counts > PSYS_FRAND_COUNT).
2014-03-07 11:20:45 +01:00
f5d2b46b37 Code cleanup: remove long unused gamma correction tables 2014-03-05 22:41:44 +11:00
a31571481b Fix for regression noted in T38942: Blender Internal rendering can lead
to wrong obmats of nested dupli objects.

Restoring obmats after BI nested dupli object rendering has to happen
in reverse order, so higher level omats are applied last.
2014-03-04 11:22:56 +01:00
6b693ab7bf NDOF: add navigation modes to user preferences
also comment debug prints for raytracing
2014-03-01 21:47:46 +11:00
13ea967cce Code cleanup: correct abs use and quiet warnings 2014-03-01 14:26:18 +11:00
d81f492d08 Blender Internal: Bring back previous behavior that rendered viewport uses render visibility rather than viewport visibility.
Commit 162d6c73e3 changed the behavior of rendered viewport to use
viewport visibility, but that can cause some problems. For example,
mesh deform cage is drawn as a solid/textured mesh (not a wireframe
mesh) and its unnecessary surfaces and shadows mess up the preview.
2014-02-28 05:47:55 +09:00
ffa94cb713 Fix for bug reported by Pablo Vasquez (venomgfx) on IRC: Single layer
renders were broken.

This was caused by rB1a79abdad2443ff9f12e7efd95ee78a264a9d60a which
makes a copy of the render layer list for thread safety. The single
layer passed to this function is still in the original list though, so
to get the correct index it has to be looked up there. Otherwise no
active index is set and all layers are rendered every time.
2014-02-26 18:47:25 +01:00
a856b123ff Fix T38726: missing rendered viewport update when removing render layer. 2014-02-26 17:29:50 +01:00
1dbd3ae629 Fix T38831: blender internal enabling shadow pass changes material node diffuse.
It would include/exclude shadow depending on the pass being disabled/enabled,
but that should have no influence on the combined render result. Now it always
includes shadow.
2014-02-26 16:55:50 +01:00
4cfca0adfe Nicer solution to T38846: Split off the render layer forcing from the
validity check for render operator.

This way scene DNA can stay read-only there, cleaner and we don't have
to pass an awkward bool pointer around.
2014-02-26 14:56:27 +01:00
ecbae4ab46 Fix T38846: Render layer checkbox is not refreshed.
The render operator invoke checks render layers, which can force the
render layer to be activated. This requires a notifier, which has to be
done in the operator itself (can't do this inside pipeline code).
2014-02-26 14:39:14 +01:00
188f8d0935 Fix T38801: Dupli objects with modifiers exhibit bad transform artifacts
in Blender Internal renderer.

The BI renderer applies modifiers //after// changing the obmat of the
respective object (for the first instance it encounters). Before
rB6940bf0 the original obmat (omat) was stored inside dupli object data,
which was removed in favor of local omat variables due to hackishness
and redundancy. Problem with BI is that all the obmats have to be
overridden in relation to each other to produce the correct modifier
results (here: offset object for the array modifier).

The patch restores the old (messy) behavior for BI by first overriding
**all** the obmats at once from duplis, then creating render instances,
then cleaning up.

A better solution would be to avoid these modifier hacks in BI
altogether and properly evaluate them in the original object space, but
that requires far greater changes to the old code base, and is out of
scope for bugfixing.
2014-02-24 19:00:44 +01:00
b7fa08f88a Code cleanup: style 2014-02-22 11:14:15 +11:00
1a79abdad2 Fix more of T38726: there still was a crash when deleting render layers. 2014-02-21 16:38:19 +01:00
277126881d Fix T38726: blender internal viewport render crash when deleting render layer. 2014-02-21 15:10:47 +01:00
8afd646b18 Blender Internal: Revert a part of rB162d6c73e3d0, that broke rendered preview and often causes crash when using material light group. 2014-02-17 16:57:11 +09:00
5621e63d36 Code cleanup: duplicate headers 2014-02-14 10:55:38 +11:00
d95b378c4d Blender Internal: Fix regression that sometimes shadows are not rendered, caused by rBec4ed2e3df507245aceb7341b4fdf2f5ed935067.
Easy mistake in code cleanup. :)
2014-02-14 08:02:16 +09:00
38e58612ef Revert own previous commit rBe2f9afbaabbd.
The "Cast Shadows" worked as expected, but it can cause problem in some cases.
For example, when using strand render, we need disabling only buffer shadows,
but the previous changes made that impossible. "Cast Shadows" should be added
as a newly created option.
2014-02-12 05:46:26 +09:00
5af3b02f72 Fix T38578: blender internal texture nodes + volume render error. 2014-02-11 16:10:29 +01:00
e2f9afbaab Blender Internal: Modify material property "Cast Buffer Shadows" to affect ray shadows also, and rename it to "Cast Shadows".
This allows us to make materials that don't cast ray shadows.
Turning off this property can reduce the rendering time slightly.

Note: RNA path is changed to "use_cast_shadows" as well. The older
path "use_cast_buffer_shadows" still can be used as its alias, but
it will be removed after updating some addons.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D272
2014-02-11 17:06:21 +09:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00