Blender
V3.3
|
#include "RE_pipeline.h"
Go to the source code of this file.
Classes | |
struct | BakeImage |
struct | BakeTargets |
struct | BakePixel |
struct | BakeHighPolyData |
Typedefs | |
typedef struct BakeImage | BakeImage |
typedef struct BakeTargets | BakeTargets |
typedef struct BakePixel | BakePixel |
typedef struct BakeHighPolyData | BakeHighPolyData |
Functions | |
bool | RE_bake_has_engine (const struct Render *re) |
bool | RE_bake_engine (struct Render *re, struct Depsgraph *depsgraph, struct Object *object, int object_id, const BakePixel pixel_array[], const BakeTargets *targets, eScenePassType pass_type, int pass_filter, float result[]) |
int | RE_pass_depth (eScenePassType pass_type) |
bool | RE_bake_pixels_populate_from_objects (struct Mesh *me_low, BakePixel pixel_array_from[], BakePixel pixel_array_to[], BakeHighPolyData highpoly[], int tot_highpoly, size_t pixels_num, bool is_custom_cage, float cage_extrusion, float max_ray_distance, float mat_low[4][4], float mat_cage[4][4], struct Mesh *me_cage) |
void | RE_bake_pixels_populate (struct Mesh *me, struct BakePixel *pixel_array, size_t pixels_num, const struct BakeTargets *targets, const char *uv_layer) |
void | RE_bake_mask_fill (const BakePixel pixel_array[], size_t pixels_num, char *mask) |
void | RE_bake_margin (struct ImBuf *ibuf, char *mask, int margin, char margin_type, struct Mesh const *me, char const *uv_layer, const float uv_offset[2]) |
void | RE_bake_normal_world_to_object (const BakePixel pixel_array[], size_t pixels_num, int depth, float result[], struct Object *ob, const eBakeNormalSwizzle normal_swizzle[3]) |
void | RE_bake_normal_world_to_tangent (const BakePixel pixel_array[], size_t pixels_num, int depth, float result[], struct Mesh *me, const eBakeNormalSwizzle normal_swizzle[3], float mat[4][4]) |
void | RE_bake_normal_world_to_world (const BakePixel pixel_array[], size_t pixels_num, int depth, float result[], const eBakeNormalSwizzle normal_swizzle[3]) |
void | RE_bake_ibuf_clear (struct Image *image, bool is_tangent) |
typedef struct BakeHighPolyData BakeHighPolyData |
typedef struct BakeTargets BakeTargets |
bool RE_bake_engine | ( | struct Render * | re, |
struct Depsgraph * | depsgraph, | ||
struct Object * | object, | ||
int | object_id, | ||
const BakePixel | pixel_array[], | ||
const BakeTargets * | targets, | ||
eScenePassType | pass_type, | ||
int | pass_filter, | ||
float | result[] | ||
) |
Definition at line 819 of file engine.c.
References RenderEngine::bake, BKE_reports_contain(), BLI_strncpy(), RenderData::cfra, RenderStats::cfra, depsgraph, RenderEngine::depsgraph, RenderData::engine, Render::engine, engine_depsgraph_free(), RenderEngine::flag, G, Render::i, Scene::id, image(), RenderEngine::image_id, BakeTargets::images, BakeTargets::images_num, Render::main, ID::name, NULL, RenderEngine::object_id, RenderEngine::pixels, Scene::r, Render::r, RenderEngine::re, RE_engine_create(), RE_engine_free(), RE_ENGINE_RENDERING, RE_engines_find(), Render::reports, RenderEngine::resolution_x, RenderEngine::resolution_y, result, RenderEngine::result, RPT_ERROR, Render::scene, RenderStats::scene_name, RenderEngine::targets, type, Render::winx, and Render::winy.
Referenced by bake().
Definition at line 1012 of file bake.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BLI_assert, image(), IMB_rectfill(), lock, NULL, ImBuf::planes, and R_IMF_PLANES_RGBA.
Referenced by bake_targets_clear().
void RE_bake_margin | ( | struct ImBuf * | ibuf, |
char * | mask, | ||
int | margin, | ||
char | margin_type, | ||
struct Mesh const * | me, | ||
char const * | uv_layer, | ||
const float | uv_offset[2] | ||
) |
Definition at line 129 of file bake.c.
References FILTER_MASK_USED, and mask().
Referenced by write_external_bake_pixels(), and write_internal_bake_pixels().
void RE_bake_normal_world_to_object | ( | const BakePixel | pixel_array[], |
size_t | pixels_num, | ||
int | depth, | ||
float | result[], | ||
struct Object * | ob, | ||
const eBakeNormalSwizzle | normal_swizzle[3] | ||
) |
Definition at line 956 of file bake.c.
References copy_v3_v3(), invert_m4_m4(), mul_mat3_m4_v3(), nor, normal_compress(), normalize_v3(), Object::obmat, offset, and result.
Referenced by bake().
void RE_bake_normal_world_to_tangent | ( | const BakePixel | pixel_array[], |
size_t | pixels_num, | ||
int | depth, | ||
float | result[], | ||
struct Mesh * | me, | ||
const eBakeNormalSwizzle | normal_swizzle[3], | ||
float | mat[4][4] | ||
) |
This function converts an object space normal map to a tangent space normal map for a given low poly mesh.
Definition at line 831 of file bake.c.
References BKE_id_free(), BKE_mesh_copy_for_eval(), BLI_assert, copy_v3_fl3(), copy_v3_v3(), copy_v4_fl4(), cross_v3_v3v3(), interp_barycentric_tri_v3(), invert_m3_m3(), TriTessFace::is_smooth, TriTessFace::loop_normal, MEM_freeN, mesh_calc_tri_tessface(), mul_m3_v3(), mul_transposed_mat3_m4_v3(), mul_v3_fl(), nor, normal, TriTessFace::normal, normal_compress(), normalize_v3(), normals, NULL, offset, BakePixel::primitive_id, result, KDL::sign(), TSpace::sign, TSpace::tangent, tangents, TriTessFace::tspace, BakePixel::uv, v, TriTessFace::vert_normals, and w().
Referenced by bake().
void RE_bake_normal_world_to_world | ( | const BakePixel | pixel_array[], |
size_t | pixels_num, | ||
int | depth, | ||
float | result[], | ||
const eBakeNormalSwizzle | normal_swizzle[3] | ||
) |
Definition at line 988 of file bake.c.
References copy_v3_v3(), nor, normal_compress(), offset, and result.
Referenced by bake().
void RE_bake_pixels_populate | ( | struct Mesh * | me, |
struct BakePixel * | pixel_array, | ||
size_t | pixels_num, | ||
const struct BakeTargets * | targets, | ||
const char * | uv_layer | ||
) |
bool RE_bake_pixels_populate_from_objects | ( | struct Mesh * | me_low, |
BakePixel | pixel_array_from[], | ||
BakePixel | pixel_array_to[], | ||
BakeHighPolyData | highpoly[], | ||
int | tot_highpoly, | ||
size_t | pixels_num, | ||
bool | is_custom_cage, | ||
float | cage_extrusion, | ||
float | max_ray_distance, | ||
float | mat_low[4][4], | ||
float | mat_cage[4][4], | ||
struct Mesh * | me_cage | ||
) |
Definition at line 535 of file bake.c.
References BKE_bvhtree_from_mesh_get(), BKE_id_free(), BKE_mesh_copy_for_eval(), BKE_mesh_runtime_looptri_ensure(), BVHTREE_FROM_LOOPTRI, calc_point_from_barycentric_cage(), calc_point_from_barycentric_extrusion(), cast_ray_highpoly(), free_bvhtree_from_mesh(), invert_m4_m4(), BakeHighPolyData::me, MEM_callocN, MEM_freeN, MEM_mallocN, mesh_calc_tri_tessface(), NULL, BakePixel::primitive_id, result, tree, BakePixel::uv, and v.
Referenced by bake().
int RE_pass_depth | ( | eScenePassType | pass_type | ) |
Definition at line 1037 of file bake.c.
References SCE_PASS_AO, SCE_PASS_COMBINED, SCE_PASS_DIFFUSE_COLOR, SCE_PASS_DIFFUSE_DIRECT, SCE_PASS_DIFFUSE_INDIRECT, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT, SCE_PASS_GLOSSY_COLOR, SCE_PASS_GLOSSY_DIRECT, SCE_PASS_GLOSSY_INDIRECT, SCE_PASS_INDEXMA, SCE_PASS_INDEXOB, SCE_PASS_MIST, SCE_PASS_NORMAL, SCE_PASS_POSITION, SCE_PASS_SHADOW, SCE_PASS_SUBSURFACE_COLOR, SCE_PASS_SUBSURFACE_DIRECT, SCE_PASS_SUBSURFACE_INDIRECT, SCE_PASS_TRANSM_COLOR, SCE_PASS_TRANSM_DIRECT, SCE_PASS_TRANSM_INDIRECT, SCE_PASS_UV, SCE_PASS_VECTOR, and SCE_PASS_Z.
Referenced by bake_targets_init().