Age | Commit message (Collapse) | Author |
|
Also it has a better error handling for the BVHTree creation
Fix for 2.71
|
|
|
|
There is a new option to select whether you want to use cage or not.
When not using cage the results will be more similar with Blender
Internal, where the inwards rays (trying to hit the highpoly objects)
don't always come from smooth normals. So if the active object has sharp
edges and an EdgeSplit modifier you get bad corners.
This is useful, however, to bake to planes without the need of adding
extra loops around the edges.
When cage is "on" the user can decide on setting a cage extrusion or to
pick a Custom Cage object. The cage extrusion option works in a
duplicated copy of the active object with EdgeSplit modifiers removed to
inforce smooth normals. The custom cage option takes an object with the
same number of faces as the active object (and the same face ordering).
The custom cage now controls the direction and the origin of the
rays casted to the highpoly objects. The direction is a ray from the
point in the cage mesh to the equivalent point to the base mesh. That
means the face normals are entirely ignored when using a cage object.
For developers:
When using an object cage the ray is calculated from the cage mesh to
the base mesh. It uses the barycentric coordinate from the base mesh UV,
so we expect both meshes to have the same primitive ids (which won't be
the case if the cage gets edited in a destructive way).
That fixes T40023 (giving the expected result when 'use_cage' is false).
Thanks for Andy Davies (metalliandy) for the consulting with normal
baking workflow and extensive testing. His 'stress-test' file will be
added later to our svn tests folder. (The file itself is not public yet
since he still has to add testing notes to it).
Many thanks for the reviewers.
More on cages:
http://wiki.polycount.com/NormalMap/#Working_with_Cages
Reviewers: campbellbarton, sergey
CC: adriano, metalliandy, brecht, malkavian
Differential Revision: https://developer.blender.org/D547
|
|
Shadow" is enabled.
This is followup to rB8008d9bdfd57. Blender Render and GLSL preview
now produce the same results.
|
|
The helper function `make_freestyle_edge_mark_hash()` was referring to the
original mesh to determine Freestyle edge marks for individual derived mesh edges.
This is no longer necessary now that derived meshes deliver CD_FREESTYLE_EDGE
and CD_FREESTYLE_FACE layers of their own. The reference of the original mesh
was also inappropriate since the edges coming from one of the operands of a boolean
modifier don't have proper CD_ORIGINDEX values but ORIGINDEX_NONE's.
Many thanks to Sergey Sharybin for patch contributions and discussions.
|
|
As suggested and reviewed by Campbell Barton. This is the most trivial of the cases. I will look if I can do it elsewhere in the bake code
|
|
When "Selected to Active" is not on, we bake all the selected objects.
This is the same behaviour we have for Blender Internal.
Dev note: I moved most of the validation tests to outside the bake()
routine so the function can be called in loop.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D560
|
|
This should be the final fix for the applyrotation issue. It baffles me
that the fix involves discarding the scale transformations for the
normals but it works so I'm happy with it.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D554
|
|
Simply linking scene (lib.blend) without compo into another one (compo.blend),
using it in a compositor and rendering it would crash.
|
|
|
|
Copy render percentage. dimensions and border settings and use them for all the
frames in the animation render.
|
|
Check for freeing old images was running per-object, move this to viewport drawing.
|
|
This fixes most of the cases, the only situation not addressed is when
the highpoly object(s) has non-uniform scale.
mul_transposed_mat3_m4_v3() should take care of non-uniform scales so
I'm a bit confused on why it doesn't work. The lowpoly object can have
any transformation, the only issue is if the highpoly object has
non-uniform scale.
Test file of the remaining issue:
https://developer.blender.org/file/info/PHID-FILE-tpw2xgddyzxtpg3e7xzs/
Reference reading:
http://www.unknownroad.com/rtfm/graphics/rt_normals.html
|
|
|
|
The reported Freestyle warnings were due to wrong normals of filled faces at both ends
of a 2D extruded curve. The problem is detailed in the comment #19 of T39669.
The cause of the bug was an inconsistency in the use of vertex indices between
BKE_mesh_nurbs_displist_to_mdata() and init_render_curve() in the case of
DispList::type equal to DL_INDEX3.
This commit also fixes a related bug that the normals of filled faces were not inverted
when a scale of the curve object is set to a negative value (e.g., the Z scale was -1).
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D532
|
|
For now only disables scene render if all the layers are disabled, but scene
will still be rendered if it's used in compo, has enabled layers which are
not used by compo.
Current pipeline doesn't allow to handle such cases nicely, so leaving it
for later.
|
|
|
|
with correct transform for Blender Internal.
According to previous code the obmat must be modified even if the
duplicated object itself is filtered later. TBH i have no idea how/why
this works, but nobody else does either ... All obmats are restored
after BI messes with them during render, so should be fine ...
|
|
bump/displacement (fix T40101)
|
|
|
|
Code with contribution from Brecht Van Lommel (he wrote the
bake_differentials actually ;)
Reviewers: brecht
Differential Revision: https://developer.blender.org/D510
|
|
The previous fix was not quite correct:
* It would use the same wireframe/bbox check in viewport- and regular render
* The duplicator loop in Blender Internal is more permissive now to avoid disabling wireframe duplicators, but this means we need to check is_object_hidden right before making render objects to ensure this still works.
|
|
from particle edit mode.
Check for object particle edit mode, not psys->edit. This won't get
freed on exit (which might be worth considering doing, maybe?)
|
|
|
|
The rendered preview didn't show active layer or wasn't updated if the
layer was disabled. Now the viewport always shows an active layer regardless
of whether it's enabled or disabled.
|
|
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.
The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.
The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit
Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake
bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.
Supported Features:
------------------
* Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.
* Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.
* Cage Extrusion - distance to use for the inward ray cast when using selected to active
* Custom Cage - object to use as cage (instead of the lowpoly object).
* Normal swizzle - change the axis that gets mapped to RGB
* Normal space - save as tangent or object normal spaces
Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"
Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)
* For a complete implementation example look at the Cycles Bake commit (next).
Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge
Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.
The entire commit history can be found on the branch: bake-cycles
|
|
another scene
The issue was caused by the wrong scene used to acquire render result for.
Now made it so render pipeline reports currently rendering scene to the job
via special callback.
This also solves missing tile highlight issue when rendering multiple scenes
in the compositor.
|
|
|
|
does not work as expected for Viewport and Blender Internal.
As @sergey noticed, this was caused by rBfbf8595, which disabled
rendering for wireframe objects in the viewport. However, the same
function `is_object_hidden` is also used for skipping dupli objects then
which may themselves be renderable.
Now use two variants:
* is_object_restricted is the previous test for general viewport/render visibility (lets wireframe duplicators pass)
* is_object_hidden includes the wireframe check for actual render instances
|
|
Opted to keep includes if they are used indirectly (even if removing is possible).
|
|
|
|
The formula was not consistent across Blender and behaved strangely, now it is
a simple linear blend between color1 and min(color1, color2).
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D489
|
|
|
|
textured viewport shading
Usual dupli object issue, sometimes it's needed that all the object in
dupli group have modified obmat.
Made it an utility function now, which is used by convertblender and
dupli draw code now.
|
|
layer is selected and disabled.
Freestyle relies on render layer name (RenderLayer::name) to find the render layer that
corresponds to a scene render layer being rendered.
When the active render layer is disabled during preview rendering, the function
render_result_new() populates the list of render layers (RenderResult::layers) with an
unnamed render layer while setting the active scene render layer index to zero.
This commit fixes the missing initialization of the render layer name by referring to that of
the first in the list of scene render layers.
|
|
|
|
|
|
Add check when bounds reached inf
|
|
|
|
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
|
|
when checking neighbor faces against shadowing).
|
|
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!
|
|
also minor cleanup to rotation code
|
|
|
|
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.
|
|
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
|
|
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.
|
|
|
|
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!
|
|
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
|