Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/gpencil_render.c
| Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | void GPENCIL_render_to_image(void *vedata, RenderEngine *engine, struct RenderLayer *render_layer, const rcti *rect) | ||||
| else { | else { | ||||
| /* TODO: put this message in a better place */ | /* TODO: put this message in a better place */ | ||||
| printf("Warning: To render grease pencil, enable Combined and Z passes.\n"); | printf("Warning: To render grease pencil, enable Combined and Z passes.\n"); | ||||
| } | } | ||||
| GPENCIL_engine_init(vedata); | GPENCIL_engine_init(vedata); | ||||
| GPENCIL_render_init(vedata, engine, draw_ctx->depsgraph); | GPENCIL_render_init(vedata, engine, draw_ctx->depsgraph); | ||||
| GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; | |||||
| Object *camera = DEG_get_evaluated_object(draw_ctx->depsgraph, RE_GetCamera(engine->re)); | |||||
| stl->storage->camera = camera; /* save current camera */ | |||||
| GPENCIL_FramebufferList *fbl = ((GPENCIL_Data *)vedata)->fbl; | GPENCIL_FramebufferList *fbl = ((GPENCIL_Data *)vedata)->fbl; | ||||
| if (fbl->main) { | if (fbl->main) { | ||||
| GPU_framebuffer_texture_attach(fbl->main, ((GPENCIL_Data *)vedata)->render_depth_tx, 0, 0); | GPU_framebuffer_texture_attach(fbl->main, ((GPENCIL_Data *)vedata)->render_depth_tx, 0, 0); | ||||
| GPU_framebuffer_texture_attach(fbl->main, ((GPENCIL_Data *)vedata)->render_color_tx, 0, 0); | GPU_framebuffer_texture_attach(fbl->main, ((GPENCIL_Data *)vedata)->render_color_tx, 0, 0); | ||||
| /* clean first time the buffer */ | /* clean first time the buffer */ | ||||
| float clearcol[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; | float clearcol[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; | ||||
| GPU_framebuffer_bind(fbl->main); | GPU_framebuffer_bind(fbl->main); | ||||
| GPU_framebuffer_clear_color_depth(fbl->main, clearcol, 1.0f); | GPU_framebuffer_clear_color_depth(fbl->main, clearcol, 1.0f); | ||||
| ▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines | |||||