Blender V2.61 - r43446
|
Go to the source code of this file.
Functions | |
void | GPU_state_init (void) |
void | GPU_state_print (void) |
void | GPU_begin_object_materials (struct View3D *v3d, struct RegionView3D *rv3d, struct Scene *scene, struct Object *ob, int glsl, int *do_alpha_after) |
void | GPU_end_object_materials (void) |
int | GPU_enable_material (int nr, void *attribs) |
void | GPU_disable_material (void) |
void | GPU_set_material_alpha_blend (int alphablend) |
int | GPU_get_material_alpha_blend (void) |
int | GPU_set_tpage (struct MTFace *tface, int mipmap, int transp) |
int | GPU_default_lights (void) |
int | GPU_scene_object_lights (struct Scene *scene, struct Object *ob, int lay, float viewmat[][4], int ortho) |
void | GPU_render_text (struct MTFace *tface, int mode, const char *textstr, int textlen, unsigned int *col, float *v1, float *v2, float *v3, float *v4, int glattrib) |
void | GPU_set_mipmap (int mipmap) |
void | GPU_set_linear_mipmap (int linear) |
void | GPU_paint_set_mipmap (int mipmap) |
void | GPU_set_anisotropic (float value) |
float | GPU_get_anisotropic (void) |
void | GPU_paint_update_image (struct Image *ima, int x, int y, int w, int h, int mipmap) |
void | GPU_update_images_framechange (void) |
int | GPU_update_image_time (struct Image *ima, double time) |
int | GPU_verify_image (struct Image *ima, struct ImageUser *iuser, int tftile, int compare, int mipmap) |
void | GPU_free_image (struct Image *ima) |
void | GPU_free_images (void) |
void | GPU_free_images_anim (void) |
void | GPU_free_smoke (struct SmokeModifierData *smd) |
void | GPU_create_smoke (struct SmokeModifierData *smd, int highres) |
void | GPU_free_unused_buffers (void) |
Definition in file GPU_draw.h.
void GPU_begin_object_materials | ( | struct View3D * | v3d, |
struct RegionView3D * | rv3d, | ||
struct Scene * | scene, | ||
struct Object * | ob, | ||
int | glsl, | ||
int * | do_alpha_after | ||
) |
Definition at line 983 of file gpu_draw.c.
References Material::alpha, GPUMaterialState::alphablend, GPUMaterialState::alphablend_fixed, Object::col, RenderData::color_mgt_flag, defmaterial, GPUMaterialFixed::diff, ELEM3, FIXEDMAT, give_current_material(), GPUMaterialState::glay, GPUMaterialState::gmatbuf, GPUMaterialState::gmatbuf_fixed, GMS, GPUMaterialState::gob, gpu_active_node_material(), GPU_BLEND_ADD, GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_SORT, GPU_BLEND_SOLID, GPU_disable_material(), GPU_material_alpha_blend(), GPU_material_from_blender(), gpu_material_to_fixed(), GPUMaterialState::gscene, GPUMaterialState::gviewinv, GPUMaterialState::gviewmat, GPUMaterialState::is_alpha_pass, GPUMaterialState::lastalphablend, GPUMaterialState::lastmatnr, GPUMaterialState::lastretval, View3D::lay, GPUMaterialState::matbuf, GPUMaterialState::matbuf_fixed, MEM_callocN(), NULL, Scene::r, R_COLOR_MANAGEMENT, scene_use_new_shading_nodes(), Object::totcol, GPUMaterialState::totmat, View3D::transp, GPUMaterialState::use_alpha_pass, RegionView3D::viewinv, and RegionView3D::viewmat.
Referenced by draw_mesh_object(), draw_mesh_textured(), draw_object_mesh_instance(), drawCurveDerivedMesh(), and drawDispList().
void GPU_create_smoke | ( | struct SmokeModifierData * | smd, |
int | highres | ||
) |
Definition at line 805 of file gpu_draw.c.
References SmokeModifierData::domain, SmokeDomainSettings::fluid, GPU_texture_create_3D(), MOD_SMOKE_TYPE_DOMAIN, NULL, SmokeDomainSettings::res, SmokeDomainSettings::res_wt, SmokeDomainSettings::shadow, smoke_get_density(), smoke_turbulence_get_density(), SmokeDomainSettings::tex, SmokeDomainSettings::tex_shadow, SmokeModifierData::type, and SmokeDomainSettings::wt.
Referenced by draw_object().
int GPU_default_lights | ( | void | ) |
Definition at line 1229 of file gpu_draw.c.
References SolidLight::col, SolidLight::flag, UserDef::light, normalize_v3_v3(), SolidLight::spec, U, and SolidLight::vec.
Referenced by draw_textured_end(), GPU_state_init(), view3d_main_area_draw_objects(), and WM_read_homefile().
void GPU_disable_material | ( | void | ) |
Definition at line 1190 of file gpu_draw.c.
References GPUMaterialState::gboundmat, GMS, GPU_BLEND_SOLID, GPU_material_from_blender(), GPU_material_unbind(), GPU_set_material_alpha_blend(), GPUMaterialState::gscene, GPUMaterialState::is_alpha_pass, GPUMaterialState::lastmatnr, GPUMaterialState::lastretval, and NULL.
Referenced by draw_em_fancy(), draw_mesh_fancy(), draw_mesh_object_outline(), draw_object(), GPU_begin_object_materials(), GPU_end_object_materials(), and tex_mat_set_texture_cb().
int GPU_enable_material | ( | int | nr, |
void * | attribs | ||
) |
Definition at line 1083 of file gpu_draw.c.
References GameSettings::alpha_blend, GPUMaterialState::alphablend, DerivedMesh::auto_bump_scale, Object::col, Object::derivedFinal, GPUMaterialFixed::diff, KDL::diff(), ELEM, Material::emit, Material::game, GPUMaterialState::gboundmat, GPUMaterialState::glay, GPUMaterialState::gmatbuf, GMS, GPUMaterialState::gob, GPU_BLEND_CLIP, GPU_BLEND_SOLID, GPU_material_bind(), GPU_material_bind_uniforms(), GPU_material_from_blender(), GPU_material_unbind(), GPU_material_vertex_attributes(), GPU_set_material_alpha_blend(), GPUMaterialState::gscene, GPUMaterialState::gviewinv, GPUMaterialState::gviewmat, GPUMaterialFixed::hard, GPUMaterialState::is_alpha_pass, GPUMaterialState::lastmatnr, GPUMaterialState::lastretval, Object::lay, GPUMaterialState::matbuf, Object::mode, mul_v3_v3fl(), NULL, OB_MODE_TEXTURE_PAINT, Object::obmat, Material::r, Material::ref, GPUMaterialFixed::spec, Material::spec, spec(), Material::specr, GPUMaterialState::totmat, and GPUMaterialState::use_alpha_pass.
Referenced by bbs_mesh_solid(), bbs_mesh_solid_EM(), ccgDM_drawFacesTex_common(), draw_dm_faces_sel(), draw_em_fancy(), draw_em_fancy__setFaceOpts(), draw_mesh_fancy(), draw_mesh_object_outline(), draw_mesh_text(), draw_mesh_textured(), draw_mesh_textured_old(), draw_object(), draw_object_backbufsel(), draw_object_mesh_instance(), drawCurveDerivedMesh(), drawDispListsolid(), tex_mat_set_material_cb(), and tex_mat_set_texture_cb().
void GPU_end_object_materials | ( | void | ) |
Definition at line 1204 of file gpu_draw.c.
References GPUMaterialState::alphablend, GPUMaterialState::gmatbuf, GMS, GPU_disable_material(), GTS, GPUMaterialState::matbuf, GPUMaterialState::matbuf_fixed, MEM_freeN(), NULL, and GPUTextureState::tilemode.
Referenced by draw_mesh_fancy(), draw_mesh_object(), draw_mesh_textured(), draw_object_mesh_instance(), drawCurveDerivedMesh(), and drawDispList().
void GPU_free_image | ( | struct Image * | ima | ) |
Definition at line 854 of file gpu_draw.c.
References Image::bindcode, BLI_thread_is_main(), gpu_queue_image_for_free(), GPU_texture_free(), Image::gputexture, IMA_MIPMAP_COMPLETE, MEM_freeN(), NULL, Image::repbind, Image::totbind, and Image::tpageflag.
Referenced by finish_bake_internal(), free_old_images(), GPU_free_images(), GPU_free_images_anim(), GPU_free_unused_buffers(), GPU_paint_set_mipmap(), GPU_paint_update_image(), GPU_verify_image(), image_free_buffers(), image_undo_restore(), paint_redraw(), and texture_paint_camera_project_exec().
void GPU_free_images | ( | void | ) |
Definition at line 884 of file gpu_draw.c.
References G, GPU_free_image(), Image::id, and ID::next.
Referenced by GPU_set_anisotropic(), GPU_set_linear_mipmap(), GPU_set_mipmap(), and texture_paint_toggle_exec().
void GPU_free_images_anim | ( | void | ) |
Definition at line 894 of file gpu_draw.c.
References ELEM, G, GPU_free_image(), Image::id, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, ID::next, and Image::source.
Referenced by ED_view3d_draw_offscreen().
void GPU_free_smoke | ( | struct SmokeModifierData * | smd | ) |
Definition at line 791 of file gpu_draw.c.
References SmokeModifierData::domain, GPU_texture_free(), MOD_SMOKE_TYPE_DOMAIN, NULL, SmokeDomainSettings::tex, SmokeDomainSettings::tex_shadow, and SmokeModifierData::type.
Referenced by draw_object().
void GPU_free_unused_buffers | ( | void | ) |
Definition at line 832 of file gpu_draw.c.
References BLI_freelistN(), BLI_lock_thread(), BLI_thread_is_main(), BLI_unlock_thread(), ListBase::first, GPU_free_image(), Image::id, LOCK_OPENGL, and ID::next.
Referenced by wm_draw_update(), and WM_exit_ext().
float GPU_get_anisotropic | ( | void | ) |
Definition at line 293 of file gpu_draw.c.
References GPUTextureState::anisotropic, and GTS.
Referenced by RAS_OpenGLRasterizer::GetAnisotropicFiltering(), GPU_verify_image(), and RAS_OpenGLRasterizer::RAS_OpenGLRasterizer().
int GPU_get_material_alpha_blend | ( | void | ) |
Definition at line 1185 of file gpu_draw.c.
References GMS, and GPUMaterialState::lastalphablend.
Referenced by RAS_OpenGLRasterizer::IndexPrimitivesInternal().
void GPU_paint_set_mipmap | ( | int | mipmap | ) |
Definition at line 642 of file gpu_draw.c.
References Image::bindcode, GPUTextureState::domipmap, G, GPU_free_image(), gpu_get_mipmap_filter(), GTS, Image::id, IMA_MIPMAP_COMPLETE, ID::next, and Image::tpageflag.
Referenced by texture_paint_toggle_exec().
void GPU_paint_update_image | ( | struct Image * | ima, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
int | mipmap | ||
) |
Definition at line 674 of file gpu_draw.c.
References Image::bindcode, BKE_image_get_ibuf(), GPU_free_image(), gpu_get_mipmap(), IMA_MIPMAP_COMPLETE, IMB_partial_rect_from_float(), IMB_rect_from_float(), is_power_of_2_i(), MEM_freeN(), MEM_mallocN(), NULL, ImBuf::rect, ImBuf::rect_float, Image::repbind, Image::tpageflag, ImBuf::x, and ImBuf::y.
Referenced by imapaint_image_update().
void GPU_render_text | ( | struct MTFace * | tface, |
int | mode, | ||
const char * | textstr, | ||
int | textlen, | ||
unsigned int * | col, | ||
float * | v1, | ||
float * | v2, | ||
float * | v3, | ||
float * | v4, | ||
int | glattrib | ||
) |
Definition at line 90 of file gpu_draw.c.
References ListBase::first, GEMAT_TEXT, gpu_mcol(), Image::ibufs, if(), matrixGlyph(), MAX3(), MAX4, MIN3, MIN4, MTFace::mode, NULL, TF_OBCOL, MTFace::tpage, and MTFace::uv.
Referenced by draw_mesh_text(), KX_BlenderRenderTools::RenderText(), and GPC_RenderTools::RenderText().
int GPU_scene_object_lights | ( | struct Scene * | scene, |
struct Object * | ob, | ||
int | lay, | ||
float | viewmat[][4], | ||
int | ortho | ||
) |
Definition at line 1295 of file gpu_draw.c.
References Lamp::att1, Lamp::att2, Scene::base, copy_v3_v3(), Object::data, Lamp::dist, Lamp::energy, ListBase::first, glLoadMatrixf, LA_SPOT, LA_SUN, Object::lay, Base::lay, mul_v3_v3fl(), negate_v3_v3(), Base::next, OB_LAMP, Base::object, Object::obmat, Lamp::r, Lamp::spotblend, Lamp::spotsize, Lamp::type, Object::type, and where_is_object_simul().
Referenced by draw_textured_begin().
void GPU_set_anisotropic | ( | float | value | ) |
Definition at line 279 of file gpu_draw.c.
References GPUTextureState::anisotropic, GPU_free_images(), and GTS.
Referenced by main(), RAS_OpenGLRasterizer::SetAnisotropicFiltering(), WM_init(), and RAS_OpenGLRasterizer::~RAS_OpenGLRasterizer().
void GPU_set_linear_mipmap | ( | int | linear | ) |
Definition at line 245 of file gpu_draw.c.
References GPU_free_images(), GTS, and GPUTextureState::linearmipmap.
Referenced by set_ge_parameters().
void GPU_set_material_alpha_blend | ( | int | alphablend | ) |
Definition at line 1176 of file gpu_draw.c.
References GMS, gpu_set_alpha_blend(), and GPUMaterialState::lastalphablend.
Referenced by RAS_OpenGLRasterizer::BeginFrame(), GPU_disable_material(), GPU_enable_material(), RAS_OpenGLRasterizer::IndexPrimitivesInternal(), RAS_OpenGLRasterizer::Init(), and RAS_OpenGLRasterizer::SetAlphaBlend().
void GPU_set_mipmap | ( | int | mipmap | ) |
Definition at line 237 of file gpu_draw.c.
References GPUTextureState::domipmap, GPU_free_images(), and GTS.
Referenced by main(), set_ge_parameters(), and WM_init().
int GPU_set_tpage | ( | struct MTFace * | tface, |
int | mipmap, | ||
int | transp | ||
) |
Definition at line 593 of file gpu_draw.c.
References GPUTextureState::curima, GPUTextureState::curtile, GPUTextureState::curtilemode, GPUTextureState::curtileXRep, GPUTextureState::curtileYRep, gpu_clear_tpage(), gpu_verify_alpha_blend(), GPU_verify_image(), gpu_verify_reflection(), gpu_verify_repeat(), GTS, GPUTextureState::ima, GPUTextureState::lasttface, NULL, GPUTextureState::tile, MTFace::tile, GPUTextureState::tilemode, GPUTextureState::tileXRep, GPUTextureState::tileYRep, and MTFace::tpage.
Referenced by KX_PolygonMaterial::DefaultActivate(), draw_textured_end(), and set_draw_settings_cached().
void GPU_state_init | ( | void | ) |
Definition at line 1375 of file gpu_draw.c.
References GPU_default_lights().
Referenced by RAS_OpenGLRasterizer::Init(), and wm_window_add_ghostwindow().
void GPU_state_print | ( | void | ) |
Definition at line 1465 of file gpu_draw.c.
References gpu_get_print().
int GPU_update_image_time | ( | struct Image * | ima, |
double | time | ||
) |
Definition at line 750 of file gpu_draw.c.
References Image::animspeed, KDL::diff(), IMA_TWINANIM, Image::lastframe, Image::lastupdate, Image::tpageflag, Image::twend, Image::twsta, Image::xrep, and Image::yrep.
Referenced by KX_PolygonMaterial::DefaultActivate(), and GPU_texture_from_blender().
void GPU_update_images_framechange | ( | void | ) |
Definition at line 732 of file gpu_draw.c.
References G, Image::id, IMA_TWINANIM, Image::lastframe, ID::next, Image::tpageflag, Image::twend, Image::twsta, Image::xrep, and Image::yrep.
int GPU_verify_image | ( | struct Image * | ima, |
struct ImageUser * | iuser, | ||
int | tftile, | ||
int | compare, | ||
int | mipmap | ||
) |
Definition at line 408 of file gpu_draw.c.
References Image::bindcode, BKE_image_get_ibuf(), GPUTextureState::curima, GPUTextureState::curtile, GPUTextureState::curtilemode, GPUTextureState::curtileXRep, GPUTextureState::curtileYRep, GPU_free_image(), GPU_get_anisotropic(), gpu_get_mipmap(), gpu_get_mipmap_filter(), gpu_make_repbind(), GTS, GPUTextureState::ima, IMA_MIPMAP_COMPLETE, IMA_TILES, IMA_TPAGE_REFRESH, IMA_TWINANIM, IMB_rect_from_float(), is_pow2_limit(), Image::lastframe, MAX2, MEM_freeN(), MEM_mallocN(), NULL, Image::ok, ImBuf::rect, ImBuf::rect_float, Image::repbind, smaller_pow2_limit(), GPUTextureState::tile, GPUTextureState::tilemode, GPUTextureState::tileXRep, GPUTextureState::tileYRep, Image::totbind, Image::tpageflag, ImBuf::x, Image::xrep, ImBuf::y, and Image::yrep.
Referenced by GPU_set_tpage(), GPU_texture_from_blender(), and tex_mat_set_texture_cb().