Commit Graph

922 Commits

Author SHA1 Message Date
5ee55caba5 Fix for dupli's ignoring color in set-scenes
also skip setting wire color drawing depth
2014-06-04 14:24:05 +10:00
b3e9a71a3d Fix T40489: Curve drawing skipped loose-wire when mixed with solid faces 2014-06-04 08:39:49 +10:00
6bb459f6d7 Fix T40403: Particles disappear after rendering
Read the comment in ensure_curve_cache, it tells it all.
2014-05-28 15:28:52 +06:00
049b6cfa6d Fix for image garbage collection failing to run for render-only views
Check for freeing old images was running per-object, move this to viewport drawing.
2014-05-22 11:58:07 +10:00
90db85a263 Fix T40283: Matcaps disables GLSL shadows 2014-05-22 11:28:03 +10:00
be980b9f7d 3D Text: Change textbox placement to ignore font scale
Logic here was very stupid, texboxes would have their initial
locations scaled by font size but not their width/height.

Now its possible to change font size while keeping the textbox layout.

Other fixes

- tab character didn't work properly with textboxes.
- memory leak when VFontData was missing.
2014-05-16 10:32:29 +10:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
27591458aa Correct own regression drawing lamp outline 2014-04-30 04:52:31 +10:00
d30988bbf1 Code cleanup: avoid sin/cos calls when drawing sun lamp 2014-04-30 02:12:11 +10:00
c67bd49e56 Code cleanup: use 'const' for arrays (editors) 2014-04-27 00:25:15 +10:00
d4261d02bd Quiet warnings 2014-04-24 02:34:34 +10:00
70fdcebb93 Fix T39781: Autosmooth feature: erroneously showing hidden vertices' normals too when in "vertex per face" display
So, turned out after all we need a foreachmapped helper for loops as well... :/

CDDM and EBDM were reasonably simple, but I fought hours with CCGDM (subsurf) to find only a
bad working solution (see D478). So I fallback to a code similar to CDDM one.
Probably not nice for performances, but loops and subsurf are not matching well...

Reviewers: campbellbarton

CC: brecht

Differential Revision: https://developer.blender.org/D478
2014-04-23 15:25:12 +02: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
f55ca54be1 Object drawing: test the flag, without comparing the value 2014-04-21 19:29:48 +10:00
55d75f5020 Code cleanup: correct abs use
also minor cleanup to rotation code
2014-04-21 02:02:21 +10:00
ddc88ea419 Fix T39765 crash on text with generative modifiers. 2014-04-17 15:58:40 +03:00
1c0b6c4f30 Code cleanup: use bools for DM 2014-04-17 20:03:39 +10:00
55c9b352c2 Fix mistake in recent DM material changes 2014-04-17 18:05:57 +10:00
3e3efae7e9 Viewport Text Drawing: replace single allocs with a memarena
- pass label strlen since in many cases its already known.
- use single linked list for cached text drawing.
- add BLI_link_utils.h for single linked list macros.

own tests give approx 22% overall speedup.
2014-04-17 16:04:28 +10:00
ea610e655c Style cleanup: C & pep8 2014-04-15 13:11:48 +10:00
18e4224142 Split Normals I (1/5): basis for split normals (nearly nothing user-visible here):
* Add a new calcLoopNormals function to DerivedMesh struct, and implement it for CDDM and CCGDM (subsurf).
  EditDerivedBMesh (edit mode DM) only gets a dummy one in this commit.
* Add a tessellated version of CD_LOOPNORMAL layer (CD_TESSLOOPNORMAL), with relevant code to handle it
  (tessellation, rna access, etc.).
* Change auto_smooth options of Mesh (angle now in radian internaly, and toggle is now used to enable/disable
  split normals in DM creation process). Note BI render code is not touched here, hence its behavior regarding
  this option is now incoherent, will be addressed in a separate commit.

Reviewers: campbellbarton

CC: brecht

Differential Revision: https://developer.blender.org/D365
2014-04-13 12:19:00 +02:00
88298f1c40 Drawing: use const for wire color 2014-04-11 15:41:20 +10:00
3216e4b202 API Cleanup: Use BKE_constraint prefix for constraint api 2014-04-11 11:47:07 +10:00
c3fefebe47 More instances of needed material initialization. 2014-04-10 01:16:40 +03:00
c782505775 Back buffer selection needs updates to materials. 2014-04-09 19:51:29 +03:00
9de24c82ba View3D: disable LOD when game engine is disabled or ifdef'd 2014-04-09 11:52:34 +10:00
b5d3f183b0 Add material storage to derivedmesh.
The variables are considered invalid unless DM_update_materials is
called prior to use. Only use case currently is
mesh drawing. This helps with excessive allocation on the stack during
GPUObject creation, but may help elsewhere in the future as well.
2014-04-09 04:03:44 +03:00
cced07661a Matcaps.
Instead of setting color every time, just set it on material enable.
Handles all cases of surfaces. Thanks to Campbell for pointing out!
2014-04-08 01:25:49 +03:00
574b0e2c30 Fix T39626 Matcaps not working in edit mode.
Set a while color before the draw call. This will be ineffective in GLSL
but will affect matcaps.
2014-04-07 21:49:02 +03:00
3ed49a810d Make matcaps suck less
This commit does various changes for matcaps:

One is taking advantage of drawing with pbvh (which would only happen
with dyntopo previously) and drawing with partial redraw during
sculpting.

The second one is support for masks. To make this work in the special
case of multires, which uses flat shading, I use the only available flat
shaded builtins in OpenGL 2.0 which are color and secondary color.

Abusing colors in that way is also essential for flat shading to work if
we are to use pbvh draw in multires, since it is the color that is being
interpolated flatly, not the normal (which can only interpolated
smoothly). The pbvh drawing code for multires used last triangle
element's normal to compute the shading which would only produce smooth
results. This could change if we did the shading in the vertex shader
for flat shaded primitives, but this is more complex and makes it harder
to have one shader to rule the mole.

Also increased the brightness of the default diffuse color for
sculpting. This should be useful since artists like to tweak the
lighting settings and it will give them the full dynamic range of the
lights, but also it helps with correct brightness of sculpted matcaps.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D435
2014-04-01 19:27:13 +03:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
1781928f9d Fix T39305: Matcap Crash when using Material Nodes in Blender Internal
This is a regression in d34d745, texture painting didn't set is_paint
if draw type < DT_SOLID which is weird.
2014-03-21 15:17:43 +06:00
aee30184f3 View3D: avoid matrix multiply using ED_view3d_boundbox_clip 2014-03-20 12:20:15 +11:00
7a3ec0d9c7 Error in last commit 2014-03-20 11:49:01 +11:00
50309fcbe8 Vertex Paint: inverted line drawing, white lines were often hard to see 2014-03-20 11:44:48 +11:00
12c56d8c1f Fix T39101: Can not select object on backface by clicking when Matcap is on 2014-03-11 12:56:08 +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
13ea967cce Code cleanup: correct abs use and quiet warnings 2014-03-01 14:26:18 +11:00
3b44ca08a9 Fix 3D tracks to mesh not aligning mesh properly
Also fixed wrong frame number used for reconstructed object
visualization in 3D viewport.
2014-02-26 19:40:04 +06:00
081a3412a9 Paint API: add BKE_paint_select_elem_test: to check on paint selection 2014-02-26 16:00:54 +11:00
7cc954d7a7 Make it so missing curve cache doesn't crash in sequencer preview 2014-02-18 00:11:27 +06:00
2dd2bcf2de Fix/workarond for scenes rendered for sequencer preview
This is really a workaround which brings back direct display
list creation from drawing code. This is rather nasty to do
but proper solution would require some major sequencer redesign.
2014-02-12 14:06:13 +06: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
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
39ad2cd8f8 Fix lamps drawing only partially in OpenGL render.
It should draw lamps entirely, this happened due to hack to hide object centers.
2014-02-05 22:14:25 +01:00
6a4f2fd552 Fix T35810: Texture faces display white in 3D view, when used as a Particle Object
This in fact seems some kind of video driver limitation, because it worked fine
on windows but failed on linux here. The guess is that textures doesn't always
work on display lists, or we simply do have some wrong OGL context somewhere.

This is a workaround for until bigger viewport draw refactor is done (as Brecht
mentioned display lists are deprecated in new OGL anyway).
2014-02-05 23:46:01 +06:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
d34d7451a9 Viewport Drawing: apply matcaps to all objects 2014-01-29 03:39:19 +11:00
90ff9d7dca Code cleanup: remove check for painting non-mesh objects (its impossible) 2014-01-29 03:38:07 +11:00