Age | Commit message (Collapse) | Author |
|
https://svn.blender.org/svnroot/bf-blender/trunk/blender
|
|
* Rendering twice or more could crash layer/pass buttons.
* Compositing would crash while drawing the image.
* Rendering animations could also crash drawing the image.
* Compositing could crash
* Starting to rendering while preview render / compo was
still running could crash.
* Exiting while rendering an animation would not abort the
renderer properly, making Blender seemingly freeze.
* Fixes theoretically possible issue with setting malloc
lock with nested threads.
* Drawing previews inside nodes could crash when those nodes
were being rendered at the same time.
There's more crashes, manipulating the scene data or undo can
still crash, this commit only focuses on making sure the image
buffer and render result access is thread safe.
Implementation:
* Rather than assuming the render result does not get freed
during render, which seems to be quite difficult to do given
that e.g. the compositor is allowed to change the size of
the buffer or output different passes, the render result is
now protected with a read/write mutex.
* The read/write mutex allows multiple readers (and pixel
writers) at the same time, but only allows one writer to
manipulate the data structure.
* Added BKE_image_acquire_ibuf/BKE_image_release_ibuf to access
images being rendered, cases where this is not needed (most
code) can still use BKE_image_get_ibuf.
* The job manager now allows only one rendering job at the same
time, rather than the G.rendering check which was not reliable.
|
|
ObjectRenderInstance and VlakRen pointers)
- it difers from RayFace that localy stored the vertex coordinates.
- basicaly this reduces memory usage
|
|
https://svn.blender.org/svnroot/bf-blender/trunk/blender
svn merge -r 22800:23207 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Merged volumetric with new raytrace code (it compiles and rendered volume-cube.blend withouth problems)
Part1:
source/blender
|
|
|
|
Integration is still very rough around the edges and WIP, but it works, and can render smoke (using new Smoke format in Voxel Data texture) --> http://vimeo.com/6030983
More to come, but this makes things much easier to work on for me :)
|
|
|
|
* Added support for additional file types in the voxel data texture. I added
support for 8 bit raw files, but most notably for image sequences.
Image sequences generate the voxel grid by stacking layers of image slices on top
of each other to generate the voxels in the Z axis - the number of slices in the
sequence is the resolution of the voxel grid's Z axis.
i.e. http://mke3.net/blender/devel/rendering/volumetrics/skull_layers.jpg
The image sequence option is particularly useful for loading medical data into
Blender. 3d medical data such as MRIs or CT scans are often stored as DICOM
format image sequences. It's not in Blender's scope to support the DICOM format,
but there are plenty of utilities such as ImageMagick, Photoshop or OsiriX that
can easily convert DICOM files to formats that Blender supports, such as PNG or JPEG.
Here are some example renderings using these file formats to load medical data:
http://vimeo.com/5242961
http://vimeo.com/5242989
http://vimeo.com/5243228
Currently the 8 bit raw and image sequence formats only support the 'still'
rendering feature.
* Changed the default texture placement to be centred around 0.5,0.5,0.5, rather
than within the 0.0,1.0 cube. This is more consistent with image textures, and it
also means you can easily add a voxel data texture to a default cube without
having to mess around with mapping.
* Added some more extrapolation modes such as Repeat and Extend rather than just clipping
http://mke3.net/blender/devel/rendering/volumetrics/bradybunch.jpg
* Changed the voxel data storage to use MEM_Mapalloc (memory mapped disk cache)
rather than storing in ram, to help cut down memory usage.
* Refactored and cleaned up the code a lot. Now the access and interpolation code
is separated into a separate voxel library inside blenlib. This is now properly
shared between voxel data texture and light cache (previously there was some
duplicated code).
* Made volume light cache support non-cubic voxel grids. Now the resolution
specified in the material properties is used for the longest edge of the volume
object's bounding box, and the shorter edges are proportional (similar to how
resolution is calculated for fluid sim domains).
This is *much* more memory efficient for squashed volume regions like clouds
layer bounding boxes, allowing you to raise the resolution considerably while
still keeping memory usage acceptable.
|
|
*Octree works nicely on hierarchic trees
*the old code was quite destructive at the Isect variable
changing isec->start, end, vec..now it only changes isec->labda (and hit results)
Currently rendering a BVH of all objects, where each object has it own octree.
|
|
*Adapted octree to a more generic raytrace API
*ray shadow works (other untested stuff disabled atm)
On the scene tested the user-cpu time got from 1:24 to 1:19/20
probably because of removed callbacks or sligtly diferente memory usage
|
|
Safe method to move render results to the displayed image.
It now allocates a single image for display, and on each
refresh callback from render, it copies the refreshed
section over to this image, in 32 bits. While rendering
that image then only shows progress updates, as usual.
This also now works for scenes in composte and results
for composite.
This should solve reported crashes for MBlur or SSS.
|
|
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
of components to get it work:
- customdata, free callback for it
- timer step, notifier code
- start callback, update callback
- Once started, each job runs an own timer, and will for
every time step check necessary updates, or close the
job when ready.
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
it will prevent multiple jobs to enter the stack.
Instead it will re-use a running job, signal it to stop
and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
under construction.
Fun: BLI_addtail(&wm->jobs, steve); :)
Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see
previews update even while dragging sliders!
- Currently it only starts when you change a node setting.
Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.
Also:
- bug in region initialize (do_versions) showed channel list in
node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
way! This is for later to work on anyway.
- recoded Render API callbacks so it gets handlers passed on,
no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
of stuff from code soon.
|
|
soc-2008-nicholasbishop branch.
Note: any old code with multires_test() or multires_level1_test() can
just be deleted, not needed by the multires modifier.
|
|
* Multithreaded volume light cache
While the render process itself is multithreaded, the light cache pre-process
previously wasn't (painfully noticed this the other week rendering on some
borrowed octocore nodes!). This commit adds threading, similar to the tiled render -
it divides the light cache's voxel grid into 3d parts and renders them with the
available threads.
This makes the most significant difference on shots where the light cache pre-
process is the bottleneck, so shots with either several lights, or a high res light
cache, or both. On this file (3 lights, light cache res 120), on my Core 2 Duo it now
renders in 27 seconds compared to 49 previously.
http://mke3.net/blender/devel/rendering/volumetrics/threaded_cache.jpg
|
|
This commit introduces a new texture ('Voxel Data'), used to load up saved voxel
data sets for rendering, contributed by Raúl 'farsthary' Fernández Hernández
with some additional tweaks. Thanks, Raúl!
The texture works similar to the existing point density texture, currently it
only provides intensity information, which can then be mapped (for example) to
density in a volume material. This is an early version, intended to read the
voxel format saved by Raúl's command line simulators, in future revisions
there's potential for making a more full-featured 'Blender voxel file format',
and also for supporting other formats too.
Note: Due to some subtleties in Raúl's existing released simulators, in order
to load them correctly the voxel data texture, you'll need to raise the
'resolution' value by 2. So if you baked out the simulation at resolution 50,
enter 52 for the resolution in the texture panel. This can possibly be fixed in
the simulator later on.
Right now, the way the texture is mapped is just in the space 0,0,0 <-> 1,1,1
and it can appear rotated 90 degrees incorrectly. This will be tackled, for now,
probably the easiest way to map it is with and empty, using Map Input -> Object.
Smoke test: http://www.vimeo.com/2449270
One more note, trilinear interpolation seems a bit slow at the moment, we'll
look into this.
For curiosity, while testing/debugging this, I made a script that exports a mesh
to voxel data. Here's a test of grogan (www.kajimba.com) converted to voxels,
rendered as a volume: http://www.vimeo.com/2512028
The script is available here: http://mke3.net/projects/bpython/export_object_voxeldata.py
* Another smaller thing, brought back early ray termination (was disabled
previously for debugging) and made it user configurable. It now appears as a new
value in the volume material: 'Depth Cutoff'. For some background info on what
this does, check:
http://farsthary.wordpress.com/2008/12/11/cutting-down-render-times/
* Also some disabled work-in-progess code for light cache
|
|
nothing to see here, move along!
|
|
Removed all the old particle rendering code and options I had in there
before, in order to make way for...
A new procedural texture: 'Point Density'
Point Density is a 3d texture that find the density of a group of 'points'
in space and returns that in the texture as an intensity value. Right now,
its at an early stage and it's only enabled for particles, but it would be
cool to extend it later for things like object vertices, or point cache
files from disk - i.e. to import point cloud data into Blender for
rendering volumetrically.
Currently there are just options for an Object and its particle system
number, this is the particle system that will get cached before rendering,
and then used for the texture's density estimation.
It works totally consistent with as any other procedural texture, so
previously where I've mapped a clouds texture to volume density to make
some of those test renders, now I just map a point density texture to
volume density.
Here's a version of the same particle smoke test file from before, updated
to use the point density texture instead:
http://mke3.net/blender/devel/rendering/volumetrics/smoke_test02.blend
There are a few cool things about implementing this as a texture:
- The one texture (and cache) can be instanced across many different
materials:
http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_instanced.png
This means you can calculate and bake one particle system, but render it
multiple times across the scene, with different material settings, at no
extra memory cost.
Right now, the particles are cached in world space, so you have to map it
globally, and if you want it offset, you have to do it in the material (as
in the file above). I plan to add an option to bake in local space, so you
can just map the texture to local and it just works.
- It also works for solid surfaces too, it just gets the density at that
particular point on the surface, eg:
http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_solid.mov
- You can map it to whatever you want, not only density but the various
emissions and colours as well. I'd like to investigate using the other
outputs in the texture too (like the RGB or normal outputs), perhaps with
options to colour by particle age, generating normals for making particle
'dents' in a surface, whatever!
|
|
Initial commit for supporting rendering particles directly as
volume density. It works by looking up how many particles are
within a specified radius of the currently shaded point and using
that to calculate density (which is used just as any other
measure of density would be).
http://mke3.net/blender/devel/rendering/volumetrics/smoke_test01.mov
http://mke3.net/blender/devel/rendering/volumetrics/smoke_test01.blend
Right now it's an early implementation, just to see that it can
work - it may end up changing quite a bit. Currently, it's just a
single switch on the volume material - it looks up all particles
in the scene for density at the current shaded point in world
space (so the volume region must enclose the particles in order
to render them.
This will probably change - one idea I have is to make the
particle density estimation a procedural texture with options for:
* the object and particle system to use
* the origin of the co-ordinate system, i.e. object center, world
space, etc.
This would allow you in a sense, to instance particle systems for
render - you only need to bake one particle system, but you can
render it anywhere.
Anyway, plenty of work to do here, firstly on getting a nice
density evaluation with falloff etc...
|
|
Finally, after a long time new render candy for the non-game peoples! :)
Good doc is here: (url splits in two)
http://www.harkyman.com/2008/08/06/controllable-shadow-intensity-
and-color/
Note the colorpicker for shadow is in "Shadow and Spot" panel. A bit
hidden, could get more attention. For later. :)
|
|
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
|
|
since no additional crashes were reported!
|
|
http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9
|
|
Baking would split non-planer quads in an unpredictable way, which is fine for rending but game engines often use a fixed order (0,1,2), (0,2,3) or (1,2,3) (1,3,0).
Added an option to use a fixed order when baking.
|
|
Fix for bug #11661: bake to viewport uv layer instead of render uv layer.
|
|
computers, probably due to slow multithreaded malloc. Now each render
thread keeps a list of qmc samplers that it fills as needed while
rendering (since it is hard to predict the actual amount needed in
advance due to ray recursion).
|
|
Traceable disabled.
|
|
enabled, result of that is mainly visible for image textures.
|
|
each instance should have it's own layer.
|
|
the renderer could lead to results being reused for unrelated
points, result was one wrong pixel or strand per part. Now instead
of setting the sample counter to 0 multiple times, it keeps a global
counter per thread for the whole render.
|
|
coordinates from the object as if they were in their original position,
untransformed by dupligroups or dupliverts. Otherwise the textures of
such objects would change depending on their position.
|
|
behind the zmask instead of in front. Might need tweaks, and doesn't
work with halo yet.
|
|
caused by optimization that doesn't compute vectors for objects that
don't need them.
|
|
Fixed bug #8215, Crash with shaded view + multires mesh
|
|
Now bounding boxes are computed per object, and checked first before
zbuffering objects. For strands, bounding boxes are computed per
original face in the mesh. Overall the speed improvement from this
is quite small (zbuffering is rarely the bottleneck), but it seems a
sensible thing to do anyway.
|
|
They now also store a list of samples per pixel, and then get
shaded together with the ztransp samples. This comes with a
slight speed hit, but mainly memory might be a concern. However,
testing some peach scenes I haven't problems.
|
|
This completes the pipeline make-over, as started in 2006. With this
option, during rendering, each sample for every layer and pass is being
saved on disk (looks like non-antialiased images). Then the composite
and color correction happens, then a clip to 0-1 range, and only in end
all samples get combined - using sampling filters such as gauss/mitch/catmul.
This results in artefact-free antialiased images. Even Z-combine or
ID masks now work perfect for it!
This is an unfinished commit btw; Brecht will finish this for strands.
Also Halo doesnt work yet.
To activate FSA: press "Save Buffers" and the new button next to it. :)
|
|
of strands changing between frames, vector blur couldn't work. Now
speed vectors are interpolated from the surface. This also means
child particles don't have to be computed in the previous and next
frames, so saves time too.
|
|
radface from VlakRen, saves about 100mb for 10 million faces.
|
|
Also, duplis are now taking into account, the proper way to exclude
them is to set the material to be not traceable.
Removed an unnecessary pointer from the VlakRen struct to save some
memory, not really that significant, but still, saves 70 mb for 10
million faces.
|
|
non-animated dupligroups.
|
|
=============================
A new approximate ambient occlusion method has been added, next to the
existing one based on raytracing. This method is specifically targetted
at use in animations, since it is inherently noise free, and so will
not flicker across frames.
http://www.blender.org/development/current-projects/changes-since-244/approximate-ambient-occlusion/
http://peach.blender.org/index.php/approximate-ambient-occlusion/
Further improvements are still needed, but it can be tested already. There
are still a number of known issues:
- Bias errors on backfaces.
- For performance, instanced object do not occlude currently.
- Sky textures don't work well, the derivatives for texture evaluation
are not correct.
- Multiple passes do not work entirely correct (they are not accurate
to begin with, but could be better).
|
|
It seems everytime I try to fix something here I break something
else, but anyway, another try at getting this to work properly.
Fixes for:
- Getting dupliverts/faces derivedmesh with orco caused wrong results
on meshes in linked dupligroups with proxy, because modifier stack
was revaluated with wrong object matrix, now gets orco another way.
- Fix render instances being hidden when original object was not added
to the object render list.
- Changed the way object instances find their original objects, now
works the other way around, original objects look for their instances
instead.
There's probably issues still with recursive dupligroups..
|
|
====================
- "From Dupli" option for orco and uv texture coordinates. For dupliverts,
duplifaces and dupli particles, this uses the orco and uv at the point
on the parent surface. Can for example be used for texturing feathers
and leafs. Note that uv only works for duplifaces and particles emitted
from faces, these are not defined at vertices.
- "Width Fade" option for strand render, to fade out along the width of the
strand. Committing this so it can be tested, might be changed or removed
even, if it doesn't give nice results.
|
|
============================
- Strand render now has options to remove child strands as
the object's faces becomes smaller, in the Simplification
particle panel.
- "Reference Size" is the approximate size of the object on
screen, after which simplification starts.
- "Rate" is how fast strands are removed.
- "Transition" is the percentage of strands being faded out as
they are removed.
- Another "Viewport" option removes strands on faces that are
outside of the viewport. "Rate" again controls how fast these
are removed.
- Strand render in Blender Units now has an adjustable minimum
width. Below this minimum width, strands start fading out
instead of getting smaller.
|
|
===============================
- One shadowbuffer per thread.
- Added more break tests in shadow buffer code.
- Removed R.clipcrop global, solution is not nice yet, but at
least threadsafe.
- Fixed bug in strand render shadow buffer code.
|
|
=================
Big commit, but little user visible changes.
- Dupliverts and duplifaces are now rendered as instances, instead
of storing all of the geometry for each dupli, now an instance is
created with a matrix transform refering to the source object.
This should allow us to render tree leaves more memory efficient.
- Radiosity and to some degree raytracing of such objects is not
really efficient still. For radiosity this is fundamentally hard
to solve, but raytracing an octree could be created for each object,
but the current octree code with it's fixed size doesn't allow this
efficiently.
- The regression tests survived, but with I expect that some bugs will
pop up .. hopefully not too many :).
Implementation Notes
====================
- Dupligroups and linked meshes are not rendered as instances yet,
since they can in fact be different due to various reasons,
instancing of these types of duplis that are the same can be added
for them at a later point.
- Each ObjectRen now stores it's own database, instead of there being
one big databases of faces, verts, .. . Which objects that are actually
rendered are defined by the list of ObjectRenInstances, which all refer
to an ObjectRen.
- Homogeneous coordinatess and clipping is now not stored in vertices
anymore, but instead computed on the fly. This couldn't work for
instances. That does mean some extra computation has to be done, but
memory lookups can be slow too, and this saves some memory. Overall
I didn't find a significant speed impact.
- OSA rendering for solid and ztransp now is different. Instead of e.g.
going 8 times over the databases times and rendering the z-buffer, it
now goes over the database once and renders each polygon 8 times. That
was necessary to keep instances efficient, and can also give some
performance improvement without instances.
- There was already instancing support in the yafray export code, now it
uses Blender's render instances for export.
- UV and color layer storage in the render was a bit messy before, now
should be easier to understand.
- convertblender.c was reorganized somewhat. Regular render, speedvector
and baking now use a single function to create the database, previously
there was code duplicated for it.
- Some of these changes were done with future multithreading of scene
and shadow buffer creation in mind, though especially for scene creation
much work remains to be done to make it threadsafe, since it also involves
a lot of code from blenkernel, and there is an ugly conflict with the way
dupli groups work here .. though in the render code itself it's almost there.
|
|
=========
- Fix crash in particle transform with the particle system not editable.
- Particle child distribution and caching is now multithreaded.
- Child particles now have a separate Render Amount next to the existing
Amount. The render amount particles are now only distributed and cached
at render time, which should make editing with child particles faster.
- Two new options for diffuse strand shading:
- Surface Diffuse: computes the strand normal taking the normal at
the surface into account.
- Blending Distance: the distance in Blender units over which to
blend in the normal at the surface.
- Special strand rendering for more memory efficient and faster hair and
grass. This is a work in progress, and has a number of known issues,
don't report bugs to me for this feature yet.
More info:
http://www.blender.org/development/current-projects/changes-since-244/particles/
|
|
=============
A new "Selected to Active" option in the Bake panel, to (typically) bake
a high poly object onto a low poly object. Code based on patch #7339 by
Frank Richter (Crystal Space developer), thanks!.
Normal Mapping
==============
Camera, World, Object and Tangent space is now supported for baking, and
for material textures. The "NMap TS" setting is replaced with a dropdown
of the four choices in the image texture buttons.
http://www.blender.org/development/current-projects/changes-since-244/render-baking/
|
|
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)
|
|
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!
|