Commit Graph

101 Commits

Author SHA1 Message Date
fc7c856da2 Fix T44048: freestyle lines in Cycles are in the wrong color space. 2015-10-10 18:44:19 +02:00
dcacc54e07 Freestyle: Fix for stroke rendering performed with multi-views enabled.
Per-view Freestyle stroke rendering needs to be done without multi-views.
2015-05-16 23:59:14 +09:00
31f0c27ae7 Depsgraph: Add additional relations/id update tags
This calls are not strictly speaking needed for the old dependency graph, but
due to more granular nature of upcoming depsgraph more actions requires update
of relations of IDs.

On the one hand this extra tags could be wrapped with if() statements, but on
the other hand it makes sense to keep tag in sync so it's clear if some issue
is caused by missing/extra tag or by depsgraph itself.
2015-05-12 16:06:36 +05:00
c46f40e9e2 Freestyle: Compilation error fix after recent changes in BKE_object_add() 2015-05-04 13:52:44 +05:00
13358d049e Freestyle: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
a0fa3de267 Fix T43624: Freestyle uses wrong colour on second Line Set with textured lines in Cycles.
This is a regression introduced by rBd8b00a3bf5c1 (Freestyle: memory
consumption optimization in stroke rendering).

The issue was caused by uninitialized MPoly::mat_nr values.  Before the
stroke rendering optimization, individual Freestyle strokes were
represented by distinct mesh objects, and thus MPoly::mat_nr was left
unset (i.e., was always zero).  Now that the stroke rendering optimization
has been done and mesh objects may represent multiple strokes of different
materials, MPoly::mat_nr had to be properly set to the material index that
refers to the material of the poly face.
2015-03-09 12:53:11 +09:00
7bae9ee6b6 Mesh validate: add an option to not clean temp/cache CDLayers.
This is mandatory for incoming custom normal imports from io scripts, because
often geometry here is corrupted, so we need to call mesh.validate() to clean it up.

Issue is, we cannot set custom normals before geometry is clean, so we need to store
temporary plain loop normals in a CD_NORMAL layer, validate, and then set custom normals.
So we need a way to prevent 'temp' lnors to be freed by validate.
2015-02-05 14:03:01 +01:00
c9e5d9226b Fix T43090: Cycles + Freestyle + border render = black render.
The reported problem was due to a special case where there are no strokes
to be rendered.  Since rendering an empty scene is a waste of time, the issue
was addressed here by skipping the stroke rendering process entirely.
2015-01-18 00:39:03 +09:00
d8b00a3bf5 Freestyle: memory consumption optimization in stroke rendering.
Previously individual strokes were represented by distinct mesh objects
no matter how many vertices and materials each stroke has, although
the vertex and material counts can be quite small depending on the input
scene data.  Now stroke meshes are packed into a minimum number of
mesh objects, so as to reduce the overheads of Blender object creation.
2015-01-03 21:54:56 +09:00
25b7455eea Cleanup: de-duplicate engine-id's 2014-10-28 12:49:04 +01:00
507af00855 Freestyle: Fix for missing quality control on line rendering in Cycles.
Freestyle was using the default Cycles rendering settings (e.g., the number
of samples) and users could not change them.  Now all render parameters
(except for film_transparent) are inherited for Freestyle stroke rendering.

Problem report by Danny Grimm on Facebook, thanks!
2014-09-11 13:41:14 +09:00
b65a022892 Freestyle: Removed the stored bContext from the Controller class.
The stored context object was used for creation of shade nodes.  A closer look at the
node system showed that the context is not actually used when shader nodes are
added to a shader node tree.  Relying on this fact, now a NULL pointer is passed to
nodeAddStaticNode() instead of the stored bContext pointer.
2014-08-12 10:10:55 +09:00
75e03e93be Freestyle: removed dead code in BlenderStrokeRenderer. 2014-08-12 10:10:51 +09:00
b606520791 Freestyle: Removed debugging code (use G.main instead of Freestyle-local struct Main). 2014-08-12 10:10:49 +09:00
f7d3f2b228 Fix for vertex colors not working properly.
Looks like the issue was caused by a UV map name starting with a lower case
letter (e.g., "color").  Capitalizing the name fixed the problem.  Also adjusted
the creation of custom data layers to optimize things a bit.
2014-08-12 10:10:48 +09:00
829e25c922 Fix for wrong link in the line style shader nodes due to a typo. 2014-08-12 10:10:47 +09:00
7852fc8bcd Freestyle: Proper support for alpha transparency in line style shader nodes for Cycles. 2014-08-12 10:10:45 +09:00
cc33d73185 Freestyle: Fix for an increasing reference count of images in copied Image Texture shader nodes. 2014-08-12 10:10:43 +09:00
45af769020 Freestyle: Properly reconnect links from a UV Along Stroke node to a UV Map node. 2014-08-12 10:10:42 +09:00
6f60ca3cd4 Freestyle: Caching of auto-generated materials from line style shader nodes. 2014-08-12 10:10:38 +09:00
7b1234be1c Removed/disabled debugging code. 2014-08-12 10:10:37 +09:00
34c133a488 Freestyle: an improved workflow of line style shading nodes.
Removed the previous changes for passing a line style through the Controller, and
revised the BlenderTextureShader to assign the shader node tree of a line style
(if specified) to strokes.  This way the assignment of shading nodes can be done
through both the Freestyle GUI and Python scripting.
2014-08-12 10:10:36 +09:00
c38e80d632 WIP commit just for a record of a working snapshot of code revisions for node-based textured strokes. 2014-08-12 10:10:35 +09:00
a2a2d4679a Made temporary changes to use G.main rather than Freestyle-local Main for debugging. 2014-08-12 10:10:34 +09:00
701f0356df Freestyle: Removed a debug print in BlenderStrokeRenderer::GetStrokeShader(). 2014-08-12 10:10:28 +09:00
722951eceb Freestyle: Added "blend_type" and "use_clamp" options to the Output Line Style shader node. 2014-08-12 10:10:27 +09:00
7e9ac19b2c Freestyle: Fix for stroke_shader node default values copied from the Output Line Style node. 2014-08-12 10:10:24 +09:00
fc85446c50 Freestyle: Added preliminary support for textured strokes in Cycles.
Now the shader node tree of a line style ID datablock is used to define textures
as well as their mapping and influence.

TODO: Textures alpha channel mapping and influence.
TODO: Blend mode in the Output Line Style shader node.
2014-08-12 10:10:20 +09:00
91c31efe01 Enabled USE_CYCLES_FOR_STROKE_RENDERING compile-time flag by default. 2014-08-12 10:10:15 +09:00
1e513658de Always use the Blender Internal renderer for stroke rendering. 2014-08-12 10:10:12 +09:00
d459d102b5 Added new operator "Create Freestyle Stroke Material" for testing. 2014-08-12 10:10:11 +09:00
ea1f54d8f3 Fix for hard-coded #include file paths. 2014-08-12 10:10:10 +09:00
b272b729ce Removed ad-hoc use of R_PERSISTENT_DATA for Freestyle/Cycles. 2014-08-12 10:10:08 +09:00
f75d87bd76 Initial implementation of Cycles materials for Freestyle stroke rendering. 2014-08-12 10:10:06 +09:00
f70e1ad2fb Proof-of-concept implementation of Freestyle support for Cycles. 2014-08-12 10:10:05 +09:00
944e576717 Fix for a wrong threads count shown in Freestyle debug mode (--debug-freestyle). 2014-07-04 15:18:44 +09:00
6c6fa749f6 Second attempt to fix T40833: Crash when rendering with freestyle.
The cause of the crash was identified in an uninitialized member variable
`Main->lock`.  Now that struct Main has a few member variables whose
values are dynamically allocated, per-render Freestyle-specific Main data
structures will be allocated and released using `BKE_main_new()` and
`BKE_main_free()`, respectively.

This revision complements the commit rB6135556f4556.
2014-07-01 23:36:53 +09:00
ae00a2b3fd Freestyle: Removed redundant flipping of UV coordinates.
Patch contribution by Paolo Acampora.  Thank you!
2014-05-13 09:16:28 +09:00
40520d549d Freestyle: Stroke rendering optimization.
Previously mesh objects were created for individual visible stroke segments (recalling that
a stroke may consist of alternate visible and invisible segments).  This could result in an
excessive memory consumption in stroke rendering when strokes are composed of many
short visible segments (for instance by means of dashed lines and/or blueprint geometry
modifiers).

Now mesh objects represent individual strokes instead of stroke segments, which tends to
reduce the number of generated mesh objects by an order of magnitude.
2014-05-09 12:19:29 +09:00
b24708775f De-duplicated #includes. 2014-05-09 12:19:28 +09:00
1064b74196 Fix for an occasional crash in Freestyle stroke rendering.
Materials were freed before releasing meshes that may have references to the materials.
2014-05-09 12:19:25 +09:00
75d49b7f55 Removed a Freestyle hack for DAG updates introduced in commit rBae58968e0a61.
Now that Freestyle employs a separate Main, this workaround is no longer necessary.

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D513
2014-05-08 18:42:47 +09:00
1d03a8b309 Freestyle: minor code clean-up. 2014-05-07 23:16:24 +09:00
fe0236be78 Freestyle: time/space optimization in stroke rendering without textures.
When strokes do not have textures assigned, UV coordinates are not computed now.
This will save a bit of time and space in stroke rendering.
2014-05-07 23:16:23 +09:00
a351ff7264 Freestyle: removed the dummy implementation of a texture manager.
Legacy texture shaders from the original stand-alone Freestyle program are also
declared as deprecated, in favor of Blender's new line style textures.

Patch contribution by Paolo Acampora.  Thanks!
2014-05-07 10:57:32 +09:00
b7f085d9c1 Patch D246: Texture Marks for freestyle strokes, written and contributed by Paolo Acampora.
Reviewers: brecht, kjym3, #freestyle

Reviewed By: brecht, kjym3

Differential Revision: https://developer.blender.org/D246
2014-05-03 18:54:59 +09:00
59b94f2193 Freestyle: quiet BMESH validator warnings of zero normals. 2014-04-24 13:57:10 +09:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
e79b244097 Fix collada and freestyle module compile errors after recent commit, forgot to
compile with those enabled.
2014-01-15 19:15:51 +01:00
ebbb6adf32 Fix for infinite freestyle re-render in the viewport
Was a regression since e618d8238e and was caused by the wrong
main being tagged for update.
2014-01-15 17:42:01 +06:00