Commit Graph

114 Commits

Author SHA1 Message Date
Ton Roosendaal 3a43e08deb Bugfix & Feature fix: Only Shadow Material options
Patch from Miika Hämäläinen.

The old Material "Only Shadow" used an ancient 'best guess'
formula using Lamp Distance and some averaging for converting
shadow values to alpha.
A couple of bug reporters already complained about the not
very predictable renders. Miika fixed this by adding two
new options, to only give the true shadow factor exclusively,
or to give a result including light intensity values.

More info:
http://projects.blender.org/tracker/index.php?func=detail&aid=26413&group_id=9&atid=127
2011-03-08 16:08:43 +00:00
Nathan Letwory 22dbae84e5 DNA header files are now grouped under the same module. No further documentation done. 2011-02-17 20:48:12 +00:00
Janne Karhu 9c76ff3f2e "Particle" texture coordinates for halo materials:
* Particle age can now be used as the texture x-coordinate, and location in a particle trail as the y-coordinate.
* This finally enables particles in 2.5 to change their color (or any other texturable material property) by their age.
* In 2.4x this was accomplished with the "100 frames == particle age", but this was both non-intuitive and slow as the animation system had to be recalculated for every particle.
* Currently these are 2d coordinates (age/lifetime == x-coordinate, trail particle index/number of trail particles == y-coordinate), but other particle properties or possibly even a user definable property can be added as coordinates in the future.
* On the code side this uses the same coordinate definition number (for halo materials) as strand coordinates (for surface materials). This is also nice as they intuitively mean nearly the same thing, i.e. along strand or during particle life.
2010-12-07 12:58:25 +00:00
Joshua Leung a6e1998222 Animation Editors - Texture Animation:
Texture animation is now shown in the animation editors. Texture stacks are shown for each Material/Lamp/World block that uses them.

There is currently still a bit of a bug with this which means that unless the owner of the texture stack is animated too, the animation data for the textures won't show up. This will get rectified soon though.
2010-02-17 10:21:07 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Brecht Van Lommel d98603129c Added an option "Cast Approximate" to control if a material should cast
shadow when using approximate AO, separate from "Traceable".
2010-02-11 15:43:31 +00:00
Matt Ebb f02dde5de7 Patch from Raul Fernandez Hernandez - volume render multiple scattering fixes
Also: Changed 'Spread' value to be proportional to the light cache voxel grid 
(i.e. 0.5 spreads half the width of the grid), so that it's independent of light 
cache resolution. This means that results should be similar as you increase/
decrease resolution.
2010-01-03 23:45:13 +00:00
Matt Ebb af522abf33 * changes/additions to volume lighting
Volumes can now receive shadows from external objects, either raytraced shadows or shadow maps.

To use external shadows, enable 'external shadows' in volume material 'lighting' panel. This an extra toggle since it causes a performance hit, but this can probably be revisited/optimised when the new raytrace accelerator is integrated. For shadow maps at least, it's still very quick.

Renamed 'scattering mode' to 'lighting mode' (a bit simpler to understand), and the options inside. Now there's:

- Shadeless
  takes light contribution, but without shadowing or self-shading (fast)
  good for fog-like volumes, such as mist, or underwater effects
  
- Shadowed (new)
  takes light contribution with shadows, but no self-shading. (medium)
  good for mist etc. with directional light sources
  eg. http://vimeo.com/6901636
  
- Shaded
  takes light contribution with internal/external shadows, and self shading (slower)
  good for thicker/textured volumes like smoke
  
- Multiple scattering etc (still doesn't work properly, on the todo).
2009-10-05 02:59:47 +00:00
Brecht Van Lommel 022a343223 Texture stack influences are now all separate values, and negative
mapped values now have their influence negated instead. Also a few
RNA changes for TextureSlot.

Bumped subversion for the version patch.
2009-10-01 17:15:23 +00:00
Matt Ebb 71b3088596 Rework of volume shading
After code review and experimentation, this commit makes some changes to the way that volumes are shaded. Previously, there were problems with the 'scattering' component, in that it wasn't physically correct - it didn't conserve energy and was just acting as a brightness multiplier. This has been changed to be more correct, so that as the light is scattered out of the volume, there is less remaining to penetrate through.

Since this behaviour is very similar to absorption but more useful, absorption has been removed and has been replaced by a 'transmission colour' - controlling the colour of light penetrating through the volume after it has been scattered/absorbed. As well as this, there's now 'reflection', a non-physically correct RGB multiplier for out-scattered light. This is handy for tweaking the overall colour of the volume, without having to worry about wavelength dependent absorption, and its effects on transmitted light. Now at least, even though there is the ability to tweak things non-physically, volume shading is physically based by default, and has a better combination of correctness and ease of use.

There's more detailed information and example images here:
http://wiki.blender.org/index.php/User:Broken/VolumeRendering

Also did some tweaks/optimisation:
* Removed shading step size (was a bit annoying, if it comes back, it will be in a different form)
* Removed phase function options, now just one asymmetry slider controls the range between back-scattering, isotropic scattering, and forward scattering. (note, more extreme values gives artifacts with light cache, will fix...)
* Disabled the extra 'bounce lights' from the preview render for volumes, speeds updates significantly
* Enabled voxeldata texture in preview render
* Fixed volume shadows (they were too dark, fixed by avoiding using the shadfac/AddAlphaLight stuff)

More revisions to come later...
2009-09-29 22:01:32 +00:00
Robert Holcomb dac27004b8 committing patch #19252-Soft/Linear Light blend modes+Darken mode bug fix 2009-09-10 03:00:50 +00:00
Matt Ebb 46aac7b4fc * Volume rendering - z transparency
This solves one of the last remaining hurdles for 
volume rendering. Previously it always used ray 
tracing to shade other objects inside or behind the 
volume. This meant that said objects would look 
aliased, unless you used Full OSA on the volume 
(which is slow!). As well as this, it meant that you didn't 
get a good alpha channel out of the volume to use for 
compositing, similar to ray refracting materials.

This commit enables z transparency for volume 
materials. Although it can be potentially less 
physically correct, in most situations there's no 
difference, and you get the benefit of nice sampling for 
other objects and an alpha channel for compositing too.
2009-08-23 02:54:30 +00:00
Matt Ebb 132277f098 svn merge -r 22450:22627 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender 2009-08-19 11:18:52 +00:00
Matt Ebb fe984a6e6c volume material
* data reorganisation - uses own values now instead of reusing surface material properties (i.e. an individual density value, rather than reusing alpha) Files saved with the old system won't load up the same after this.

* improved defaults and ui
2009-08-16 06:10:31 +00:00
Brecht Van Lommel 3da40611d9 2.5: Material buttons
* Transparency is now it's own panel, with a boolean toggle
  + enum for z/ray transparency (following mockup made by
  William). Also had to change DNA flags for this.
* Disabled radiosity a bit more in render engine, it still had
  some effects like auto autosmooth.
* Make some sliders in material buttons percentages in RNA.
* Some other small tweaks in layout and naming.
2009-08-15 19:35:03 +00:00
Matt Ebb 5a21bc578c * First commit merging 2.4-based sim_physics in to volume25 branch.
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 :)
2009-08-13 05:21:25 +00:00
William Reynish 0ce86b0a76 Added material game physics options in RNA and layout.
Thanks to the new render API system these options don't clutter up the layout when you're not doing games.
2009-08-07 19:14:49 +00:00
Brecht Van Lommel eb80ce4d7f 2.5: Materials
* Diffuse/specular ramps works again.
* Wire is now a material type next to Surface and Halo.
* Removed Volume material type option until it is actually there.
* Some button layout tweaks.
2009-07-25 21:31:17 +00:00
Campbell Barton ffb8ac01a2 remove scriptlinks,
they were not working and we have plans for better script integration in 2.5
2009-07-22 09:41:41 +00:00
Brecht Van Lommel e56287bfc9 2.5: Texture Buttons
* World and Lamp previews now working here too.
* Experiment with list template, showing only icons. Unfortunately
  texture icon render crashes combined with preview render so it
  shows all icons the same.
* Influence panels updated, with slider for each option. The values
  are still linked though, will fix that later.
* Image texture controls a bit more complete, still WIP.
* Color ramp back.
2009-07-21 12:57:55 +00:00
Brecht Van Lommel 22f421a9ee 2.5: Texture buttons preview now has an option to display the
texture, the material, or both side by side.
2009-07-21 01:57:46 +00:00
Brecht Van Lommel 26ef6da24b 2.5
* Objects now support up to 32767 material slots. It's easy to
  increase this further, but I prefer not to increase the memory
  usage of mesh faces, it seems unlikely that someone would
  create 32767 distinct materials?
* Forward compatibility: the only thing you can potentially lose
  reading a 2.5 file in 2.4 is object linking (instead of default
  data), though usually that will go fine too. Reading files with
  > 32 material slots in 2.4 can start giving issues.

* The ob->colbits variable is deprecated by the array ob->matbits
  but I didn't remove the ob->colbits updates in very few places
  it is set.
* I hope I changed all the relevant things, various places just
  hardcoded the number 16 instead of using the MAXMAT define.

* Join Objects operator back. This is using the version from the
  animsys2 branch coded by Joshua, which means it now supports
  joining of shape keys.

* Fix for crash reading file saved during render.
2009-07-13 00:40:20 +00:00
Brecht Van Lommel a47c673b55 2.5 Material:
* Added material "type" property, with Surface/Volume/Halo
  options, compatible with sim_physics, as requested for
  material buttons layout. Obviously the Volume setting
  does nothing currently.
* Deprecated MA_HALO flag in favor of this.
2009-05-20 13:34:04 +00:00
Matt Ebb 1ed26fffb8 Volume rendering: multiple scattering
This is mostly a contribution from Raul 'farsthary' Hernandez - an approximation for 
multiple scattering within volumes. Thanks, Raul! Where single scattering considers 
the path from the light to a point in the volume, and to the eye, multiple scattering 
approximates the interactions of light as it bounces around randomly within the 
volume, before eventually reaching the eye.

It works as a diffusion process that effectively blurs the lighting information 
that's already stored within the light cache.

A cloudy sky setup, with single scattering, and multiple scattering:
http://mke3.net/blender/devel/rendering/volumetrics/vol_sky_ss_ms.jpg
http://mke3.net/blender/devel/rendering/volumetrics/sky_ms.blend

To enable it, there is a menu in the volume panel (which needs a bit of cleanup, for 
later), that lets you choose between self-shading methods:

* None: No attenuation of the light source by the volume - light passes straight 
through at full strength
* Single Scattering: (same as previously, with 'self-shading' enabled)
* Multiple Scattering: Uses multiple scattering only for shading information
* Single + Multiple: Adds the multiple scattering lighting on top of the existing 
single scattered light - this can be useful to tweak the strength of the effect, 
while still retaining details in the lighting.

An example of how the different scattering methods affect the visual result:
http://mke3.net/blender/devel/rendering/volumetrics/ss_ms_comparison.jpg
http://mke3.net/blender/devel/rendering/volumetrics/ss_ms_comparison.blend


The multiple scattering methods introduce 3 new controls when enabled:
* Blur: A factor blending between fully diffuse/blurred lighting, and sharper
* Spread: The range that the diffuse blurred lighting spreads over - similar to a 
blur width. The higher the spread, the slower the processing time.
* Intensity: A multiplier for the multiple scattering light brightness

Here's the effect of multiple scattering on a tight beam (similar to a laser). The 
effect of the 'spread' value is pretty clear here:
http://mke3.net/blender/devel/rendering/volumetrics/ms_spread_laser.jpg

Unlike the rest of the system so far, this part of the volume rendering engine isn't 
physically based, and currently it's not unusual to get non-physical results (i.e. 
much more light being scattered out then goes in via lamps or emit). To counter this, 
you can use the intensity slider to tweak the brightness - on the todo, perhaps there is a more automatic method we can work on for this later on. I'd also like to check 
on speeding this up further with threading too.
2009-01-26 02:42:17 +00:00
Joshua Leung 023765eb48 2.5 - AnimData fixes
* Made AnimData blocks be stored as pointer instead of directly in the ID-datablock, so that fewer files will need to be recompiled everytime some animation settings change.

* Tried to fix some of the compiler errors that pop up in Yafray code. If this commit doesn't fix it, just disable Yafray code for now (WITH_BF_YAFRAY=0 for scons)...
2009-01-17 05:36:58 +00:00
Joshua Leung 44e5b7788b 2.5: Blender "Animato" - New Animation System
Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future.

Highlights of the new system:
* Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action. 
- F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves. 
- The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc.
* F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated.
* Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place)
* F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place)
* NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still) 

There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details:
http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html

So, what currently works:
* I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code.
* Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock.
* Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc.

Notes:
* Drivers haven't been hooked up yet
* Only objects and data directly linked to objects can be animated.
* Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change).
* Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor)
* I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review.
In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 03:12:50 +00:00
Joshua Leung c752ec9fc4 2.5
Merged 'backend' changes from AnimSys2. Many of these changes are necessary for the Dopesheet and other changes I'm currently still stabilising. Those will come in due course.
2008-12-19 11:45:46 +00:00
Matt Ebb 92f5c719ae * Volume Rendering: Voxel data
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
2008-12-13 05:41:34 +00:00
Nathan Letwory 001f9558a3 * add diffuse shader properties for material 2008-11-28 16:00:50 +00:00
Nathan Letwory 651a94886e * add beginning of Material RNA and Nodetree+Node RNA 2008-11-27 00:23:22 +00:00
Matt Ebb bf747a30af * Added a button to the volume material controls 'Alpha' to generate an
alpha channel based on the volume's transmission properties, allowing you
to use it in comp etc.

I'd rather not have this button at all, and make it just work properly 
by default, however it causes problems with overlapping volumes when 
'premul' is on (stoopid thing..) so for the time being, there's the 
button. I'll try and fix this up later on when I have more time.
2008-11-11 23:24:10 +00:00
Matt Ebb 49aa7edb77 Another WIP commit, nothing to see yet. 2008-10-19 08:25:10 +00:00
Matt Ebb b3000c5529 non-working WIP commit to continue coding at home.
nothing to see here, move along!
2008-10-17 05:54:42 +00:00
Matt Ebb 51d51991e5 * Added support for solid objects casting shadows within a volume.
Currently it only supports solid shadows - if it's a solid object, it will cast 
100% shadow. Support for transparent shadows can potentially be added down the
track.

http://mke3.net/blender/devel/rendering/volumetrics/vol_shad_internal.jpg
2008-10-13 06:46:23 +00:00
Matt Ebb c0ddd5fd49 * New option for step size: Randomized
This is on by default, and trades random noise for banding. It jitters
the step size from 75% to 125% of its original amount, and since it
uses the threaded random seeds, shouldn't flicker during animation.

These two images took roughly the same time to render:
http://mke3.net/blender/devel/rendering/volumetrics/vol_stepsize_randomized.jpg
2008-10-13 00:35:58 +00:00
Matt Ebb a6bd4480ee * A few volume rendering tweaks:
- modified point density so that it returns a more consistent 
density with regards to search radius. Previously larger radii 
would give much higher density but this is equalised out now.

- Added a new volume material option 'density scale'. This is an 
overall scale multiplier for density, allowing you to (for 
example) crank down the density to a more desirable range if 
you're working at a large physical scale. Volume rendering is 
fundamentally scale dependant so this lets you correct to get the 
right visual result.

- Also tweaked a few constants, old files won't render exactly 
the same, just minor things though.
2008-10-12 23:39:52 +00:00
Matt Ebb 67a9d4154d * New volumetrics feature: scattering types
Otherwise known as a phase function, this determines in which directions 
the light is scattered in the volume. Until now it's been isotropic 
scattering, meaning that the light gets scattered equally in all 
directions. This adds some new types for anisotropic scattering, to 
scatter light more forwards or backwards towards the viewing direction, 
which can be more similar to how light is scattered by particles in nature.

Here's a diagram of how light is scattered isotropically and anisotropically:
http://mke3.net/blender/devel/rendering/volumetrics/phase_diagram.png

The new additions are:
- Rayleigh
describes scattering by very small particles in the atmosphere.
- Mie Hazy / Mie Murky
more generalised, describes scattering from large particle sizes.
- Henyey-Greenstein
a very flexible formula, that can be used to simulate a wide range of 
scattering. It uses an additional 'Asymmetry' slider, ranging from -1.0 
(backward scattering) to 1.0 (forward scattering) to control the 
direction of scattering.
- Schlick
an approximation of Henyey-Greenstein, working similarly but faster.

And a description of how they look visually (just an omnidirectional lamp 
inside a volume box)
http://mke3.net/blender/devel/rendering/volumetrics/phasefunctions.jpg


* Sun/sky integration

Volumes now correctly render in front of the new physical sky. Atmosphere 
still doesn't work correctly with volumes, due to something that i hope 
can be fixed in the atmosphere rendering, but the sky looks quite good.

http://mke3.net/blender/devel/rendering/volumetrics/sky_clouds.png

This also works very nicely with the anisotropic scattering, giving 
clouds their signature bright halos when the sun is behind them:

http://mke3.net/blender/devel/rendering/volumetrics/phase_cloud.mov

in comparison here's a render with isotropic scattering:

http://mke3.net/blender/devel/rendering/volumetrics/phase_cloud_isotropic.png


* Added back the max volume depth tracing limit, as a hard coded value - 
fixes crashes with weird geometry, like the overlapping faces around 
suzanne's eyes. As a general note, it's always best to use volume 
materials on airtight geometry, without intersecting or overlapping faces.
2008-10-04 12:23:57 +00:00
Matt Ebb a667fc61d4 * Removed the volume 'layer depth' control' (was used to
limit ray intersections like as for ray transparency). It 
remains to be seen if it's even that useful, and was 
preventing refracting materials behind volumes from 
working easily.
2008-09-30 10:41:47 +00:00
Matt Ebb 8056705ae9 * Volumetrics
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!
2008-09-28 08:00:22 +00:00
Matt Ebb 5adff90b08 * Some more tweaks to particle density rendering. I'm not 100%
sure if this is 'correct' but so far in testing it's been working 
pretty well.

This also exposes a new 'Nearest' value, to determine how many
nearby particles are taken into account when determining density. 
A greater number is more accurate, but slower.
2008-09-26 07:12:36 +00:00
Matt Ebb 78c50f7af1 Wheee!
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...
2008-09-26 01:54:31 +00:00
Matt Ebb 707f2e300c * Worked a bit on cleaning up the code involving layering volumes on
solids, in front of other volumes, etc. Now there's a 'layer depth' 
value that works similarly to refraction depth - a limit for how many 
times the view ray will penetrate different volumetric surfaces.

I have it close to being able to return alpha, but it's still not 100% 
correct and needs a bit more work. Going to sit on this for a while.
2008-09-25 06:08:41 +00:00
Matt Ebb 6b4ac3e7de * Volume colour absorption
Rather than a single absorption value to control how much light is absorbed as it 
travels through a volume, there's now an additional absorption colour. This is 
used to absorb different R/G/B components of light at different amounts. For 
example, if a white light shines on a volume which absorbs green and blue 
components, the volume will appear red.

To make it easier to use, the colour set in the UI is actually the inverse of the 
absorption colour, so the colour you set is the colour that the volume will 
appear as.

Here's an example of how it works:
http://mke3.net/blender/devel/rendering/volumetrics/vol_col_absorption.jpg

And this can be textured too:
http://mke3.net/blender/devel/rendering/volumetrics/vol_absorb_textured.png

Keep in mind, this doesn't use accurate spectral light wavelength mixing (just 
R/G/B channels) so in cases where the absorption colour is fully red green or 
blue, you'll get non-physical results.

Todo: refactor the volume texturing internal interface...
2008-09-23 07:05:06 +00:00
Matt Ebb 50d0e1a988 * Volumetrics update
- Fixed a shading bug, due to issues in the raytrace engine where it would ignore 
intersections from the starting face (as it should). Disabled this for single 
scattering intersections, thanks to Brecht for a hint there. It still shows a 
little bit of noise, I think due to raytrace inaccuracy, which will have to be 
fixed up later.

before: http://mke3.net/blender/devel/rendering/volumetrics/vol_shaded_old.png
after: http://mke3.net/blender/devel/rendering/volumetrics/vol_shaded_correct.png

Now single scatttering shading works very nicely and is capable of things like this:
http://mke3.net/blender/devel/rendering/volumetrics/vol_shaded_clouds.mov

- Added colour emission. Now as well as the overall 'Emit:' slider to control 
overall emission strength, there's also a colour swatch for the volume to emit 
that colour. This can also be textured, using 'Emit Col' in the map to panel.

This animation was made using a clouds texture, with colour band, mapped to both 
emit colour and emit (strength):
http://mke3.net/blender/devel/rendering/volumetrics/vol_col_emit.mov

- Added 'Local' mapping to 'map input' - it's similar to Orco

- Fixed texture 'map input', wasn't using the offsets or scale values.
2008-09-23 04:26:52 +00:00
Daniel Genrich c08acde589 svn merge -r 16592:16667 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2008-09-22 10:04:45 +00:00
Matt Ebb 7522f86d01 * Volume rendering
This is an initial commit to get it in SVN and make it easier to work on.

Don't expect it to work perfectly, it's still in development and there's
plenty of work still needing to be done. And so no I'm not very interested 
in hearing bug reports or feature requests at this stage :)

There's some info on this, and a todo list at:
http://mke3.net/weblog/volume-rendering/

Right now I'm trying to focus on getting shading working correctly (there's 
currently a problem in which 'surfaces' of the volume facing towards or away
from light sources are getting shaded differently to how they should be),
then I'll work on integration issues, like taking materials behind the volume
into account, blending with alpha, etc. You can do simple testing though,
mapping textures to density or emission on a cube with volume material.
2008-09-22 01:51:24 +00:00
Ton Roosendaal afe851b6d1 Sunsky / Atmoshphere:
- Added blending mode and factor option, so it's more clear and
  controllable what happens with it. Also nice for crazy effects
  of course!
- Preview render now shows preview for it too

On the todos:

- have this in World buttons (as well) for quicker sky setups
- review math of color clamping and scaling, this is definitely 
  not good... but a fix will make old files look very different.
2008-09-21 16:04:33 +00:00
Brecht Van Lommel cb89decfdc Merge of first part of changes from the apricot branch, especially
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.
2008-09-04 20:51:28 +00:00
Chris Want 5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Brecht Van Lommel 0b8b4369c9 Patch #8034: "soft" option for halos, which avoids ugly intersections
with geometry, and makes halos look more volumetric.

Patch contributed by Markus Ilmola, thanks!
2008-04-14 19:48:14 +00:00