81 if (
type->rna_ext.free) {
82 type->rna_ext.free(
type->rna_ext.data);
151 if (use_gpu_context) {
158 if (use_gpu_context) {
182 RenderEngine *engine,
int x,
int y,
int w,
int h,
const char *layername)
189 if (
image->render_layer_name[0] ==
'\0') {
215 rr, rl, 4,
"BakeDifferential",
"",
"RGBA",
true);
218 for (
int ty = 0; ty < h; ty++) {
220 float *primitive = primitive_pass->
rect +
offset;
223 size_t bake_offset = (
y + ty) *
image->width +
x;
224 const BakePixel *bake_pixel = pixels + bake_offset;
226 for (
int tx = 0; tx <
w; tx++) {
234 primitive[2] = bake_pixel->uv[0];
235 primitive[3] = bake_pixel->uv[1];
274 const size_t channels_size = channels_num *
sizeof(
float);
284 for (
int ty = 0; ty < h; ty++) {
286 const size_t bake_offset = (
y + ty) *
image->width +
x;
288 const float *pass_rect = rpass->
rect +
offset * channels_num;
289 const BakePixel *bake_pixel = pixels + bake_offset;
290 float *bake_result =
result + bake_offset * channels_num;
292 for (
int tx = 0; tx <
w; tx++) {
294 memcpy(bake_result, pass_rect, channels_size);
296 pass_rect += channels_num;
297 bake_result += channels_num;
334 **tile_in_set = *
tile;
345 RenderEngine *engine,
int x,
int y,
int w,
int h,
const char *layername,
const char *viewname)
374 disprect.
ymax =
y + h;
428 const char *layername)
449 if (!cancel || merge_results) {
463 if (!cancel || merge_results) {
515 engine->
text[0] =
'\0';
517 if (stats && stats[0] && info && info[0]) {
520 else if (info && info[0]) {
523 else if (stats && stats[0]) {
533 CLAMP(progress, 0.0f, 1.0f);
613 if (use_spherical_stereo || re ==
NULL) {
622 bool use_spherical_stereo,
623 float r_modelmat[16])
628 if (use_spherical_stereo || re ==
NULL) {
652 *r_needs_free =
false;
661 if (total_tiles >= allocation_size) {
665 allocation_size += allocation_step;
666 if (
tiles == tiles_static) {
675 *r_needs_free =
true;
685 *r_total_tiles = total_tiles;
716 bool reuse_depsgraph =
false;
732 reuse_depsgraph =
true;
752 if (use_gpu_context) {
758 if (use_gpu_context) {
795 double cfra = (
double)frame + (
double)subframe;
826 const int pass_filter,
866 for (
int i = 0; i < targets->
images_num; i++) {
875 if (
type->render_frame_finish) {
877 type->render_frame_finish(engine);
880 memset(&engine->
bake, 0,
sizeof(engine->
bake));
904 const bool use_engine,
905 const bool use_grease_pencil)
953 if (use_gpu_context) {
967 if (use_gpu_context) {
1085 bool delay_grease_pencil =
false;
1103 if (
type->render_frame_finish) {
1104 type->render_frame_finish(engine);
1108 if (delay_grease_pencil) {
1141 #ifdef WITH_FREESTYLE
1143 RE_RenderFreestyleExternal(re);
1154 void *callback_data)
1258 if (engine->
re ==
NULL) {
typedef float(TangentPoint)[2]
Camera data-block and utility functions.
float BKE_camera_multiview_shift_x(const struct RenderData *rd, const struct Object *camera, const char *viewname)
void BKE_camera_multiview_model_matrix(const struct RenderData *rd, const struct Object *camera, const char *viewname, float r_modelmat[4][4])
bool BKE_camera_multiview_spherical_stereo(const struct RenderData *rd, const struct Object *camera)
bool BKE_reports_contain(ReportList *reports, eReportType level)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void BKE_scene_graph_update_for_newframe_ex(struct Depsgraph *depsgraph, bool clear_recalc)
float BKE_scene_frame_get(const struct Scene *scene)
bool BKE_scene_camera_switch_update(struct Scene *scene)
void BKE_scene_frame_set(struct Scene *scene, float frame)
bool BKE_scene_uses_cycles(const struct Scene *scene)
bool BKE_scene_uses_cycles_experimental_features(struct Scene *scene)
#define GSET_FOREACH_END()
bool BLI_gset_ensure_p_ex(GSet *gs, const void *key, void ***r_key)
#define BLI_ghashutil_inthash_v4_cmp
GSet * BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_gset_clear(GSet *gs, GSetKeyFreeFP keyfreefp)
#define GSET_FOREACH_BEGIN(type, var, what)
#define BLI_ghashutil_inthash_v4_p
bool BLI_gset_remove(GSet *gs, const void *key, GSetKeyFreeFP keyfreefp)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float int_as_float(int i)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
#define STRNCPY(dst, src)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_mutex_init(ThreadMutex *mutex)
#define THREAD_LOCK_WRITE
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
#define BLENDER_MAX_THREADS
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
void BPY_DECREF_RNA_INVALIDATE(void *pyob_ptr)
typedef double(DMatrix)[4][4]
Depsgraph * DEG_graph_new(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, eEvaluationMode mode)
struct Depsgraph Depsgraph
void DEG_ids_clear_recalc(Depsgraph *depsgraph, bool backup)
void DEG_graph_replace_owners(struct Depsgraph *depsgraph, struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
void DEG_graph_free(Depsgraph *graph)
void DEG_evaluate_on_framechange(Depsgraph *graph, float frame)
void DEG_graph_tag_relations_update(struct Depsgraph *graph)
void DEG_graph_relations_update(struct Depsgraph *graph)
void DEG_debug_name_set(struct Depsgraph *depsgraph, const char *name)
struct Scene * DEG_get_input_scene(const Depsgraph *graph)
struct Main * DEG_get_bmain(const Depsgraph *graph)
struct ViewLayer * DEG_get_input_view_layer(const Depsgraph *graph)
Object is a sort of wrapper for general info.
#define RE_PASSNAME_COMBINED
#define R_PERSISTENT_DATA
#define R_NO_FRAME_UPDATE
bool DRW_render_check_grease_pencil(struct Depsgraph *depsgraph)
void DRW_engines_free(void)
void DRW_engines_register(void)
void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph)
void DRW_engine_register(struct DrawEngineType *draw_engine_type)
bool DRW_engine_render_support(struct DrawEngineType *draw_engine_type)
void DRW_render_context_disable(struct Render *render)
void DRW_render_context_enable(struct Render *render)
void DRW_engines_register_experimental(void)
bool GPU_backend_supported(void)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
#define RE_ENGINE_CAN_DRAW
#define RE_USE_ALEMBIC_PROCEDURAL
#define RE_ENGINE_ANIMATION
#define RE_USE_GPU_CONTEXT
#define RE_ENGINE_PREVIEW
#define RE_ENGINE_RENDERING
#define RE_ENGINE_HIGHLIGHT_TILES
void(* update_render_passes_cb_t)(void *userdata, struct Scene *scene, struct ViewLayer *view_layer, const char *name, int channels, const char *chanid, eNodeSocketDatatype type)
#define RE_USE_POSTPROCESS
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
const Depsgraph * depsgraph
DEGForeachIDComponentCallback callback
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
static void re_ensure_passes_allocated_thread_safe(Render *re)
RenderEngine * RE_engine_create(RenderEngineType *type)
RenderEngineType * RE_engines_find(const char *idname)
void RE_engine_draw_release(Render *re)
bool RE_engine_is_external(const Render *re)
bool RE_engine_is_opengl(RenderEngineType *render_type)
bool RE_bake_engine(Render *re, Depsgraph *depsgraph, Object *object, const int object_id, const BakePixel pixel_array[], const BakeTargets *targets, const eScenePassType pass_type, const int pass_filter, float result[])
void RE_engine_frame_set(RenderEngine *engine, int frame, float subframe)
void RE_engine_update_render_passes(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer, update_render_passes_cb_t callback, void *callback_data)
bool RE_engine_supports_alembic_procedural(const RenderEngineType *render_type, Scene *scene)
static void engine_depsgraph_exit(RenderEngine *engine)
void RE_engine_add_pass(RenderEngine *engine, const char *name, int channels, const char *chan_id, const char *layername)
static void engine_depsgraph_init(RenderEngine *engine, ViewLayer *view_layer)
void RE_engine_report(RenderEngine *engine, int type, const char *msg)
bool RE_bake_has_engine(const Render *re)
void RE_engine_active_view_set(RenderEngine *engine, const char *viewname)
bool RE_engine_use_persistent_data(RenderEngine *engine)
float RE_engine_get_camera_shift_x(RenderEngine *engine, Object *camera, bool use_spherical_stereo)
void RE_engine_update_result(RenderEngine *engine, RenderResult *result)
static void engine_render_view_layer(Render *re, RenderEngine *engine, ViewLayer *view_layer_iter, const bool use_engine, const bool use_grease_pencil)
void RE_engine_update_memory_stats(RenderEngine *engine, float mem_used, float mem_peak)
bool RE_engine_has_render_context(RenderEngine *engine)
void RE_engines_init(void)
void RE_engine_tile_highlight_set(RenderEngine *engine, int x, int y, int width, int height, bool highlight)
bool RE_engine_draw_acquire(Render *re)
RenderPass * RE_engine_pass_by_index_get(RenderEngine *engine, const char *layer_name, int index)
bool RE_engine_get_spherical_stereo(RenderEngine *engine, Object *camera)
bool RE_engine_render(Render *re, bool do_all)
bool RE_engine_test_break(RenderEngine *engine)
void RE_engine_register_pass(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer, const char *name, int channels, const char *chanid, eNodeSocketDatatype type)
void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info)
void RE_engines_init_experimental()
void RE_bake_engine_set_engine_parameters(Render *re, Main *bmain, Scene *scene)
static RenderResult * render_result_from_bake(RenderEngine *engine, int x, int y, int w, int h, const char *layername)
static void engine_depsgraph_free(RenderEngine *engine)
void RE_engines_exit(void)
void RE_engines_register(RenderEngineType *render_type)
void RE_engine_free(RenderEngine *engine)
void RE_engine_free_blender_memory(RenderEngine *engine)
RenderResult * RE_engine_get_result(RenderEngine *engine)
struct RenderEngine * RE_engine_get(const Render *re)
void RE_engine_set_error_message(RenderEngine *engine, const char *msg)
const char * RE_engine_active_view_get(RenderEngine *engine)
RenderData * RE_engine_get_render_data(Render *re)
void RE_engine_render_context_disable(RenderEngine *engine)
void RE_engine_end_result(RenderEngine *engine, RenderResult *result, bool cancel, bool highlight, bool merge_results)
static void engine_tile_highlight_set(RenderEngine *engine, const HighlightedTile *tile, bool highlight)
void RE_engine_render_context_enable(RenderEngine *engine)
void RE_engine_tile_highlight_clear_all(RenderEngine *engine)
static HighlightedTile highlighted_tile_from_result_get(Render *UNUSED(re), RenderResult *result)
RenderResult * RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h, const char *layername, const char *viewname)
static bool engine_keep_depsgraph(RenderEngine *engine)
static void render_result_to_bake(RenderEngine *engine, RenderResult *rr)
void RE_engine_get_camera_model_matrix(RenderEngine *engine, Object *camera, bool use_spherical_stereo, float r_modelmat[16])
void RE_engine_update_progress(RenderEngine *engine, float progress)
rcti * RE_engine_get_current_tiles(Render *re, int *r_total_tiles, bool *r_needs_free)
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
ccl_global const KernelWorkTile * tile
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
RenderPass * RE_pass_find_by_name(RenderLayer *rl, const char *name, const char *viewname)
RenderResult * RE_AcquireResultRead(Render *re)
void * RE_gl_context_get(Render *re)
void render_copy_renderdata(RenderData *to, RenderData *from)
void RE_FreePersistentData(const Scene *scene)
void render_update_anim_renderdata(Render *re, RenderData *rd, ListBase *render_layers)
RenderLayer * RE_GetRenderLayer(RenderResult *rr, const char *name)
void RE_ReleaseResult(Render *re)
const char * RE_GetActiveRenderView(Render *re)
void RE_SetActiveRenderView(Render *re, const char *viewname)
void render_result_exr_file_cache_write(Render *re)
RenderPass * render_layer_add_pass(RenderResult *rr, RenderLayer *rl, int channels, const char *name, const char *viewname, const char *chan_id, const bool allocate)
void render_result_merge(RenderResult *rr, RenderResult *rrpart)
void render_result_passes_allocated_ensure(RenderResult *rr)
void render_result_free(RenderResult *rr)
RenderResult * render_result_new(Render *re, rcti *partrct, const char *layername, const char *viewname)
void render_result_clone_passes(Render *re, RenderResult *rr, const char *viewname)
void render_result_free_list(ListBase *lb, RenderResult *rr)
void RE_create_render_pass(RenderResult *rr, const char *name, int channels, const char *chan_id, const char *layername, const char *viewname, const bool allocate)
#define FOREACH_VIEW_LAYER_TO_RENDER_END
#define FOREACH_VIEW_LAYER_TO_RENDER_BEGIN(re_, iter_)
char render_layer_name[RE_MAXNAME]
void(* render)(struct RenderEngine *engine, struct Depsgraph *depsgraph)
void(* update)(struct RenderEngine *engine, struct Main *bmain, struct Depsgraph *depsgraph)
struct DrawEngineType * draw_engine
void(* draw)(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
void(* update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
struct ReportList * reports
struct Depsgraph * depsgraph
const struct BakePixel * pixels
void * update_render_passes_data
struct RenderEngine::@1172 bake
update_render_passes_cb_t update_render_passes_cb
ThreadMutex update_render_passes_mutex
const struct BakeTargets * targets
struct Object * camera_override
char scene_name[MAX_ID_NAME - 2]
ThreadMutex engine_draw_mutex
void(* progress)(void *handle, float i)
struct RenderEngine * engine
struct GSet * highlighted_tiles
void(* display_update)(void *handle, RenderResult *rr, rcti *rect)
ThreadRWMutex resultmutex
void(* draw_lock)(void *handle, bool lock)
void(* stats_draw)(void *handle, RenderStats *ri)
int(* test_break)(void *handle)
ThreadMutex highlighted_tiles_mutex
struct ReportList * reports
struct Object * camera_override