Blender V2.61 - r43446
|
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_voxel.h"
#include "BLI_utildefines.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "smoke_API.h"
#include "DNA_texture_types.h"
#include "DNA_object_force.h"
#include "DNA_object_types.h"
#include "DNA_modifier_types.h"
#include "DNA_smoke_types.h"
#include "render_types.h"
#include "renderdatabase.h"
#include "texture.h"
#include "voxeldata.h"
Go to the source code of this file.
Functions | |
static int | is_vd_res_ok (VoxelData *vd) |
static size_t | vd_resol_size (VoxelData *vd) |
static int | load_frame_blendervoxel (VoxelData *vd, FILE *fp, int frame) |
static int | load_frame_raw8 (VoxelData *vd, FILE *fp, int frame) |
static void | load_frame_image_sequence (VoxelData *vd, Tex *tex) |
static int | read_voxeldata_header (FILE *fp, struct VoxelData *vd) |
static void | init_frame_smoke (VoxelData *vd, float cfra) |
void | cache_voxeldata (Tex *tex, int scene_frame) |
void | make_voxeldata (struct Render *re) |
int | voxeldatatex (struct Tex *tex, const float texvec[3], struct TexResult *texres) |
Definition in file voxeldata.c.
void cache_voxeldata | ( | Tex * | tex, |
int | scene_frame | ||
) |
Definition at line 312 of file voxeldata.c.
References BLI_exists(), BLI_path_abs(), BLI_strncpy(), VoxelData::cachedframe, VoxelData::dataset, VoxelData::file_format, VoxelData::flag, G, init_frame_smoke(), load_frame_blendervoxel(), load_frame_image_sequence(), load_frame_raw8(), MEM_freeN(), NULL, VoxelData::ok, read_voxeldata_header(), VoxelData::source_path, VoxelData::still_frame, TEX_VD_BLENDERVOXEL, TEX_VD_IMAGE_SEQUENCE, TEX_VD_RAW_8BIT, TEX_VD_SMOKE, TEX_VD_STILL, and Tex::vd.
Referenced by make_voxeldata(), and RE_init_sample_material().
static void init_frame_smoke | ( | VoxelData * | vd, |
float | cfra | ||
) | [static] |
Definition at line 220 of file voxeldata.c.
References copy_v3_v3_int(), VoxelData::dataset, SmokeModifierData::domain, eModifierType_Smoke, SmokeDomainSettings::flags, SmokeDomainSettings::fluid, i, MEM_mapallocN(), MOD_SMOKE_HIGHRES, modifiers_findByType(), NULL, VoxelData::object, VoxelData::ok, SmokeDomainSettings::res, VoxelData::resol, smoke_get_density(), smoke_get_heat(), smoke_get_velocity_x(), smoke_get_velocity_y(), smoke_get_velocity_z(), smoke_turbulence_get_density(), smoke_turbulence_get_res(), VoxelData::smoked_type, sqrt(), TEX_VD_SMOKEHEAT, TEX_VD_SMOKEVEL, vd_resol_size(), and SmokeDomainSettings::wt.
Referenced by cache_voxeldata().
static int is_vd_res_ok | ( | VoxelData * | vd | ) | [static] |
Definition at line 66 of file voxeldata.c.
References max, min, and VoxelData::resol.
Referenced by load_frame_blendervoxel(), and load_frame_raw8().
static int load_frame_blendervoxel | ( | VoxelData * | vd, |
FILE * | fp, | ||
int | frame | ||
) | [static] |
Definition at line 81 of file voxeldata.c.
References VoxelData::cachedframe, VoxelData::dataset, FALSE, is_vd_res_ok(), MEM_mapallocN(), NULL, VoxelData::ok, size(), and vd_resol_size().
Referenced by cache_voxeldata().
Definition at line 143 of file voxeldata.c.
References BKE_image_free_anim_ibufs(), BKE_image_get_ibuf(), VoxelData::dataset, VoxelData::flag, ImageUser::framenr, ImageUser::frames, Tex::ima, IMA_SRC_SEQUENCE, IMB_float_from_rect(), Tex::iuser, MEM_mapallocN(), ImageUser::offset, VoxelData::ok, ImBuf::rect_float, VoxelData::resol, Image::source, TEX_VD_STILL, V_I, vd_resol_size(), ImBuf::x, ImBuf::y, and ShadeResult::z.
Referenced by cache_voxeldata().
static int load_frame_raw8 | ( | VoxelData * | vd, |
FILE * | fp, | ||
int | frame | ||
) | [static] |
Definition at line 102 of file voxeldata.c.
References VoxelData::cachedframe, VoxelData::dataset, FALSE, i, is_vd_res_ok(), MEM_freeN(), MEM_mallocN(), MEM_mapallocN(), NULL, VoxelData::ok, size(), and vd_resol_size().
Referenced by cache_voxeldata().
void make_voxeldata | ( | struct Render * | re | ) |
Definition at line 366 of file voxeldata.c.
References cache_voxeldata(), RenderData::cfra, ListBase::first, Render::i, Tex::id, RenderStats::infostr, Render::main, ID::next, NULL, Render::r, Render::sdh, Render::stats_draw, Main::tex, TEX_VOXELDATA, Tex::type, and ID::us.
Referenced by RE_Database_Baking(), and RE_Database_FromScene().
static int read_voxeldata_header | ( | FILE * | fp, |
struct VoxelData * | vd | ||
) | [static] |
Definition at line 202 of file voxeldata.c.
References MEM_freeN(), MEM_mallocN(), VoxelData::resol, VoxelDataHeader::resolX, VoxelDataHeader::resolY, and VoxelDataHeader::resolZ.
Referenced by cache_voxeldata().
static size_t vd_resol_size | ( | VoxelData * | vd | ) | [static] |
Definition at line 76 of file voxeldata.c.
References VoxelData::resol.
Referenced by init_frame_smoke(), load_frame_blendervoxel(), load_frame_image_sequence(), and load_frame_raw8().
Definition at line 385 of file voxeldata.c.
References add_v3_v3(), BRICONT, BRICONTRGB, CLAMP(), co, copy_v3_v3(), VoxelData::dataset, VoxelData::extend, floorf, VoxelData::int_multiplier, VoxelData::interp_type, mul_v3_fl(), NULL, VoxelData::resol, TexResult::ta, TexResult::tb, TEX_CLIP, TEX_EXTEND, TEX_INT, TEX_REPEAT, TEX_VD_LINEAR, TEX_VD_NEARESTNEIGHBOR, TEX_VD_QUADRATIC, TEX_VD_TRICUBIC_BSPLINE, TEX_VD_TRICUBIC_CATROM, TexResult::tg, TexResult::tin, TexResult::tr, Tex::vd, voxel_sample_nearest(), voxel_sample_tricubic(), voxel_sample_trilinear(), and voxel_sample_triquadratic().
Referenced by multitex().