Compare commits

...

98 Commits

Author SHA1 Message Date
7da0d1a71e * Fixed a crazy memory leak in voxel data image sequence data source 2009-07-03 11:03:09 +00:00
d5e9eb7d76 * fix for small bug in volume texture stack 2009-06-21 22:17:06 +00:00
3b2ec94977 Voxel data & volume light cache
* 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.
2009-06-20 06:41:50 +00:00
44cebb39b8 * raised some limits in point density 2009-06-10 07:45:12 +00:00
ffbd75e571 * Fix for simple bug in voxel data texture 2009-05-16 13:17:21 +00:00
e1122a1b67 5th: another compile fix 2009-04-21 10:19:14 +00:00
fc7a561de1 4th: another file corrupted 2009-04-21 09:31:07 +00:00
cf9886b0d0 2nd try to merge sim_physics with trunk rev 19825
Please check if volumetrics are yet working
2009-04-21 08:49:06 +00:00
8a0a557294 Hopefully a working merge with trunk (could be one error left in raytrace.c - will check afterwards)
Merging 18706 - 19804
2009-04-20 00:19:16 +00:00
41b2a2a530 * Volume rendering / multiple scattering - normalisation
This changes the effect of the multiple scattering approximation to be more 
physically plausible (and easier to use) by making it conserve energy. 
Previously, the multiple scattering could show wildly different results 
based on the spread settings, often outputting much more light than was put 
in (via lamps), which is physically incorrect and made it difficult to use 
by requiring a lot of tweaking of the intensity value.

This fixes it to some extent with a simple normalization, where it scales 
the light energy after multiple scattering to be the same as what was
previously there in the light cache via single scattering. This means that 
using the default intensity of 1.0 should give good results by default, 
although you can still use it to tweak the effect.

Note: This will render differently if you've already set up a .blend using
multiple scattering with the old code, so you'll need to tweak older files. 
Setting the intensity back to the default 1.0 should be good though.


* Smaller thing - fixed the camera view vector stuff up a bit in light 
cache, it now gives much more similar results to non-light cache when using 
anisotropic scattering.
2009-03-18 03:52:17 +00:00
2b05a83729 Fixed a problem in how volumes were interpreting textures, and removed
associated workarounds in point density texture.
2009-03-17 05:33:05 +00:00
ce637a0046 * Patch by Raul F Hernandez
This adds a header to the voxel data texture's data file format, to 
auto-fill the resolution settings upon loading a file. I don't have a data 
file of the right format to test with, so I'll trust it works and wait for 
confirmation!

It also adds a 'still frame' setting, to pause the voxel data sequence on a 
specified frame, throughout the course of the rendered animation.
2009-03-11 05:32:11 +00:00
8fa180a9b1 * Fix for a small bug where multiple scattering wasn't being enabled properly.
* Also a MSVC compile fix
2009-02-26 00:13:40 +00:00
561a9b3d4c svn merge -r 17502:18705 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2009-01-28 00:43:46 +00:00
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
6cfbb0017a * Little feature, blend texture can have extrapolation modes (like repeat).
This should probably go in trunk, but I'll stay away for now with all the 2.5 work on.
2009-01-13 02:39:46 +00:00
0572f1a5f6 * fixed an incredibly silly typo-bug in light cache 2009-01-08 22:49:03 +00:00
834fda50d9 Volume rendering
* Fixed an old problem where if both the camera and a solid surface were 
inside a volume, the volume wouldn't attenuate in front of the surface (was 
visible in the blender conference art festival clouds animation:

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

* Initial support for refracting solids inside volumes. I might be able to 
make this work better, but not sure at the moment. It's a bit dodgy, 
limited by the code that does the recursive ray shading - it's really not 
set up for this kind of thing and could use a refactor very much.
2008-12-31 05:08:04 +00:00
be1d06a2c5 Volume rendering:
* 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
2008-12-22 20:28:02 +00:00
7124d321d8 * msvc compile fix 2008-12-15 05:49:56 +00:00
5f55aa43d0 * Compile fixes for voxeldata.c (thanks jms)
* Fixed a typo in the patch that made trilinear interpolation really slow

* Replaced the patch's trilinear interpolation code with the existing trilinear code from pbrt / light cache (first stage of unifying this voxel interpolation code)
2008-12-14 02:22:29 +00:00
c2f037da07 and the new voxel data files.. 2008-12-13 05:43:10 +00:00
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
aef61a7000 wip commit to work on at home, nothing to see 2008-12-09 07:19:55 +00:00
9e1da805e1 * Added back the GR: field for volume materials, limiting lighting to a certain group 2008-12-09 04:27:34 +00:00
1b9eabeef6 * Added other noise basis types to point density turbulence
* Fixed a bug in 'ignoring volumes in AAO'
2008-12-05 04:06:41 +00:00
bdf6711b70 * Some extra sanity checks for point density 2008-11-28 07:12:32 +00:00
6df8cf842a * Allow for light linking/overrides in volume materials 2008-11-19 23:27:47 +00:00
28da9ad12e svn merge -r 17201:17502 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2008-11-19 19:28:12 +00:00
14a0718a8a * fix - constant colour output in point density wasn't working 2008-11-19 05:30:52 +00:00
e5b51109e9 * Exclude volume materials from AO 2008-11-18 01:53:52 +00:00
e6a903c06e cleaned some code and split volume precaching into a new file 2008-11-15 04:16:46 +00:00
8d5c14b20d Volume rendering:
* Use a slightly better (but still not exact) approximation for the view
vector when pre-shading the light cache. This still doesn't give exactly the
same results as non-light-cache shading, but it's better. Will investigate
getting a better view vector when there's more time - or if anyone has a
simple formula to derive shi->view from shi->co that would be great to 
hear about too :)
2008-11-14 06:01:06 +00:00
a2da0911a6 * Fixed a float -> int conversion rounding error in volume rendering,
which was manifesting in little dark dots
2008-11-13 10:43:02 +00:00
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
3b2f996c25 Point Density
* Fixed a stupid crash caused by last commit that worked fine on the mac
(but never should have...)

* Fix for using child particles with the new particle age color options
2008-11-10 00:14:35 +00:00
a972107b03 Point Density texture: colouring
This introduces a few new ways of modifying the intensity and colour output 
generated by the Point Density texture. Previously, the texture only output 
intensity information, but now you can map it to colours along a gradient 
ramp, based on information coming out of a particle system.

This lets you do things like colour a particle system based on the individual 
particles' age - the main reason I need it is to fade particles out over time.

The colorband influences both the colour and intensity (using the colorband's 
alpha value), which makes it easy to map a single point density texture to 
both intensity values in the Map To panel (such as density or emit) and colour 
values (such as absorb col or emit col). This is how the below examples are 
set up, an example .blend file is available here:

http://mke3.net/blender/devel/rendering/volumetrics/pd_test4.blend

The different modes:

* Constant
No modifications to intensity or colour (pure white)

* Particle Age
Maps the color ramp along the particles' lifetimes:
http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_partage.mov

* Particle Speed
Maps the color ramp to the particles' absolute speed per frame (in Blender 
units). There's an additional scale parameter that you can use to bring this 
speed into a 0.0 - 1.0 range, if your particles are travelling too faster or 
slower than 0-1.
http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_speed.mov

* Velocity -> RGB
Outputs the particle XYZ velocity vector as RGB colours. This may be useful 
for comp work, or maybe in the future things like displacement. Again, there's 
a scale parameter to control it.
http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_velrgb.mov
2008-11-09 01:16:12 +00:00
f5f0c8fb37 * Fixed a strange problem with the way textures are interpreted - was causing weird things with point density turbulence on
* Reverted the spin field once more..
2008-11-04 05:17:02 +00:00
389588bb4f Reverted to the previous, more hackish version of the spin field.
There has to be a better way of doing this though... jahka? :)
2008-11-02 23:25:21 +00:00
5cdbbe3a92 * Tweaked the spin force field a bit. It worked great for its purpose
before, but wasn't playing nice with the other force fields (was 
overwriting the velocity rather than acting as a force). This version is 
slightly different, but will work a lot better with other force fields too.
2008-11-01 12:45:19 +00:00
15579884b1 * Added a new turbulence type: Time. It's not entirely well tested, but so far working ok. It's smoother looking than 'velocity' but may need more in depth investigation. 2008-10-31 05:29:54 +00:00
5fb8debada * Added a new, slightly experimental force field type: 'Spin'.
It works similarly to Vortex, but it's a more controllable - it 
doesn't send the particles off accelerating into space, but 
keeps them spinning around the Z axis of the force field object.

This is safe in the branch, but Jahka if you have any feedback, 
I'd be curious to hear :)
2008-10-30 09:26:30 +00:00
258784ae4b svn merge -r 17042:17201 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2008-10-27 20:14:45 +00:00
deea0fa2e7 * More improvements for light cache
Previously when using light cache, there could be artifacts caused when 
voxel points that were sampled outside the volume object's geometry got 
interpolated into the rest of the volume. This commit adds a (similar 
to a dilate) filter pass after creating the light cache, that fills 
these empty areas with the average of their surrounding voxels.

http://mke3.net/blender/devel/rendering/volumetrics/vol_lightcache_filter.jpg
2008-10-23 03:50:56 +00:00
ba829e5c36 Debugging tests paid off, fixed a ridiculously silly bug
that was preventing light cache from working on some 
people's systems (but went just fine on both my windows pc 
and mac). I have no idea how the original code even worked 
at all, it really shouldn't have.

But fixed now anyway! Thanks a bunch to Zanqdo for patience
in helping me pinpoint this.
2008-10-23 02:15:36 +00:00
ffe81354f8 removed debug stuff 2008-10-23 02:03:54 +00:00
5fabc7781b and more debugging 2008-10-23 01:52:04 +00:00
ee1a143947 more testing code 2008-10-23 01:40:49 +00:00
3a347c1caf Just adding some temporary testing code to help try and find a bug. 2008-10-23 01:14:30 +00:00
8a6c82684f * Did some small tweaks to how density is used with light
cache - it makes some very good improvements clearing up artifacts:

http://mke3.net/blender/devel/rendering/volumetrics/vol_lc_fixed.jpg
2008-10-22 09:26:18 +00:00
c62c61a413 * Fixed a bug in copying (making single user) a point density texture 2008-10-22 06:10:16 +00:00
876368d859 * fix for point density - particle systems weren't being
deformed by lattices
2008-10-22 05:24:41 +00:00
febcbdcfcd Tweaked rendering inside a volume to always return alpha 1.0.
This fixes an issue which darkened the render from inside a 
volume with sky or premul on. Still need to find a good way to
get an alpha value back into the shader (for compositing etc)
without getting the render distorted by premul.
2008-10-22 02:59:33 +00:00
652e4b5225 Point Density:
Replaced 'Sharp' falloff with 'Soft'. This falloff type has 
a variable softness, and can get some quite smooth results. 
It can be useful to get smooth transitions in density when 
you're using particles on a large scale:

http://mke3.net/blender/devel/rendering/volumetrics/pd_falloff_soft.jpg

Also removed 'angular velocity' turbulence source - it
wasn't doing anything useful atm
2008-10-22 01:31:46 +00:00
6f656f6482 fix for a compile error with msvc 2008-10-22 00:26:19 +00:00
094fda8cd9 * Fixed a crash with using light cache on a plane (which doesn't really make sense, but shouldn't crash at least) 2008-10-22 00:09:12 +00:00
b12d9bfa9c * reimplemented some things, hopefully may fix some problems zanqdo was having 2008-10-21 08:21:36 +00:00
97a7b05068 fixed a crash in volume shadows 2008-10-21 06:10:36 +00:00
d335c2dfcf * fixed a memory leak that was happening during preview render 2008-10-21 02:04:29 +00:00
07f072457d * fix for crash after latest light cache commit 2008-10-20 23:12:42 +00:00
9d2fc97827 New volume rendering feature: Light Cache
This was a bit complicated to do, but is working pretty well now, and can make shading significantly faster to render.

This option pre-calculates self-shading information into a 
3d voxel grid before rendering, then uses and interpolates
that data during the main rendering phase, rather than 
calculating shading for each sample. It's an approximation
and isn't as accurate as getting the lighting directly, 
but in many cases it looks very similar and renders much faster.
The voxel grid covers the object's 3D screen-aligned bounding box
so this may not be that useful for large volume regions like a
big range of cloud cover, since you'll need a lot of resolution.

The render time speaks for itself here:
http://mke3.net/blender/devel/rendering/volumetrics/vol_light_cache_interpolation.jpg

The resolution is set in the volume panel - it's the resolution
of one edge of the voxel grid. Keep in mind that the higher the
resolution, the more memory needed, like in fluid sim. The
memory requirements increase with the cube of the edge 
resolution so be careful. I might try and add a little memory 
calculator thing like fluid sim has there later.

The voxels are interpolated using trilinear interpolation - 
here's a comparison image I made during testing:
http://mke3.net/blender/devel/rendering/volumetrics/vol_light_cache_compare.jpg

There might still be a couple of little tweaks I can do to 
improve the visual quality, I'll see.
2008-10-20 07:08:06 +00:00
49aa7edb77 Another WIP commit, nothing to see yet. 2008-10-19 08:25:10 +00:00
b3000c5529 non-working WIP commit to continue coding at home.
nothing to see here, move along!
2008-10-17 05:54:42 +00:00
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
d6808c2b4b * Raytraced shadow casting for volumes
This is a first version and still has a couple of things undefined or
unimplemented, such as external objects casting shadows on or within volumes, 
however volume->solid shadows are going ok.

http://mke3.net/blender/devel/rendering/volumetrics/shadows_test_02.mov
http://mke3.net/blender/devel/rendering/volumetrics/vol_test_shad3.blend

As with other transparent raytraced shadows in Blender ,in order to make it work,
you must enable 'TraShad' on the material *receiving* the shadow. It would be 
nice to make this a bit easier to use, since there's not much chance you want a
volume material to be casting solid shadows, but that's a bigger issue in the 
renderer outside this scope.

The volume shadows are working from the same physical basis of absorption, and 
support coloured absorption:

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

They also work properly with multi-sampled (i.e. QMC) soft shadows:

http://mke3.net/blender/devel/rendering/volumetrics/vol_shad_sharp.png
http://mke3.net/blender/devel/rendering/volumetrics/vol_shad_soft.png

And by popular request the test file:
http://mke3.net/blender/devel/rendering/volumetrics/vol_test_shad_clouds.blend
2008-10-13 05:22:31 +00:00
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
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
2211b46084 svn merge -r 16866:17042 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2008-10-12 12:17:57 +00:00
21075b1a17 Using quad trees instead of binary ones give another 10% speedup 2008-10-12 11:38:28 +00:00
837211077c * fix for silly bug in point density with no object in the object field 2008-10-09 01:15:54 +00:00
8c3e960dd4 * Fix for silly crash in point density UI, showed up in files with an existing empty texture. 2008-10-06 22:39:06 +00:00
25ece3ba2f * New point density update: Turbulence
This addition allows you to perturb the point density with noise, to give 
the impression of more resolution. It's a quick way to add detail, without 
having to use large, complex, and slower to render particle systems.

Rather than just overlaying noise, like you might do by adding a secondary 
clouds texture, it uses noise to perturb the actual coordinate looked up 
in the density evaluation. This gives a much better looking result, as it 
actually alters the original density.

Comparison of the particle cloud render without, and with added turbulence 
(the render with turbulence only renders slightly more slowly):
http://mke3.net/blender/devel/rendering/volumetrics/pd_turbulence.jpg

Using the same constant noise function/spatial coordinates will give a 
static appearance. This is fine (and quicker) if the particles aren't 
moving, but on animated particle systems, it looks bad, as if the 
particles are moving through a static noise field. To overcome this, there 
are additional options for particle systems, to influence the turbulence 
with the particles' average velocity, or average angular velocity. This 
information is only available for particle systems at the present.

Here you can see the (dramatic) difference between no turbulence, static 
turbulence, and turbulence influenced by particle velocity:
http://mke3.net/blender/devel/rendering/volumetrics/turbu_compare.mov
2008-10-06 12:25:22 +00:00
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
e114d194ae * Re-coded the point density range checking to be a bit cleaner, and
not necessary to modify the BVH functions.
2008-10-02 01:38:12 +00:00
76658ef1a8 svn merge -r 16741:16866 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2008-10-01 16:22:28 +00:00
2745517ecd Added 'Object Location' option to 'object vertices' mode in Point
Density. This brings it consistent with the 'particle system' 
mode, and allows silly things like this a bit easier (especially 
after the last fix and BVH improvements!):

http://mke3.net/blender/devel/rendering/volumetrics/pd_objectloc.mov
2008-10-01 07:30:56 +00:00
25236b56a6 * Fix for volumetric rendering. It previously wasn't multiplying
the emission component by the density at the current point, which 
made the volume too bright in less dense areas. This made it look 
too rough, as opposed to smooth as it should be. This makes the 
particle rendering look *much* better, thanks a bunch to ZanQdo for 
complaining and kicking my butt to make me realise the error.

Here's an example of how smooth it looks now:
http://mke3.net/blender/devel/rendering/volumetrics/smoke_test03.mov
http://mke3.net/blender/devel/rendering/volumetrics/smoke_test03.blend

Settings in existing files will have to be tweaked a bit, since 
what they were set up for before, was incorrect.

* Added two new interpolation types to Point Density: Constant and 
Root. These work similarly to in proportional edit for example, 
just gives a bit more choice over how hard-edged the particles 
should look.
2008-10-01 07:13:28 +00:00
8622cbca35 * Point Density texture
Replaced the previous KD-tree (for caching points) with a 
BVH-tree (thanks to Andre 'jaguarandi' Pinto for help here!).

The bvh is quite a bit faster and doesn't suffer some of the
artifacts that were apparent with the kd-tree.

I've also added a choice of falloff types: Standard, Smooth, and 
Sharp. Standard gives a harder edge, easier to see individual 
particles, and when used with a larger radius, Smooth and Sharp 
falloffs make a much cloudier appearance possible. See the image 
below (note the settings and render times too)

http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_bvh.jpg
2008-10-01 03:35:53 +00:00
3c99a0f735 Fix for build error, mustn't have committed this properly last night 2008-09-30 23:58:48 +00:00
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
31d6a6be68 * New Point Density texture option: 'Object Vertices'
This works very similarly to particles, it just uses the object's renderable vertices as the points instead.

http://mke3.net/blender/devel/rendering/volumetrics/pd_objectvertices.png
2008-09-29 07:56:41 +00:00
bab94c46e0 Point Density texture
The Point Density texture now has some additional options for how 
the point locations are cached. Previously it was all relative to 
worldspace, but there are now some other options that make things 
a lot more convenient for mapping the texture to Local (or Orco). 
Thanks to theeth for helping with the space conversions!

The new Object space options allow this sort of thing to be possible
 - a particle system, instanced on a transformed renderable object:
http://mke3.net/blender/devel/rendering/volumetrics/pd_objectspace.mov

It's also a lot easier to use multiple instances, just duplicate
the renderable objects and move them around.


The new particle cache options are:

* Emit Object space
This caches the particles relative to the emitter object's 
coordinate space (i.e. relative to the emitter's object center). 
This makes it possible to map the Texture to Local or Orco 
easily, so you can easily move, rotate or scale the rendering 
object that has the Point Density texture. It's relative to the 
emitter's location, rotation and scale, so if the object you're 
rendering the texture on is aligned differently to the emitter, 
the results will be rotated etc.

* Emit Object Location
This offsets the particles to the emitter object's location in 3D 
space. It's similar to Emit Object Space, however the emitter 
object's rotation and scale are ignored. This is probably the 
easiest to use, since you don't need to worry about the rotation 
and scale of the emitter object (just the rendered object), so 
it's the default.

* Global Space
This is the same as previously, the particles are cached in global space, so to use this effectively you'll need to map the texture to Global, and have the rendered object in the right global location.
2008-09-29 04:19:24 +00:00
345dc8eb94 Fix: point density texture now works with the 'auto name' button 2008-09-28 23:40:36 +00:00
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
c301a059bd svn merge -r 16667:16741 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2008-09-26 08:58:15 +00:00
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
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
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
0417e79586 * Moved the sample location for shading to the middle of the volumetric step. This fixes a nagging bug that would cause noise/odd moire-ish patterns, due to raytrace numerical errors:
http://mke3.net/blender/devel/rendering/volumetrics/vol_clouds_moire.jpg
2008-09-24 07:49:24 +00:00
a0a5198a03 Volumetrics:
* Now it's possible to render with the camera inside a volume. I'm not sure how this goes with overlapping volumes yet, will look at it. But it allows nice things like this :)
http://mke3.net/blender/devel/rendering/volumetrics/clouds_sky.mov

* Sped up shading significantly by not doing any shading if the density
of the current sample is less than 0.01 (there's nothing to shade there anyway!) Speeds up around 200% on that clouds scene.

* Fixed a bug in global texture coordinates for volume textures
2008-09-24 07:38:12 +00:00
aed107cf4a * Volumetrics scene integration
Now other objects (and sky) correctly render if they're partially 
inside or behind a volume. Previously all other objects were ignored, 
and volumes just rendered on black. The colour of surfaces inside or 
behind the volume gets correctly attenuated by the density of the 
volume in between - i.e. thicker volumes will block the light coming 
from behind. However, other solid objects don't receive volume shadows 
yet, this is to be worked on later.

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

Currently this uses raytracing to find intersections within the volume, 
and rays are also traced from the volume, heading behind into the 
scene, to see what's behind it (similar effect to ray transp with IOR 
1). Because of this, objects inside or behind the volume will not be 
antialiased. Perhaps I can come up with a solution for this, but until 
then, for antialiasing, you can turn on Full OSA (warning, this will 
incur a slowdown). Of course you can always avoid this by rendering 
volumes on a separate renderlayer, and compositing in post, too.

Another idea I've started thinking about is to calculate an alpha 
value, then use ztransp to overlay on top of other objects. This won't 
accurately attenuate and absorb light coming from objects behind the 
volume, but for some situations it may be fine, and faster too.
2008-09-24 02:52:47 +00:00
45acf427a7 * bugfix, old files (including default cube) weren't loading up with
correctly initialised volume settings
2008-09-23 08:00:55 +00:00
340c3b945e * Refactored the volume texture code. Seems to go ok so far, stress
tests and all my old files render fine, but anyone feel free to let me 
know if you find a bug in this :)

Should be a bit faster too, this file renders in about 60% of the time 
it did before 
(http://mke3.net/blender/devel/rendering/volumetrics/vol_col_emit.mov)
2008-09-23 07:44:25 +00:00
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
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
c08acde589 svn merge -r 16592:16667 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2008-09-22 10:04:45 +00:00
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
6701f07e66 svn merge -r 16490:16592 https://svn.blender.org/svnroot/bf-blender/trunk/blender + 16453:16485 2008-09-18 13:22:17 +00:00
342 changed files with 62959 additions and 58165 deletions

View File

@@ -1,6 +1,6 @@
/**
*
* $Id$
* $Id: BOP_Merge2.cpp 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,6 +1,6 @@
/**
*
* $Id$
* $Id: BOP_Misc.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: BLO_sys_types.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: mmap_win.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: mmap_win.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: BLO_sys_types.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

0
release/beos-4.5-i386/specific.sh Executable file → Normal file
View File

0
release/beos-5.0-i386/specific.sh Executable file → Normal file
View File

0
release/irix-6.2-mips/specific.sh Executable file → Normal file
View File

View File

@@ -11,7 +11,7 @@ Tooltip: 'Export to M3G'
#
# Source: http://www.nelson-games.de/bl2m3g/source
#
# $Id$
# $Id: export_m3g.py 17332 2008-11-05 11:42:34Z migius $
#
# Author: Gerhard V<>lkl
#

View File

@@ -22,7 +22,7 @@ Be sure to set the framerate correctly
"""
# $Id$
# $Id: import_lightwave_motion.py 17332 2008-11-05 11:42:34Z migius $
# --------------------------------------------------------------------------
# ***** BEGIN GPL LICENSE BLOCK *****
#

View File

@@ -3,7 +3,7 @@
*
* BMesh modeler structure and functions.
*
* $Id$
* $Id: BKE_bmesh.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -3,7 +3,7 @@
*
* BMesh modeler structure and functions.
*
* $Id$
* $Id: BKE_bmeshCustomData.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,6 +1,6 @@
/**
*
* $Id$
* $Id: BKE_bvhutils.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -134,4 +134,3 @@ void bvhcache_init(BVHCache *cache);
void bvhcache_free(BVHCache *cache);
#endif

View File

@@ -1,7 +1,7 @@
/**
* BKE_cloth.h
*
* $Id$
* $Id: BKE_cloth.h,v 1.1 2007/08/01 02:07:27 daniel Exp $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,7 +1,7 @@
/**
* BKE_cloth.h
*
* $Id$
* $Id: BKE_cloth.h,v 1.1 2007/08/01 02:07:27 daniel Exp $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -147,4 +147,3 @@ CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj);
/////////////////////////////////////////////////
#endif

View File

@@ -1,5 +1,5 @@
/*
* $Id$
* $Id: BKE_multires.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,7 +1,7 @@
/* BKE_particle.h
*
*
* $Id$
* $Id: BKE_particle.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/*
* $Id$
* $Id: BKE_sculpt.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -91,3 +91,4 @@ void texttool_docs_clear();
#endif
#endif

View File

@@ -39,6 +39,8 @@ struct ColorBand;
struct HaloRen;
struct TexMapping;
struct EnvMap;
struct PointDensity;
struct VoxelData;
/* in ColorBand struct */
#define MAXCOLORBAND 32
@@ -74,6 +76,16 @@ void BKE_free_envmap(struct EnvMap *env);
struct EnvMap *BKE_add_envmap(void);
struct EnvMap *BKE_copy_envmap(struct EnvMap *env);
void BKE_free_pointdensitydata(struct PointDensity *pd);
void BKE_free_pointdensity(struct PointDensity *pd);
struct PointDensity *BKE_add_pointdensity(void);
struct PointDensity *BKE_copy_pointdensity(struct PointDensity *pd);
void BKE_free_voxeldatadata(struct VoxelData *vd);
void BKE_free_voxeldata(struct VoxelData *vd);
struct VoxelData *BKE_add_voxeldata(void);
struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd);
int BKE_texture_dependsOnTime(const struct Tex *texture);
#endif

View File

@@ -3,7 +3,7 @@
*
* Custom Data functions for Bmesh
*
* $Id$
* $Id: BME_Customdata.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -3,7 +3,7 @@
*
* BMesh mesh level functions.
*
* $Id$
* $Id: BME_conversions.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -3,7 +3,7 @@
*
* BMesh Euler construction API.
*
* $Id$
* $Id: BME_eulers.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -3,7 +3,7 @@
*
* BMesh mesh level functions.
*
* $Id$
* $Id: BME_mesh.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -3,7 +3,7 @@
*
* Low level routines for manipulating the BMesh structure.
*
* $Id$
* $Id: BME_structure.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -3,7 +3,7 @@
*
* Functions for changing the topology of a mesh.
*
* $Id$
* $Id: BME_tools.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -3,7 +3,7 @@
*
* low level, 'private' function prototypes for bmesh kernel.
*
* $Id$
* $Id: bmesh_private.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -617,7 +617,6 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
}
}
/* BVHCache */
typedef struct BVHCacheItem
{

View File

@@ -419,6 +419,28 @@ void do_physical_effector(Object *ob, float *opco, short type, float force_val,
VecAddf(field,field,mag_vec);
break;
case PFIELD_SPIN:
{
float inward[3];
Projf(temp, velocity, eff_vel);
Crossf(mag_vec,eff_vel,vec_to_part);
Crossf(inward, mag_vec, eff_vel);
Normalize(mag_vec);
Normalize(inward);
VecSubf(mag_vec, mag_vec, inward);
VecMulf(mag_vec,force_val*distance*falloff);
VecAddf(mag_vec, mag_vec, temp);
//VecCopyf(velocity, mag_vec);
VecSubf(mag_vec, mag_vec, velocity);
VecAddf(field, field, mag_vec);
break;
}
case PFIELD_MAGNET:
if(planar)
VecCopyf(temp,eff_vel);

View File

@@ -171,6 +171,14 @@ void init_material(Material *ma)
ma->sss_front= 1.0f;
ma->sss_back= 1.0f;
ma->vol_density_scale = 1.0f;
ma->vol_stepsize = 0.2f;
ma->vol_shade_stepsize = 0.2f;
ma->vol_absorption = 1.0f;
ma->vol_scattering = 1.0f;
ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f;
ma->vol_precache_resolution = 50;
ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR;
ma->preview = NULL;

View File

@@ -1,5 +1,5 @@
/*
* $Id$
* $Id: multires.c 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,7 +1,7 @@
/* particle.c
*
*
* $Id$
* $Id: particle.c $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,7 +1,7 @@
/* particle_system.c
*
*
* $Id$
* $Id: particle_system.c $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: suggestions.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -43,6 +43,7 @@
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
#include "BLI_rand.h"
#include "BLI_kdopbvh.h"
#include "DNA_texture_types.h"
#include "DNA_key_types.h"
@@ -418,6 +419,8 @@ void free_texture(Tex *tex)
free_plugin_tex(tex->plugin);
if(tex->coba) MEM_freeN(tex->coba);
if(tex->env) BKE_free_envmap(tex->env);
if(tex->pd) BKE_free_pointdensity(tex->pd);
if(tex->vd) BKE_free_voxeldata(tex->vd);
BKE_previewimg_free(&tex->preview);
BKE_icon_delete((struct ID*)tex);
tex->id.icon_id = 0;
@@ -484,6 +487,16 @@ void default_tex(Tex *tex)
tex->env->depth=0;
}
if (tex->pd) {
tex->pd->radius = 0.3f;
tex->pd->falloff_type = TEX_PD_FALLOFF_STD;
}
if (tex->vd) {
tex->vd->resolX=50;
tex->vd->interp_type=0;
}
pit = tex->plugin;
if (pit) {
varstr= pit->varstr;
@@ -580,6 +593,8 @@ Tex *copy_texture(Tex *tex)
if(texn->coba) texn->coba= MEM_dupallocN(texn->coba);
if(texn->env) texn->env= BKE_copy_envmap(texn->env);
if(texn->pd) texn->pd= BKE_copy_pointdensity(texn->pd);
if(texn->vd) texn->vd=BKE_copy_voxeldata(texn->vd);
if(tex->preview) texn->preview = BKE_previewimg_copy(tex->preview);
@@ -881,6 +896,104 @@ void BKE_free_envmap(EnvMap *env)
}
/* ------------------------------------------------------------------------- */
PointDensity *BKE_add_pointdensity(void)
{
PointDensity *pd;
pd= MEM_callocN(sizeof(PointDensity), "pointdensity");
pd->flag = 0;
pd->radius = 0.3f;
pd->falloff_type = TEX_PD_FALLOFF_STD;
pd->falloff_softness = 2.0;
pd->source = TEX_PD_PSYS;
pd->point_tree = NULL;
pd->point_data = NULL;
pd->noise_size = 0.5f;
pd->noise_depth = 1;
pd->noise_fac = 1.0f;
pd->noise_influence = TEX_PD_NOISE_STATIC;
pd->coba = add_colorband(1);
pd->speed_scale = 1.0f;
pd->totpoints = 0;
pd->coba = add_colorband(1);
return pd;
}
PointDensity *BKE_copy_pointdensity(PointDensity *pd)
{
PointDensity *pdn;
pdn= MEM_dupallocN(pd);
pdn->point_tree = NULL;
pdn->point_data = NULL;
if(pdn->coba) pdn->coba= MEM_dupallocN(pdn->coba);
return pdn;
}
void BKE_free_pointdensitydata(PointDensity *pd)
{
if (pd->point_tree) {
BLI_bvhtree_free(pd->point_tree);
pd->point_tree = NULL;
}
if (pd->point_data) {
MEM_freeN(pd->point_data);
pd->point_data = NULL;
}
if(pd->coba) MEM_freeN(pd->coba);
}
void BKE_free_pointdensity(PointDensity *pd)
{
BKE_free_pointdensitydata(pd);
MEM_freeN(pd);
}
void BKE_free_voxeldatadata(struct VoxelData *vd)
{
if (vd->dataset) {
MEM_freeN(vd->dataset);
vd->dataset = NULL;
}
}
void BKE_free_voxeldata(struct VoxelData *vd)
{
BKE_free_voxeldatadata(vd);
MEM_freeN(vd);
}
struct VoxelData *BKE_add_voxeldata(void)
{
VoxelData *vd;
vd= MEM_callocN(sizeof(struct VoxelData), "voxeldata");
vd->dataset = NULL;
vd->resolX = 1;
vd->resolY = 1;
vd->resolZ = 1;
vd->interp_type= TEX_VD_NEARESTNEIGHBOR;
vd->int_multiplier = 1.0;
return vd;
}
struct VoxelData *BKE_copy_voxeldata(struct VoxelData *vd)
{
VoxelData *vdn;
vdn= MEM_dupallocN(vd);
vdn->dataset = NULL;
return vdn;
}
/* ------------------------------------------------------------------------- */
int BKE_texture_dependsOnTime(const struct Tex *texture)
{

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: verse_method.c 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -253,6 +253,7 @@ void printvec4f(char *str, float v[4]);
void VecAddf(float *v, float *v1, float *v2);
void VecSubf(float *v, float *v1, float *v2);
void VecMulVecf(float *v, float *v1, float *v2);
void VecLerpf(float *target, float *a, float *b, float t);
void VecMidf(float *v, float *v1, float *v2);

View File

@@ -1,6 +1,6 @@
/**
*
* $Id$
* $Id: BLI_kdopbvh.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -71,6 +71,9 @@ typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const f
/* callback must update hit in case it finds a nearest successful hit */
typedef void (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit);
/* callback to range search query */
typedef void (*BVHTree_RangeQuery) (void *userdata, int index, float squared_dist);
BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis);
void BLI_bvhtree_free(BVHTree *tree);
@@ -93,5 +96,9 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea
int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
/* range query */
int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata);
#endif // BLI_KDOPBVH_H

View File

@@ -1,7 +1,7 @@
/**
* A kd-tree for nearest neighbour search.
*
* $Id$
* $Id: BLI_kdtree.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -0,0 +1,40 @@
/**
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary).
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef BLI_VOXEL_H
#define BLI_VOXEL_H
/* find the index number of a voxel, given x/y/z integer coords and resolution vector */
#define V_I(x, y, z, res) ( (z)*(res)[1]*(res)[0] + (y)*(res)[0] + (x) )
/* all input coordinates must be in bounding box 0.0 - 1.0 */
float voxel_sample_nearest(float *data, int *res, float *co);
float voxel_sample_trilinear(float *data, int *res, float *co);
float voxel_sample_tricubic(float *data, int *res, float *co);
#endif /* BLI_VOXEL_H */

View File

@@ -1171,7 +1171,7 @@ static float squared_dist(const float *a, const float *b)
}
//Determines the nearest point of the given node BV. Returns the squared distance to that point.
static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *nearest)
static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest)
{
int i;
const float *bv = node->bv;
@@ -1179,12 +1179,12 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near
//nearest on AABB hull
for(i=0; i != 3; i++, bv += 2)
{
if(bv[0] > data->proj[i])
if(bv[0] > proj[i])
nearest[i] = bv[0];
else if(bv[1] < data->proj[i])
else if(bv[1] < proj[i])
nearest[i] = bv[1];
else
nearest[i] = data->proj[i];
nearest[i] = proj[i];
}
/*
@@ -1206,7 +1206,7 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near
}
}
*/
return squared_dist(data->co, nearest);
return squared_dist(proj, nearest);
}
@@ -1229,7 +1229,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
else
{
data->nearest.index = node->index;
data->nearest.dist = calc_nearest_point(data, node, data->nearest.co);
data->nearest.dist = calc_nearest_point(data->proj, node, data->nearest.co);
}
}
else
@@ -1243,7 +1243,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
for(i=0; i != node->totnode; i++)
{
if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue;
if( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
dfs_find_nearest_dfs(data, node->children[i]);
}
}
@@ -1251,7 +1251,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
{
for(i=node->totnode-1; i >= 0 ; i--)
{
if( calc_nearest_point(data, node->children[i], nearest) >= data->nearest.dist) continue;
if( calc_nearest_point(data->proj, node->children[i], nearest) >= data->nearest.dist) continue;
dfs_find_nearest_dfs(data, node->children[i]);
}
}
@@ -1261,7 +1261,7 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node)
static void dfs_find_nearest_begin(BVHNearestData *data, BVHNode *node)
{
float nearest[3], sdist;
sdist = calc_nearest_point(data, node, nearest);
sdist = calc_nearest_point(data->proj, node, nearest);
if(sdist >= data->nearest.dist) return;
dfs_find_nearest_dfs(data, node);
}
@@ -1298,7 +1298,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
}
current.node = node;
current.dist = calc_nearest_point(data, node, nearest);
current.dist = calc_nearest_point(data->proj, node, nearest);
while(current.dist < data->nearest.dist)
{
@@ -1326,7 +1326,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
}
heap[heap_size].node = current.node->children[i];
heap[heap_size].dist = calc_nearest_point(data, current.node->children[i], nearest);
heap[heap_size].dist = calc_nearest_point(data->proj, current.node->children[i], nearest);
if(heap[heap_size].dist >= data->nearest.dist) continue;
heap_size++;
@@ -1524,3 +1524,90 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float
return data.hit.index;
}
/*
* Range Query - as request by broken :P
*
* Allocs and fills an array with the indexs of node that are on the given spherical range (center, radius)
* Returns the size of the array.
*/
typedef struct RangeQueryData
{
BVHTree *tree;
const float *center;
float radius; //squared radius
int hits;
BVHTree_RangeQuery callback;
void *userdata;
} RangeQueryData;
static void dfs_range_query(RangeQueryData *data, BVHNode *node)
{
if(node->totnode == 0)
{
//Calculate the node min-coords (if the node was a point then this is the point coordinates)
float co[3];
co[0] = node->bv[0];
co[1] = node->bv[2];
co[2] = node->bv[4];
}
else
{
int i;
for(i=0; i != node->totnode; i++)
{
float nearest[3];
float dist = calc_nearest_point(data->center, node->children[i], nearest);
if(dist < data->radius)
{
//Its a leaf.. call the callback
if(node->children[i]->totnode == 0)
{
data->hits++;
data->callback( data->userdata, node->children[i]->index, dist );
}
else
dfs_range_query( data, node->children[i] );
}
}
}
}
int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata)
{
BVHNode * root = tree->nodes[tree->totleaf];
RangeQueryData data;
data.tree = tree;
data.center = co;
data.radius = radius*radius;
data.hits = 0;
data.callback = callback;
data.userdata = userdata;
if(root != NULL)
{
float nearest[3];
float dist = calc_nearest_point(data.center, root, nearest);
if(dist < data.radius)
{
//Its a leaf.. call the callback
if(root->totnode == 0)
{
data.hits++;
data.callback( data.userdata, root->index, dist );
}
else
dfs_range_query( &data, root );
}
}
return data.hits;
}

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: BLI_kdtree.c 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -2151,6 +2151,13 @@ void VecSubf(float *v, float *v1, float *v2)
v[2]= v1[2]- v2[2];
}
void VecMulVecf(float *v, float *v1, float *v2)
{
v[0] = v1[0] * v2[0];
v[1] = v1[1] * v2[1];
v[2] = v1[2] * v2[2];
}
void VecLerpf(float *target, float *a, float *b, float t)
{
float s = 1.0f-t;
@@ -3324,6 +3331,12 @@ float Normalize2(float *n)
return d;
}
float rgb_to_luminance(float r, float g, float b)
{
/* Rec. 709 HDTV */
return (0.2126*r + 0.7152*g + 0.0722*b);
}
void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b)
{
int i;

View File

@@ -0,0 +1,311 @@
/**
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary).
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <math.h>
#include "BLI_voxel.h"
#include "BKE_utildefines.h"
#if defined( _MSC_VER ) && !defined( __cplusplus )
# define inline __inline
#endif // defined( _MSC_VER ) && !defined( __cplusplus )
static inline float D(float *data, int *res, int x, int y, int z)
{
CLAMP(x, 0, res[0]-1);
CLAMP(y, 0, res[1]-1);
CLAMP(z, 0, res[2]-1);
return data[ V_I(x, y, z, res) ];
}
/* *** nearest neighbour *** */
/* input coordinates must be in bounding box 0.0 - 1.0 */
float voxel_sample_nearest(float *data, int *res, float *co)
{
int xi, yi, zi;
xi = co[0] * res[0];
yi = co[1] * res[1];
zi = co[2] * res[2];
return D(data, res, xi, yi, zi);
}
/* *** trilinear *** */
/* input coordinates must be in bounding box 0.0 - 1.0 */
static inline float lerp(float t, float v1, float v2) {
return (1.f - t) * v1 + t * v2;
}
/* trilinear interpolation - taken partly from pbrt's implementation: http://www.pbrt.org */
float voxel_sample_trilinear(float *data, int *res, float *co)
{
float voxx, voxy, voxz;
int vx, vy, vz;
float dx, dy, dz;
float d00, d10, d01, d11, d0, d1, d_final;
if (!data) return 0.f;
voxx = co[0] * res[0] - 0.5f;
voxy = co[1] * res[1] - 0.5f;
voxz = co[2] * res[2] - 0.5f;
vx = (int)voxx; vy = (int)voxy; vz = (int)voxz;
dx = voxx - vx; dy = voxy - vy; dz = voxz - vz;
d00 = lerp(dx, D(data, res, vx, vy, vz), D(data, res, vx+1, vy, vz));
d10 = lerp(dx, D(data, res, vx, vy+1, vz), D(data, res, vx+1, vy+1, vz));
d01 = lerp(dx, D(data, res, vx, vy, vz+1), D(data, res, vx+1, vy, vz+1));
d11 = lerp(dx, D(data, res, vx, vy+1, vz+1), D(data, res, vx+1, vy+1, vz+1));
d0 = lerp(dy, d00, d10);
d1 = lerp(dy, d01, d11);
d_final = lerp(dz, d0, d1);
return d_final;
}
/* *** tricubic *** */
int C[64][64] = {
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 2, 2,-2,-2, 2, 2,-2,-2, 2,-2, 2,-2, 2,-2, 2,-2, 1, 1, 1, 1, 1, 1, 1, 1}};
static int ijk2n(int i, int j, int k) {
return(i+4*j+16*k);
}
static void tricubic_get_coeff_stacked(float a[64], float x[64]) {
int i,j;
for (i=0;i<64;i++) {
a[i]=(float)(0.0);
for (j=0;j<64;j++) {
a[i]+=C[i][j]*x[j];
}
}
}
static void point2xyz(int p, int *x, int *y, int *z) {
switch (p) {
case 0: *x=0; *y=0; *z=0; break;
case 1: *x=1; *y=0; *z=0; break;
case 2: *x=0; *y=1; *z=0; break;
case 3: *x=1; *y=1; *z=0; break;
case 4: *x=0; *y=0; *z=1; break;
case 5: *x=1; *y=0; *z=1; break;
case 6: *x=0; *y=1; *z=1; break;
case 7: *x=1; *y=1; *z=1; break;
default:*x=0; *y=0; *z=0;
}
}
static void tricubic_get_coeff(float a[64], float f[8], float dfdx[8], float dfdy[8], float dfdz[8], float d2fdxdy[8], float d2fdxdz[8], float d2fdydz[8], float d3fdxdydz[8]) {
int i;
float x[64];
for (i=0;i<8;i++) {
x[0+i]=f[i];
x[8+i]=dfdx[i];
x[16+i]=dfdy[i];
x[24+i]=dfdz[i];
x[32+i]=d2fdxdy[i];
x[40+i]=d2fdxdz[i];
x[48+i]=d2fdydz[i];
x[56+i]=d3fdxdydz[i];
}
tricubic_get_coeff_stacked(a,x);
}
static float tricubic_eval(float a[64], float x, float y, float z) {
int i,j,k;
float ret=(float)(0.0);
for (i=0;i<4;i++) {
for (j=0;j<4;j++) {
for (k=0;k<4;k++) {
ret+=a[ijk2n(i,j,k)]*pow(x,i)*pow(y,j)*pow(z,k);
}
}
}
return(ret);
}
/* tricubic interpolation
* from 'libtricubic': http://www.lekien.com/~francois/software/tricubic/
* input coordinates must be in bounding box 0.0 - 1.0 */
float voxel_sample_tricubic(float *data, int *res, float *co)
{
float xx, yy, zz;
int xi,yi,zi;
int *n = res;
float dx,dy,dz;
float a[64];
xx = co[0] * res[0] - 0.5f;
yy = co[1] * res[1] - 0.5f;
zz = co[2] * res[2] - 0.5f;
xi = (int)xx; yi = (int)yy; zi = (int)zz;
{
float fval[8]={data[V_I(xi,yi,zi,n)],data[V_I(xi+1,yi,zi,n)],data[V_I(xi,yi+1,zi,n)],data[V_I(xi+1,yi+1,zi,n)],data[V_I(xi,yi,zi+1,n)],data[V_I(xi+1,yi,zi+1,n)],data[V_I(xi,yi+1,zi+1,n)],data[V_I(xi+1,yi+1,zi+1,n)]};
float dfdxval[8]={0.5f*(data[V_I(xi+1,yi,zi,n)]-data[V_I(xi-1,yi,zi,n)]),0.5f*(data[V_I(xi+2,yi,zi,n)]-data[V_I(xi,yi,zi,n)]),
0.5f*(data[V_I(xi+1,yi+1,zi,n)]-data[V_I(xi-1,yi+1,zi,n)]),0.5f*(data[V_I(xi+2,yi+1,zi,n)]-data[V_I(xi,yi+1,zi,n)]),
0.5f*(data[V_I(xi+1,yi,zi+1,n)]-data[V_I(xi-1,yi,zi+1,n)]),0.5f*(data[V_I(xi+2,yi,zi+1,n)]-data[V_I(xi,yi,zi+1,n)]),
0.5f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi-1,yi+1,zi+1,n)]),
0.5f*(data[V_I(xi+2,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi+1,n)])};
float dfdyval[8]={0.5f*(data[V_I(xi,yi+1,zi,n)]-data[V_I(xi,yi-1,zi,n)]),0.5f*(data[V_I(xi+1,yi+1,zi,n)]-data[V_I(xi+1,yi-1,zi,n)]),
0.5f*(data[V_I(xi,yi+2,zi,n)]-data[V_I(xi,yi,zi,n)]),0.5f*(data[V_I(xi+1,yi+2,zi,n)]-data[V_I(xi+1,yi,zi,n)]),
0.5f*(data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi,yi-1,zi+1,n)]),0.5f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi+1,yi-1,zi+1,n)]),
0.5f*(data[V_I(xi,yi+2,zi+1,n)]-data[V_I(xi,yi,zi+1,n)]),
0.5f*(data[V_I(xi+1,yi+2,zi+1,n)]-data[V_I(xi+1,yi,zi+1,n)])};
float dfdzval[8]={0.5f*(data[V_I(xi,yi,zi+1,n)]-data[V_I(xi,yi,zi-1,n)]),0.5f*(data[V_I(xi+1,yi,zi+1,n)]-data[V_I(xi+1,yi,zi-1,n)]),
0.5f*(data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi-1,n)]),0.5f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi+1,yi+1,zi-1,n)]),
0.5f*(data[V_I(xi,yi,zi+2,n)]-data[V_I(xi,yi,zi,n)]),0.5f*(data[V_I(xi+1,yi,zi+2,n)]-data[V_I(xi+1,yi,zi,n)]),
0.5f*(data[V_I(xi,yi+1,zi+2,n)]-data[V_I(xi,yi+1,zi,n)]),
0.5f*(data[V_I(xi+1,yi+1,zi+2,n)]-data[V_I(xi+1,yi+1,zi,n)])};
float d2fdxdyval[8]={0.25*(data[V_I(xi+1,yi+1,zi,n)]-data[V_I(xi-1,yi+1,zi,n)]-data[V_I(xi+1,yi-1,zi,n)]+data[V_I(xi-1,yi-1,zi,n)]),
0.25*(data[V_I(xi+2,yi+1,zi,n)]-data[V_I(xi,yi+1,zi,n)]-data[V_I(xi+2,yi-1,zi,n)]+data[V_I(xi,yi-1,zi,n)]),
0.25*(data[V_I(xi+1,yi+2,zi,n)]-data[V_I(xi-1,yi+2,zi,n)]-data[V_I(xi+1,yi,zi,n)]+data[V_I(xi-1,yi,zi,n)]),
0.25*(data[V_I(xi+2,yi+2,zi,n)]-data[V_I(xi,yi+2,zi,n)]-data[V_I(xi+2,yi,zi,n)]+data[V_I(xi,yi,zi,n)]),
0.25*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi-1,yi+1,zi+1,n)]-data[V_I(xi+1,yi-1,zi+1,n)]+data[V_I(xi-1,yi-1,zi+1,n)]),
0.25*(data[V_I(xi+2,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi+2,yi-1,zi+1,n)]+data[V_I(xi,yi-1,zi+1,n)]),
0.25*(data[V_I(xi+1,yi+2,zi+1,n)]-data[V_I(xi-1,yi+2,zi+1,n)]-data[V_I(xi+1,yi,zi+1,n)]+data[V_I(xi-1,yi,zi+1,n)]),
0.25*(data[V_I(xi+2,yi+2,zi+1,n)]-data[V_I(xi,yi+2,zi+1,n)]-data[V_I(xi+2,yi,zi+1,n)]+data[V_I(xi,yi,zi+1,n)])};
float d2fdxdzval[8]={0.25f*(data[V_I(xi+1,yi,zi+1,n)]-data[V_I(xi-1,yi,zi+1,n)]-data[V_I(xi+1,yi,zi-1,n)]+data[V_I(xi-1,yi,zi-1,n)]),
0.25f*(data[V_I(xi+2,yi,zi+1,n)]-data[V_I(xi,yi,zi+1,n)]-data[V_I(xi+2,yi,zi-1,n)]+data[V_I(xi,yi,zi-1,n)]),
0.25f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi-1,yi+1,zi+1,n)]-data[V_I(xi+1,yi+1,zi-1,n)]+data[V_I(xi-1,yi+1,zi-1,n)]),
0.25f*(data[V_I(xi+2,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi+2,yi+1,zi-1,n)]+data[V_I(xi,yi+1,zi-1,n)]),
0.25f*(data[V_I(xi+1,yi,zi+2,n)]-data[V_I(xi-1,yi,zi+2,n)]-data[V_I(xi+1,yi,zi,n)]+data[V_I(xi-1,yi,zi,n)]),
0.25f*(data[V_I(xi+2,yi,zi+2,n)]-data[V_I(xi,yi,zi+2,n)]-data[V_I(xi+2,yi,zi,n)]+data[V_I(xi,yi,zi,n)]),
0.25f*(data[V_I(xi+1,yi+1,zi+2,n)]-data[V_I(xi-1,yi+1,zi+2,n)]-data[V_I(xi+1,yi+1,zi,n)]+data[V_I(xi-1,yi+1,zi,n)]),
0.25f*(data[V_I(xi+2,yi+1,zi+2,n)]-data[V_I(xi,yi+1,zi+2,n)]-data[V_I(xi+2,yi+1,zi,n)]+data[V_I(xi,yi+1,zi,n)])};
float d2fdydzval[8]={0.25f*(data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi,yi-1,zi+1,n)]-data[V_I(xi,yi+1,zi-1,n)]+data[V_I(xi,yi-1,zi-1,n)]),
0.25f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi+1,yi-1,zi+1,n)]-data[V_I(xi+1,yi+1,zi-1,n)]+data[V_I(xi+1,yi-1,zi-1,n)]),
0.25f*(data[V_I(xi,yi+2,zi+1,n)]-data[V_I(xi,yi,zi+1,n)]-data[V_I(xi,yi+2,zi-1,n)]+data[V_I(xi,yi,zi-1,n)]),
0.25f*(data[V_I(xi+1,yi+2,zi+1,n)]-data[V_I(xi+1,yi,zi+1,n)]-data[V_I(xi+1,yi+2,zi-1,n)]+data[V_I(xi+1,yi,zi-1,n)]),
0.25f*(data[V_I(xi,yi+1,zi+2,n)]-data[V_I(xi,yi-1,zi+2,n)]-data[V_I(xi,yi+1,zi,n)]+data[V_I(xi,yi-1,zi,n)]),
0.25f*(data[V_I(xi+1,yi+1,zi+2,n)]-data[V_I(xi+1,yi-1,zi+2,n)]-data[V_I(xi+1,yi+1,zi,n)]+data[V_I(xi+1,yi-1,zi,n)]),
0.25f*(data[V_I(xi,yi+2,zi+2,n)]-data[V_I(xi,yi,zi+2,n)]-data[V_I(xi,yi+2,zi,n)]+data[V_I(xi,yi,zi,n)]),
0.25f*(data[V_I(xi+1,yi+2,zi+2,n)]-data[V_I(xi+1,yi,zi+2,n)]-data[V_I(xi+1,yi+2,zi,n)]+data[V_I(xi+1,yi,zi,n)])};
float d3fdxdydzval[8]={0.125f*(data[V_I(xi+1,yi+1,zi+1,n)]-data[V_I(xi-1,yi+1,zi+1,n)]-data[V_I(xi+1,yi-1,zi+1,n)]+data[V_I(xi-1,yi-1,zi+1,n)]-data[V_I(xi+1,yi+1,zi-1,n)]+data[V_I(xi-1,yi+1,zi-1,n)]+data[V_I(xi+1,yi-1,zi-1,n)]-data[V_I(xi-1,yi-1,zi-1,n)]),
0.125f*(data[V_I(xi+2,yi+1,zi+1,n)]-data[V_I(xi,yi+1,zi+1,n)]-data[V_I(xi+2,yi-1,zi+1,n)]+data[V_I(xi,yi-1,zi+1,n)]-data[V_I(xi+2,yi+1,zi-1,n)]+data[V_I(xi,yi+1,zi-1,n)]+data[V_I(xi+2,yi-1,zi-1,n)]-data[V_I(xi,yi-1,zi-1,n)]),
0.125f*(data[V_I(xi+1,yi+2,zi+1,n)]-data[V_I(xi-1,yi+2,zi+1,n)]-data[V_I(xi+1,yi,zi+1,n)]+data[V_I(xi-1,yi,zi+1,n)]-data[V_I(xi+1,yi+2,zi-1,n)]+data[V_I(xi-1,yi+2,zi-1,n)]+data[V_I(xi+1,yi,zi-1,n)]-data[V_I(xi-1,yi,zi-1,n)]),
0.125f*(data[V_I(xi+2,yi+2,zi+1,n)]-data[V_I(xi,yi+2,zi+1,n)]-data[V_I(xi+2,yi,zi+1,n)]+data[V_I(xi,yi,zi+1,n)]-data[V_I(xi+2,yi+2,zi-1,n)]+data[V_I(xi,yi+2,zi-1,n)]+data[V_I(xi+2,yi,zi-1,n)]-data[V_I(xi,yi,zi-1,n)]),
0.125f*(data[V_I(xi+1,yi+1,zi+2,n)]-data[V_I(xi-1,yi+1,zi+2,n)]-data[V_I(xi+1,yi-1,zi+2,n)]+data[V_I(xi-1,yi-1,zi+2,n)]-data[V_I(xi+1,yi+1,zi,n)]+data[V_I(xi-1,yi+1,zi,n)]+data[V_I(xi+1,yi-1,zi,n)]-data[V_I(xi-1,yi-1,zi,n)]),
0.125f*(data[V_I(xi+2,yi+1,zi+2,n)]-data[V_I(xi,yi+1,zi+2,n)]-data[V_I(xi+2,yi-1,zi+2,n)]+data[V_I(xi,yi-1,zi+2,n)]-data[V_I(xi+2,yi+1,zi,n)]+data[V_I(xi,yi+1,zi,n)]+data[V_I(xi+2,yi-1,zi,n)]-data[V_I(xi,yi-1,zi,n)]),
0.125f*(data[V_I(xi+1,yi+2,zi+2,n)]-data[V_I(xi-1,yi+2,zi+2,n)]-data[V_I(xi+1,yi,zi+2,n)]+data[V_I(xi-1,yi,zi+2,n)]-data[V_I(xi+1,yi+2,zi,n)]+data[V_I(xi-1,yi+2,zi,n)]+data[V_I(xi+1,yi,zi,n)]-data[V_I(xi-1,yi,zi,n)]),
0.125f*(data[V_I(xi+2,yi+2,zi+2,n)]-data[V_I(xi,yi+2,zi+2,n)]-data[V_I(xi+2,yi,zi+2,n)]+data[V_I(xi,yi,zi+2,n)]-data[V_I(xi+2,yi+2,zi,n)]+data[V_I(xi,yi+2,zi,n)]+data[V_I(xi+2,yi,zi,n)]-data[V_I(xi,yi,zi,n)])};
tricubic_get_coeff(a,fval,dfdxval,dfdyval,dfdzval,d2fdxdyval,d2fdxdzval,d2fdydzval,d3fdxdydzval);
}
dx = xx-xi;
dy = yy-yi;
dz = zz-zi;
return tricubic_eval(a,dx,dy,dz);
}

View File

@@ -2505,6 +2505,7 @@ static void lib_link_texture(FileData *fd, Main *main)
tex->ima= newlibadr_us(fd, tex->id.lib, tex->ima);
tex->ipo= newlibadr_us(fd, tex->id.lib, tex->ipo);
if(tex->env) tex->env->object= newlibadr(fd, tex->id.lib, tex->env->object);
if(tex->pd) tex->pd->object= newlibadr(fd, tex->id.lib, tex->pd->object);
if(tex->nodetree)
lib_link_ntree(fd, &tex->id, tex->nodetree);
@@ -2535,6 +2536,17 @@ static void direct_link_texture(FileData *fd, Tex *tex)
tex->env->ok= 0;
}
tex->pd= newdataadr(fd, tex->pd);
if(tex->pd) {
tex->pd->point_tree = NULL;
tex->pd->coba= newdataadr(fd, tex->pd->coba);
}
tex->vd= newdataadr(fd, tex->vd);
if(tex->vd) {
tex->vd->dataset = NULL;
}
tex->nodetree= newdataadr(fd, tex->nodetree);
if(tex->nodetree)
direct_link_nodetree(fd, tex->nodetree);
@@ -7741,6 +7753,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob;
bActionStrip *strip;
/* nla-strips - scale */
for (ob= main->object.first; ob; ob= ob->id.next) {
for (strip= ob->nlastrips.first; strip; strip= strip->next) {
@@ -7763,6 +7776,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ob->soft->shearstiff = 1.0f;
}
}
}
if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 14)) {
@@ -7908,6 +7922,57 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
la->skyblendtype= MA_RAMP_ADD;
la->skyblendfac= 1.0f;
}
}
if (main->versionfile <= 247) {
Material *ma;
Tex *tex;
for(ma=main->mat.first; ma; ma= ma->id.next) {
/* trigger for non-volumetric file */
if (ma->vol_shade_stepsize < 0.0001f) {
ma->vol_shade_stepsize = 0.2f;
ma->vol_stepsize = 0.2f;
ma->vol_absorption = 1.0f;
ma->vol_scattering = 1.0f;
ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f;
}
if (ma->vol_density_scale < 0.0001f)
ma->vol_density_scale = 1.0f;
if (ma->vol_precache_resolution == 0)
ma->vol_precache_resolution = 50;
if (ma->vol_depth_cutoff < 0.0001)
ma->vol_depth_cutoff = 0.05;
}
for(tex=main->tex.first; tex; tex= tex->id.next) {
if (tex->pd == NULL)
tex->pd = BKE_add_pointdensity();
else if (tex->pd->noise_size < 0.0001f) {
tex->pd->noise_size = 0.5f;
tex->pd->noise_depth = 1;
tex->pd->noise_fac = 1.0f;
tex->pd->noise_influence = TEX_PD_NOISE_STATIC;
}
if (tex->pd->falloff_softness < 1.0f)
tex->pd->falloff_softness = 2.0f;
if (tex->pd->coba == NULL) {
tex->pd->coba = add_colorband(1);
tex->pd->speed_scale = 1.0f;
}
if (tex->vd == NULL) {
tex->vd = BKE_add_voxeldata();
} else if (tex->vd->resolX == 0) {
tex->vd->dataset = NULL;
tex->vd->resolX = 1;
tex->vd->resolY = 1;
tex->vd->resolZ = 1;
tex->vd->interp_type= TEX_VD_NEARESTNEIGHBOR;
tex->vd->int_multiplier = 1.0;
}
}
}
/* set the curve radius interpolation to 2.47 default - easy */
@@ -7932,6 +7997,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
/* direction constraint actuators were always local in previous version */
if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 7)) {
bActuator *act;
@@ -8005,6 +8071,26 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 3)) {
Tex *tex;
Material *ma;
/* blend texture extrapolation */
for(tex=main->tex.first; tex; tex= tex->id.next) {
if (tex->type == TEX_BLEND)
tex->extend = TEX_EXTEND;
}
for(ma=main->mat.first; ma; ma= ma->id.next) {
if (ma->vol_shadeflag & 2) { // old MA_VOL_ATTENUATED
ma->vol_shade_type = MA_VOL_SHADE_SINGLE;
ma->vol_ms_diff = 0.5f;
ma->vol_ms_steps = 5;
ma->vol_ms_intensity = 1.0;
}
}
}
if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 2)) {
Scene *sce;

View File

@@ -1335,6 +1335,11 @@ static void write_textures(WriteData *wd, ListBase *idbase)
if(tex->type == TEX_PLUGIN && tex->plugin) writestruct(wd, DATA, "PluginTex", 1, tex->plugin);
if(tex->coba) writestruct(wd, DATA, "ColorBand", 1, tex->coba);
if(tex->type == TEX_ENVMAP && tex->env) writestruct(wd, DATA, "EnvMap", 1, tex->env);
if(tex->pd) {
writestruct(wd, DATA, "PointDensity", 1, tex->pd);
if(tex->pd->coba) writestruct(wd, DATA, "ColorBand", 1, tex->pd->coba);
}
if(tex->vd) writestruct(wd, DATA, "VoxelData", 1, tex->vd);
/* nodetree is integral part of texture, no libdata */
if(tex->nodetree) {

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: GPU_draw.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: GPU_extensions.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: GPU_material.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
#
# $Id$
# $Id: Makefile 19485 2009-03-31 22:34:34Z gsrb3d $
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#

View File

@@ -1,5 +1,5 @@
#
# $Id$
# $Id: Makefile 19485 2009-03-31 22:34:34Z gsrb3d $
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: gpu_codegen.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: gpu_codegen.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: gpu_draw.c 19616 2009-04-09 10:05:17Z campbellbarton $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: gpu_extensions.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: gpu_material.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,7 +1,7 @@
/*
* IMB_jp2.h
*
* $Id$
* $Id: IMB_bmp.h 14444 2008-04-16 22:40:48Z hos $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: BlockDXT.cpp 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: BlockDXT.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: Color.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: ColorBlock.cpp 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: ColorBlock.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: Common.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: DirectDrawSurface.cpp 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: DirectDrawSurface.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: Image.cpp 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: Image.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,7 @@
<<<<<<< .working
#
# $Id$
<<<<<<< .working
# $Id: Makefile 19805 2009-04-20 00:19:16Z genscher $
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
@@ -58,3 +60,68 @@ CPPFLAGS += -I../..
CPPFLAGS += -I..
CPPFLAGS += -I.
CPPFLAGS += -DWITH_DDS
=======
#
# $Id: Makefile 7037 2006-03-12 14:11:23Z ton $
=======
# $Id$
>>>>>>> .merge-right.r19825
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): none yet.
#
# ***** END GPL LICENSE BLOCK *****
#
#
LIBNAME = dds
DIR = $(OCGDIR)/blender/imbuf/dds
SOURCEDIR = source/blender/imbuf/intern/dds
include nan_compile.mk
include nan_definitions.mk
CFLAGS += $(LEVEL_1_C_WARNINGS)
CPPFLAGS += -I$(NAN_JPEG)/include
CPPFLAGS += -I$(NAN_PNG)/include
CPPFLAGS += -I$(NAN_ZLIB)/include
CPPFLAGS += -I$(NAN_TIFF)/include
CPPFLAGS += -I../../../include
CPPFLAGS += -I../../../blenkernel
CPPFLAGS += -I../../../blenlib
CPPFLAGS += -I../../../avi
CPPFLAGS += -I../../../quicktime
# path to the guarded memory allocator
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I$(NAN_MEMUTIL)/include
# This is not really needed, but until /include is cleaned, it must be
# there for proper compilation.
# - No, it is also needed in antialias, for listbase (nzc)
CPPFLAGS += -I../../../makesdna
# external interface of this module
CPPFLAGS += -I../..
CPPFLAGS += -I..
CPPFLAGS += -I.
CPPFLAGS += -DWITH_DDS
>>>>>>> .merge-right.r19804

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: PixelFormat.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: Stream.cpp 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: Stream.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: dds_api.cpp 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: dds_api.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,7 +1,7 @@
/* BIF_editparticle.h
*
*
* $Id$
* $Id: BIF_editparticle.h $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: BIF_meshlaplacian.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/*
* $Id$
* $Id: multires.h 13015 2007-12-27 07:27:03Z nicholasbishop $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: BIF_editaction.h 10519 2007-04-13 11:15:08Z aligorith $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -267,6 +267,8 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
#define B_ENV_FREE_ALL 1357
#define B_TEX_USENODES 1358
#define B_VOXELDATA_LOAD 1359
/* **************** animbuts = object buttons ******* */
#define B_ANIMBUTS 1500

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: DNA_cloth_types.h,v 1.1 2007/08/01 02:28:34 daniel Exp $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -62,6 +62,27 @@ typedef struct Material {
float translucency;
/* end synced with render_types.h */
short material_type; /* solid, halo, volumetric */
short pad5;
/* volumetrics */
short vol_stepsize_type;
short vol_precache_resolution;
float vol_stepsize, vol_shade_stepsize;
float vol_depth_cutoff;
short vol_shade_type;
short vpad;
float vol_density_scale;
float vol_absorption, vol_scattering;
float vol_absorption_col[3];
short vol_shadeflag;
short vol_phasefunc_type;
float vol_phasefunc_g;
float vpad2;
float vol_ms_diff, vol_ms_intensity;
int vol_ms_steps;
float fresnel_mir, fresnel_mir_i;
float fresnel_tra, fresnel_tra_i;
float filter; /* filter added, for raytrace transparency and transmissivity */
@@ -153,6 +174,13 @@ typedef struct Material {
/* flag */
/* for render */
#define MA_IS_USED 1
#define MA_IS_TEXTURED 2
/* material_type */
#define MA_SOLID 0
#define MA_PTHALO 1
#define MA_VOLUME 2
#define MA_VOLUMESOLID 3
/* mode (is int) */
#define MA_TRACEBLE 1
@@ -328,5 +356,30 @@ typedef struct Material {
/* sss_flag */
#define MA_DIFF_SSS 1
/* vol_stepsize_type */
#define MA_VOL_STEP_RANDOMIZED 0
#define MA_VOL_STEP_CONSTANT 1
#define MA_VOL_STEP_ADAPTIVE 2
/* vol_shadeflag */
#define MA_VOL_SHADED 1
#define MA_VOL_RECVSHADOW 4
#define MA_VOL_PRECACHESHADING 8
#define MA_VOL_USEALPHA 16
/* vol_shading_type */
#define MA_VOL_SHADE_NONE 0
#define MA_VOL_SHADE_SINGLE 1
#define MA_VOL_SHADE_MULTIPLE 2
#define MA_VOL_SHADE_SINGLEPLUSMULTIPLE 3
/* vol_phasefunc_type */
#define MA_VOL_PH_ISOTROPIC 0
#define MA_VOL_PH_MIEHAZY 1
#define MA_VOL_PH_MIEMURKY 2
#define MA_VOL_PH_RAYLEIGH 3
#define MA_VOL_PH_HG 4
#define MA_VOL_PH_SCHLICK 5
#endif

View File

@@ -210,6 +210,7 @@ typedef struct SoftBody {
#define PFIELD_HARMONIC 7
#define PFIELD_CHARGE 8
#define PFIELD_LENNARDJ 9
#define PFIELD_SPIN 10
/* pd->flag: various settings */

View File

@@ -1,7 +1,8 @@
/* DNA_particle_types.h
*
*
* $Id$
<<<<<<< .working
* $Id: DNA_particle_types.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -127,6 +127,55 @@ typedef struct EnvMap {
short recalc, lastsize;
} EnvMap;
typedef struct PointDensity {
short flag;
short falloff_type;
float falloff_softness;
float radius;
short source;
short color_source;
int totpoints;
int pdpad;
struct Object *object; /* for 'Object' or 'Particle system' type - source object */
short psys_cache_space; /* cache points in worldspace, object space, ... ? */
short psysindex; /* for 'Particle system' type - object's psys number */
short ob_cache_space; /* cache points in worldspace, object space, ... ? */
short pdpad2;
void *point_tree; /* the acceleration tree containing points */
float *point_data; /* dynamically allocated extra for extra information, like particle age */
float noise_size;
short noise_depth;
short noise_influence;
short noise_basis;
short pdpad3[3];
float noise_fac;
float speed_scale;
struct ColorBand *coba; /* for time -> color */
} PointDensity;
typedef struct VoxelData {
int resolX, resolY, resolZ;
int interp_type;
short file_format;
short flag;
float int_multiplier;
int still, still_frame;
char source_path[240];
float *dataset;
} VoxelData;
typedef struct Tex {
ID id;
@@ -173,6 +222,8 @@ typedef struct Tex {
struct ColorBand *coba;
struct EnvMap *env;
struct PreviewImage * preview;
struct PointDensity *pd;
struct VoxelData *vd;
char use_nodes;
char pad[7];
@@ -212,6 +263,9 @@ typedef struct TexMapping {
#define TEX_MUSGRAVE 11
#define TEX_VORONOI 12
#define TEX_DISTNOISE 13
/* predicting ocean texture for 14 */
#define TEX_POINTDENSITY 15
#define TEX_VOXELDATA 16
/* musgrave stype */
#define TEX_MFRACTAL 0
@@ -389,5 +443,58 @@ typedef struct TexMapping {
#define ENV_NORMAL 1
#define ENV_OSA 2
/* **************** PointDensity ********************* */
/* source */
#define TEX_PD_PSYS 0
#define TEX_PD_OBJECT 1
#define TEX_PD_FILE 2
/* falloff_type */
#define TEX_PD_FALLOFF_STD 0
#define TEX_PD_FALLOFF_SMOOTH 1
#define TEX_PD_FALLOFF_SOFT 2
#define TEX_PD_FALLOFF_CONSTANT 3
#define TEX_PD_FALLOFF_ROOT 4
/* psys_cache_space */
#define TEX_PD_OBJECTLOC 0
#define TEX_PD_OBJECTSPACE 1
#define TEX_PD_WORLDSPACE 2
/* flag */
#define TEX_PD_TURBULENCE 1
/* noise_influence */
#define TEX_PD_NOISE_STATIC 0
#define TEX_PD_NOISE_VEL 1
#define TEX_PD_NOISE_AGE 2
#define TEX_PD_NOISE_TIME 3
/* color_source */
#define TEX_PD_COLOR_CONSTANT 0
#define TEX_PD_COLOR_PARTAGE 1
#define TEX_PD_COLOR_PARTSPEED 2
#define TEX_PD_COLOR_PARTVEL 3
#define POINT_DATA_VEL 1
#define POINT_DATA_LIFE 2
/******************** Voxel Data *****************************/
/* flag */
/* interpolation */
#define TEX_VD_NEARESTNEIGHBOR 0
#define TEX_VD_LINEAR 1
#define TEX_VD_TRICUBIC 2
/* file format */
#define TEX_VD_BLENDERVOXEL 0
#define TEX_VD_RAW_8BIT 1
#define TEX_VD_RAW_16BIT 2
#define TEX_VD_IMAGE_SEQUENCE 3
#endif

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: TEX_node.h 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: CMP_normalize.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: CMP_premulkey.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: SHD_invert.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
#
# $Id$
# $Id: Makefile 19485 2009-03-31 22:34:34Z gsrb3d $
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: TEX_image.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: TEX_valToRgb.c 19485 2009-03-31 22:34:34Z gsrb3d $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -1,3 +1,4 @@
<<<<<<< .working
# Blender.Object module and the Object PyType object
"""
@@ -40,6 +41,7 @@ This module provides access to the B{Particle} in Blender.
- LINE: Draw as lines
- PATH: Draw pathes
- OBJECT: Draw object
<<<<<<< .working
- GROUP: Draw group
- BILLBOARD: Draw as billboard
@type CHILDTYPE: readonly dictionary
@@ -250,3 +252,260 @@ class Particle:
@rtype: list of floats
@return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled.
"""
=======
# Blender.Object module and the Object PyType object
"""
The Blender.Particle submodule
Particle
========
This module provides access to the B{Particle} in Blender.
@type TYPE: readonly dictionary
@var TYPE: Constant dict used for with L{Particle.TYPE}
- HAIR: set particle system to hair mode.
- REACTOR: set particle system to reactor mode.
- EMITTER: set particle system to emitter mode.
@type DISTRIBUTION: readonly dictionary
@var DISTRIBUTION: Constant dict used for with L{Particle.DISTRIBUTION}
- GRID: set grid distribution.
- RANDOM: set random distribution.
- JITTERED: set jittered distribution.
@type EMITFROM: readonly dictionary
@var EMITFROM: Constant dict used for with L{Particle.EMITFROM}
- VERTS: set particles emit from vertices
- FACES: set particles emit from faces
- VOLUME: set particles emit from volume
- PARTICLE: set particles emit from particles
@type REACTON: readonly dictionary
@var REACTON: Constant dict used for with L{Particle.REACTON}
- NEAR: react on near
- COLLISION: react on collision
- DEATH: react on death
@type DRAWAS: readonly dictionary
@var DRAWAS: Constant dict used for with L{Particle.DRAWAS}
- NONE: Don't draw
- POINT: Draw as point
- CIRCLE: Draw as circles
- CROSS: Draw as crosses
- AXIS: Draw as axis
- LINE: Draw as lines
- PATH: Draw pathes
- OBJECT: Draw object
- GROUP: Draw goup
=======
- GROUP: Draw group
>>>>>>> .merge-right.r19825
- BILLBOARD: Draw as billboard
@type CHILDTYPE: readonly dictionary
@var CHILDTYPE: Constant dict used for whith L{Particle.CHILDTYPE}
- NONE: set no children
- PARTICLES: set children born from particles
- FACES: set children born from faces
@type CHILDKINK: readonly dictionary
@var CHILDKINK: Type of periodic offset on the path
- NOTHING: set no offset on the path
- CURL: set curl offset on the path
- RADIAL: set radial offset on the path
- WAVE: set wave offset on the path
- BRAID: set braid offset on the path
@type CHILDKINKAXIS: readonly dictionary
@var CHILDKINKAXIS: Which axis to use for offset
- X: set X axis for offset
- Y: set Y axis for offset
- Z: set Z axis for offset
"""
class Particle:
"""
The Particle object
===================
This object gives access to paticles data.
@ivar seed: Set an offset in the random table.
@type seed: int
@ivar type: Type of particle system ( Particle.TYPE[ 'HAIR' | 'REACTOR' | 'EMITTER' ] ).
@type type: int
@ivar resolutionGrid: The resolution of the particle grid.
@type resolutionGrid: int
@ivar startFrame: Frame number to start emitting particles.
@type startFrame: float
@ivar endFrame: Frame number to stop emitting particles.
@type endFrame: float
@ivar editable: Finalize hair to enable editing in particle mode.
@type editable: int
@ivar amount: The total number of particles.
@type amount: int
@ivar multireact: React multiple times ( Particle.REACTON[ 'NEAR' | 'COLLISION' | 'DEATH' ] ).
@type multireact: int
@ivar reactshape: Power of reaction strength, dependent on distance to target.
@type reactshape: float
@ivar hairSegments: Amount of hair segments.
@type hairSegments: int
@ivar lifetime: Specify the life span of the particles.
@type lifetime: float
@ivar randlife: Give the particle life a random variation.
@type randlife: float
@ivar randemission: Emit particles in random order.
@type randemission: int
@ivar particleDistribution: Where to emit particles from ( Particle.EMITFROM[ 'PARTICLE' | 'VOLUME' | 'FACES' | 'VERTS' ] )
@type particleDistribution: int
@ivar evenDistribution: Use even distribution from faces based on face areas or edge lengths.
@type evenDistribution: int
@ivar distribution: How to distribute particles on selected element ( Particle.DISTRIBUTION[ 'GRID' | 'RANDOM' | 'JITTERED' ] ).
@type distribution: int
@ivar jitterAmount: Amount of jitter applied to the sampling.
@type jitterAmount: float
@ivar pf: Emission locations / face (0 = automatic).
@type pf:int
@ivar invert: Invert what is considered object and what is not.
@type invert: int
@ivar targetObject: The object that has the target particle system (empty if same object).
@type targetObject: Blender object
@ivar targetpsys: The target particle system number in the object.
@type targetpsys: int
@ivar 2d: Constrain boids to a surface.
@type 2d: float
@ivar maxvel: Maximum velocity.
@type maxvel: float
@ivar avvel: The usual speed % of max velocity.
@type avvel: float
@ivar latacc: Lateral acceleration % of max velocity
@type latacc: float
@ivar tanacc: Tangential acceleration % of max velocity
@type tanacc: float
@ivar groundz: Default Z value.
@type groundz: float
@ivar object: Constrain boids to object's surface.
@type object: Blender Object
@ivar renderEmitter: Render emitter object.
@type renderEmitter: int
@ivar displayPercentage: Particle display percentage.
@type displayPercentage: int
@ivar hairDisplayStep: How many steps paths are drawn with (power of 2) in visu mode.
@type hairDisplayStep: int
@ivar hairRenderStep: How many steps paths are rendered with (power of 2) in render mode."
@type hairRenderStep: int
@ivar duplicateObject: Get the duplicate object.
@type duplicateObject: Blender Object
@ivar drawAs: Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ]).
@type drawAs: int
@ivar childAmount: The total number of children
@type childAmount: int
@ivar childType: Type of childrens ( Particle.CHILDTYPE[ 'FACES' | 'PARTICLES' | 'NONE' ] )
@type childType: int
@ivar childRenderAmount: Amount of children/parent for rendering
@type childRenderAmount: int
@ivar childRadius: Radius of children around parent
@type childRadius: float
@ivar childRound: Roundness of children around parent
@type childRound: float
@ivar childClump: Amount of clumpimg
@type childClump: float
@ivar childShape: Shape of clumpimg
@type childShape: float
@ivar childSize: A multiplier for the child particle size
@type childSize: float
@ivar childRand: Random variation to the size of the child particles
@type childRand: float
@ivar childRough1: Amount of location dependant rough
@type childRough1: float
@ivar childRough1Size: Size of location dependant rough
@type childRough1Size: float
@ivar childRough2: Amount of random rough
@type childRough2: float
@ivar childRough2Size: Size of random rough
@type childRough2Size: float
@ivar childRough2Thresh: Amount of particles left untouched by random rough
@type childRough2Thresh: float
@ivar childRoughE: Amount of end point rough
@type childRoughE: float
@ivar childRoughEShape: Shape of end point rough
@type childRoughEShape: float
@ivar childKink: Type of periodic offset on the path (Particle.CHILDKINK[ 'BRAID' | 'WAVE' | 'RADIAL' | 'CURL' | 'NOTHING' ])
@type childKink: int
@ivar childKinkAxis: Which axis to use for offset (Particle.CHILDKINKAXIS[ 'Z' | 'Y' | 'X' ])
@type childKinkAxis: int
@ivar childKinkFreq: The frequency of the offset (1/total length)
@type childKinkFreq: float
@ivar childKinkShape: Adjust the offset to the beginning/end
@type childKinkShape: float
@ivar childKinkAmp: The amplitude of the offset
@type childKinkAmp: float
@ivar childBranch: Branch child paths from eachother
@type childBranch: int
@ivar childBranch: Animate branching
@type childBranch: int
@ivar childBranch: Start and end points are the same
@type childBranch: int
@ivar childBranch: Threshold of branching
@type childBranch: float
"""
def freeEdit():
"""
Free edit mode.
@return: None
"""
def getLoc(all=0,id=0):
"""
Get the particles locations.
A list of tuple is returned in particle mode.
A list of list of tuple is returned in hair mode.
The tuple is a vector of 3 or 4 floats in world space (x,y,z, optionally the particle's id).
@type all: int
@param all: if not 0 export all particles (uninitialized (unborn or died)particles exported as None).
@type id: int
@param id: add the particle id in the end of the vector tuple
@rtype: list of vectors (tuple of 3 floats and optionally the id) or list of list of vectors
@return: list of vectors or list of list of vectors (hair mode) or None if system is disabled
"""
def getRot(all=0,id=0):
"""
Get the particles' rotations as quaternion.
A list of tuple is returned in particle mode.
The tuple is vector of 4 or 5 floats (x,y,z,w, optionally the id of the particle).
@type all: int
@param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
@type id: int
@param id: add the particle id in the return tuple
@rtype: list of tuple of 4 or 5 elements (if id is not zero)
@return: list of 4-tuples or None if system is disabled
"""
def getMat():
"""
Get the particles' material.
@rtype: Blender Material
@return: The material assigned to particles
"""
def getSize(all=0,id=0):
"""
Get the particles' size.
A list of float or list of tuple (particle's size,particle's id).
@type all: int
@param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
@type id: int
@param id: add the particle id in the return tuple
@rtype: list of floats
@return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled.
"""
def getAge(all=0,id=0):
"""
Get the particles' age.
A list of float or list of tuple (particle's age, particle's id).
@type all: int
@param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None).
@type id: int
@param id: add the particle id in the return tuple
@rtype: list of floats
@return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled.
"""
>>>>>>> .merge-right.r19804

0
source/blender/python/api2_2x/doc/epy_docgen.sh Executable file → Normal file
View File

View File

@@ -1,5 +1,5 @@
/**
* $Id$
* $Id: RE_raytrace.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -113,7 +113,7 @@ typedef struct ShadeInput
/* internal face coordinates */
float u, v, dx_u, dx_v, dy_u, dy_v;
float co[3], view[3];
float co[3], view[3], camera_co[3];
/* copy from material, keep synced so we can do memcopy */
/* current size: 23*4 */
@@ -161,6 +161,7 @@ typedef struct ShadeInput
int samplenr; /* sample counter, to detect if we should do shadow again */
int depth; /* 1 or larger on raytrace shading */
int volume_depth; /* number of intersections through volumes */
/* stored copy of original face normal (facenor)
* before flipping. Used in Front/back output on geometry node */

View File

@@ -1,5 +1,5 @@
/*
* $Id$
* $Id: occlusion.h 19805 2009-04-20 00:19:16Z genscher $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*

View File

@@ -0,0 +1,44 @@
/*
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Matt Ebb
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef POINTDENSITY_H
#define POINTDENSITY_H
/**
* Make point density kd-trees for all point density textures in the scene
*/
struct Render;
struct TexResult;
void make_pointdensities(struct Render *re);
void free_pointdensities(struct Render *re);
int pointdensitytex(struct Tex *tex, float *texvec, struct TexResult *texres);
#endif /* POINTDENSITY_H */

View File

@@ -202,6 +202,10 @@ struct Render
struct Object *excludeob;
ListBase render_volumes_inside;
ListBase volumes;
ListBase volume_precache_parts;
/* arena for allocating data for use during render, for
* example dynamic TFaces to go in the VlakRen structure.
*/
@@ -286,6 +290,8 @@ typedef struct ObjectInstanceRen {
float dupliorco[3], dupliuv[2];
float (*duplitexmat)[4];
struct VolumePrecache *volume_precache;
float *vectors;
int totvector;
} ObjectInstanceRen;
@@ -345,6 +351,7 @@ typedef struct HaloRen
struct Material *mat;
} HaloRen;
/* ------------------------------------------------------------------------- */
typedef struct StrandVert {
@@ -395,6 +402,45 @@ typedef struct StrandRen {
float orco[3];
} StrandRen;
/* ------------------------------------------------------------------------- */
typedef struct VolumeOb
{
struct VolumeOb *next, *prev;
struct Material *ma;
struct ObjectRen *obr;
} VolumeOb;
typedef struct MatInside {
struct MatInside *next, *prev;
struct Material *ma;
} MatInside;
typedef struct VolPrecachePart
{
struct VolPrecachePart *next, *prev;
struct RayTree *tree;
struct ShadeInput *shi;
struct ObjectInstanceRen *obi;
int num;
int minx, maxx;
int miny, maxy;
int minz, maxz;
int res[3];
float bbmin[3];
float voxel[3];
int working, done;
} VolPrecachePart;
typedef struct VolumePrecache
{
int res[3];
float *data_r;
float *data_g;
float *data_b;
} VolumePrecache;
/* ------------------------------------------------------------------------- */
struct LampRen;
struct MTex;

View File

@@ -48,6 +48,7 @@ struct RenderPart;
struct RenderLayer;
struct ObjectRen;
struct ListBase;
struct Isect;
/* ------------------------------------------------------------------------- */
@@ -98,6 +99,7 @@ extern void makeraytree(Render *re);
extern void ray_shadow(ShadeInput *, LampRen *, float *);
extern void ray_trace(ShadeInput *, ShadeResult *);
extern void ray_trace_shadow_tra(struct Isect *is, int depth, int traflag);
extern void ray_ao(ShadeInput *, float *);
extern void init_jitter_plane(LampRen *lar);
extern void init_ao_sphere(struct World *wrld);

View File

@@ -33,6 +33,7 @@ struct VlakRen;
struct StrandSegment;
struct StrandPoint;
struct ObjectInstanceRen obi;
struct Isect;
/* shadeinput.c */
@@ -52,6 +53,7 @@ typedef struct ShadeSample {
/* also the node shader callback */
void shade_material_loop(struct ShadeInput *shi, struct ShadeResult *shr);
void shade_volume_loop(struct ShadeInput *shi, struct ShadeResult *shr);
void shade_input_set_triangle_i(struct ShadeInput *shi, struct ObjectInstanceRen *obi, struct VlakRen *vlr, short i1, short i2, short i3);
void shade_input_set_triangle(struct ShadeInput *shi, volatile int obi, volatile int facenr, int normal_flip);
@@ -86,7 +88,11 @@ void shade_color(struct ShadeInput *shi, ShadeResult *shr);
void ambient_occlusion_to_diffuse(struct ShadeInput *shi, float *diff);
void ambient_occlusion(struct ShadeInput *shi);
ListBase *get_lights(struct ShadeInput *shi);
float lamp_get_visibility(struct LampRen *lar, float *co, float *lv, float *dist);
void lamp_get_shadow(struct LampRen *lar, ShadeInput *shi, float inp, float *shadfac, int do_real);
float fresnel_fac(float *view, float *vn, float fresnel, float fac);
/* rayshade.c */
extern void shade_ray(struct Isect *is, struct ShadeInput *shi, struct ShadeResult *shr);

Some files were not shown because too many files have changed in this diff Show More