|
Blender
V2.59
|
Go to the source code of this file.
Definition in file GPU_material.h.
| typedef enum GPUBlendMode GPUBlendMode |
| typedef enum GPUBuiltin GPUBuiltin |
Definition at line 63 of file GPU_material.h.
| typedef struct GPUMaterial GPUMaterial |
Definition at line 62 of file GPU_material.h.
Definition at line 60 of file GPU_material.h.
| typedef struct GPUNodeLink GPUNodeLink |
Definition at line 61 of file GPU_material.h.
| typedef struct GPUNodeStack GPUNodeStack |
| typedef struct GPUShadeInput GPUShadeInput |
| typedef struct GPUShadeResult GPUShadeResult |
| enum GPUBlendMode |
Definition at line 91 of file GPU_material.h.
| enum GPUBuiltin |
| GPU_VIEW_MATRIX | |
| GPU_OBJECT_MATRIX | |
| GPU_INVERSE_VIEW_MATRIX | |
| GPU_INVERSE_OBJECT_MATRIX | |
| GPU_VIEW_POSITION | |
| GPU_VIEW_NORMAL | |
| GPU_OBCOLOR |
Definition at line 81 of file GPU_material.h.
| enum GPUType |
| GPU_NONE | |
| GPU_FLOAT | |
| GPU_VEC2 | |
| GPU_VEC3 | |
| GPU_VEC4 | |
| GPU_MAT3 | |
| GPU_MAT4 | |
| GPU_TEX1D | |
| GPU_TEX2D | |
| GPU_SHADOW2D | |
| GPU_ATTRIB |
Definition at line 67 of file GPU_material.h.
| GPUNodeLink* GPU_attribute | ( | int | type, |
| const char * | name | ||
| ) |
Definition at line 1158 of file gpu_codegen.c.
References GPUNodeLink::attribname, GPUNodeLink::attribtype, GPU_node_link_create(), and link().
Referenced by do_material_tex(), GPU_shadeinput_set(), and gpu_shader_geom().
| GPUNodeLink* GPU_builtin | ( | GPUBuiltin | builtin | ) |
Definition at line 1230 of file gpu_codegen.c.
References GPUNodeLink::builtin, GPU_node_link_create(), and link().
Referenced by do_material_tex(), GPU_shadeinput_set(), gpu_shader_camera(), gpu_shader_geom(), GPU_shaderesult_set(), lamp_get_visibility(), and shade_one_light().
| GPUNodeLink* GPU_dynamic_texture | ( | struct GPUTexture * | tex | ) |
Definition at line 1211 of file gpu_codegen.c.
References GPUNodeLink::dynamic, GPUNodeLink::dynamictex, GPU_node_link_create(), and link().
Referenced by shade_one_light().
| GPUNodeLink* GPU_dynamic_uniform | ( | float * | num | ) |
Definition at line 1178 of file gpu_codegen.c.
References GPUNodeLink::dynamic, GPU_node_link_create(), link(), NULL, GPUNodeLink::ptr1, and GPUNodeLink::ptr2.
Referenced by lamp_get_visibility(), and shade_one_light().
| GPUNodeLink* GPU_image | ( | struct Image * | ima, |
| struct ImageUser * | iuser | ||
| ) |
Definition at line 1189 of file gpu_codegen.c.
References GPU_node_link_create(), GPUNodeLink::image, link(), GPUNodeLink::ptr1, and GPUNodeLink::ptr2.
Referenced by do_material_tex(), and gpu_shader_texture().
| void GPU_lamp_free | ( | struct Object * | ob | ) |
Definition at line 1583 of file gpu_material.c.
References BLI_freelinkN(), BLI_freelistN(), LinkData::data, ListBase::first, gpu_lamp_shadow_free(), GPU_material_free(), Object::gpulamp, Material::gpumaterial, link(), GPULamp::materials, MEM_freeN(), and LinkData::next.
Referenced by free_object(), GPU_materials_free(), lamp_changed(), and scene_changed().
Definition at line 1536 of file gpu_material.c.
References BLI_addtail(), LinkData::data, Object::data, GPULamp::fb, ListBase::first, GPU_framebuffer_create(), GPU_framebuffer_restore(), GPU_framebuffer_texture_attach(), gpu_lamp_from_blender(), gpu_lamp_shadow_free(), GPU_texture_create_depth(), Object::gpulamp, LA_SHAD_BUF, LA_SPOT, link(), MEM_callocN(), Lamp::mode, LinkData::next, NULL, GPULamp::par, GPULamp::scene, GPULamp::size, GPULamp::tex, and Lamp::type.
Referenced by KX_LightObject::GetGPULamp(), gpu_render_lamp_update(), and material_lights().
| int GPU_lamp_has_shadow_buffer | ( | GPULamp * | lamp | ) |
Definition at line 1610 of file gpu_material.c.
References GPULamp::fb, GameData::flag, GAME_GLSL_NO_LIGHTS, GAME_GLSL_NO_SHADOWS, Scene::gm, GPULamp::scene, and GPULamp::tex.
Referenced by gpu_render_lamp_update(), KX_LightObject::HasShadowBuffer(), and shade_one_light().
| void GPU_lamp_shadow_buffer_bind | ( | GPULamp * | lamp, |
| float | viewmat[][4], | ||
| int * | winsize, | ||
| float | winmat[][4] | ||
| ) |
Definition at line 1617 of file gpu_material.c.
References copy_m4_m4(), GPULamp::fb, GPU_framebuffer_texture_bind(), invert_m4_m4(), mul_m4_m4m4(), normalize_v3(), GPULamp::obmat, GPULamp::persmat, GPULamp::size, GPULamp::tex, unit_m4(), GPULamp::viewmat, and GPULamp::winmat.
Referenced by KX_LightObject::BindShadowBuffer(), and gpu_update_lamps_shadows().
| void GPU_lamp_shadow_buffer_unbind | ( | GPULamp * | lamp | ) |
Definition at line 1651 of file gpu_material.c.
References GPULamp::fb, GPU_framebuffer_restore(), GPU_framebuffer_texture_unbind(), and GPULamp::tex.
Referenced by gpu_update_lamps_shadows(), and KX_LightObject::UnbindShadowBuffer().
| int GPU_lamp_shadow_layer | ( | GPULamp * | lamp | ) |
Definition at line 1658 of file gpu_material.c.
References GPULamp::fb, LA_LAYER, LA_LAYER_SHADOW, GPULamp::lay, GPULamp::mode, and GPULamp::tex.
Referenced by KX_LightObject::GetShadowLayer(), and gpu_update_lamps_shadows().
| void GPU_lamp_update | ( | GPULamp * | lamp, |
| int | lay, | ||
| int | hide, | ||
| float | obmat[][4] | ||
| ) |
Definition at line 1444 of file gpu_material.c.
References GPULamp::co, copy_m4_m4(), GPULamp::hide, GPULamp::imat, invert_m4_m4(), GPULamp::lay, normalize_m4(), GPULamp::obmat, GPULamp::vec, and VECCOPY.
Referenced by gpu_lamp_from_blender(), gpu_render_lamp_update(), KX_LightObject::Update(), and KX_LightObject::~KX_LightObject().
| void GPU_lamp_update_colors | ( | GPULamp * | lamp, |
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | energy | ||
| ) |
Definition at line 1460 of file gpu_material.c.
References GPULamp::col, GPULamp::energy, LA_NEG, and GPULamp::mode.
Referenced by gpu_render_lamp_update(), and KX_LightObject::Update().
| int GPU_link | ( | GPUMaterial * | mat, |
| const char * | name, | ||
| ... | |||
| ) |
Definition at line 1239 of file gpu_codegen.c.
References FUNCTION_QUAL_IN, GPU_lookup_function(), gpu_material_add_node(), GPU_node_begin(), GPU_node_end(), gpu_node_input_link(), GPU_node_output(), i, and link().
Referenced by add_to_diffuse(), do_colorband_blend(), do_material_tex(), do_specular_ramp(), GPU_material_from_blender(), GPU_shadeinput_set(), gpu_shader_material(), GPU_shaderesult_set(), lamp_get_visibility(), ramp_blend(), ramp_diffuse_result(), ramp_spec_result(), shade_one_light(), texture_rgb_blend(), and texture_value_blend().
| void GPU_material_bind | ( | GPUMaterial * | material, |
| int | oblay, | ||
| int | viewlay, | ||
| double | time, | ||
| int | mipmap | ||
| ) |
Definition at line 253 of file gpu_material.c.
References GPUMaterial::bound, GPULamp::col, LinkData::data, GPULamp::dyncol, GPULamp::dynenergy, GPULamp::energy, ListBase::first, GPU_pass_bind(), GPULamp::hide, LA_LAYER, GPUMaterial::lamps, GPULamp::lay, GPULamp::mode, LinkData::next, GPUMaterial::pass, and VECCOPY.
Referenced by GPU_enable_material(), and BL_BlenderShader::SetProg().
| void GPU_material_bind_uniforms | ( | GPUMaterial * | material, |
| float | obmat[][4], | ||
| float | viewmat[][4], | ||
| float | viewinv[][4], | ||
| float | obcol[4] | ||
| ) |
Definition at line 278 of file gpu_material.c.
References GPUMaterial::builtins, CLAMP(), GPULamp::co, LinkData::data, DYN_LAMP_CO, DYN_LAMP_IMAT, DYN_LAMP_PERSMAT, DYN_LAMP_VEC, GPULamp::dynco, GPULamp::dynimat, GPULamp::dynpersmat, GPUMaterial::dynproperty, GPULamp::dynvec, ListBase::first, GPU_INVERSE_OBJECT_MATRIX, GPU_INVERSE_VIEW_MATRIX, GPU_OBCOLOR, GPU_OBJECT_MATRIX, GPU_pass_shader(), GPU_pass_update_uniforms(), GPU_shader_uniform_vector(), GPU_VIEW_MATRIX, GPULamp::imat, invert_m4_m4(), GPUMaterial::invobmatloc, GPUMaterial::invviewmatloc, GPUMaterial::lamps, mul_m4_m4m4(), mul_m4_v3(), mul_mat3_m4_v3(), negate_v3(), LinkData::next, normalize_v3(), GPUMaterial::obcolloc, GPUMaterial::obmatloc, GPUMaterial::pass, GPULamp::persmat, QUATCOPY, GPULamp::vec, VECCOPY, and GPUMaterial::viewmatloc.
Referenced by GPU_enable_material(), and LOD_QuadricEditor::Update().
| GPUBlendMode GPU_material_blend_mode | ( | GPUMaterial * | material, |
| float | obcol[4] | ||
| ) |
Referenced by GPU_begin_object_materials(), and LOD_QuadricEditor::Update().
| int GPU_material_bound | ( | GPUMaterial * | material | ) |
Definition at line 340 of file gpu_material.c.
References GPUMaterial::bound.
Referenced by LOD_QuadricEditor::Update().
| void GPU_material_enable_alpha | ( | GPUMaterial * | material | ) |
Definition at line 356 of file gpu_material.c.
References GPUMaterial::alpha.
Referenced by GPU_shaderesult_set().
| void GPU_material_free | ( | struct Material * | ma | ) |
Definition at line 224 of file gpu_material.c.
References BLI_freelinkN(), BLI_freelistN(), LinkData::data, ListBase::first, GPU_pass_free(), Material::gpumaterial, GPUMaterial::lamps, link(), GPULamp::materials, MEM_freeN(), LinkData::next, next, and GPUMaterial::pass.
Referenced by free_material(), GPU_extensions_exit(), GPU_lamp_free(), GPU_materials_free(), lamp_changed(), material_changed(), paste_matcopybuf(), scene_changed(), texture_changed(), and world_changed().
| GPUMaterial* GPU_material_from_blender | ( | struct Scene * | scene, |
| struct Material * | ma | ||
| ) |
Definition at line 1387 of file gpu_material.c.
References BLI_addtail(), LinkData::data, ListBase::first, GameData::flag, GAME_GLSL_NO_NODES, Scene::gm, GPU_blender_material(), gpu_do_color_management(), GPU_link(), GPU_material_construct_begin(), GPU_material_construct_end(), GPU_material_output_link(), Material::gpumaterial, link(), MEM_callocN(), LinkData::next, Material::nodetree, ntreeGPUMaterialNodes(), GPUMaterial::outlink, GPUMaterial::scene, and Material::use_nodes.
Referenced by GPU_begin_object_materials(), GPU_disable_material(), GPU_enable_material(), RAS_OpenGLRasterizer::IndexPrimitivesInternal(), and BL_BlenderShader::ReloadMaterial().
| void GPU_material_output_link | ( | GPUMaterial * | material, |
| GPUNodeLink * | link | ||
| ) |
Definition at line 350 of file gpu_material.c.
References link(), and GPUMaterial::outlink.
Referenced by GPU_material_from_blender(), and gpu_shader_output().
| void GPU_material_unbind | ( | GPUMaterial * | material | ) |
Definition at line 332 of file gpu_material.c.
References GPUMaterial::bound, GPU_pass_unbind(), and GPUMaterial::pass.
Referenced by GPU_disable_material(), GPU_enable_material(), BL_BlenderShader::SetProg(), and BL_BlenderShader::~BL_BlenderShader().
| void GPU_material_vertex_attributes | ( | GPUMaterial * | material, |
| struct GPUVertexAttribs * | attrib | ||
| ) |
Definition at line 345 of file gpu_material.c.
References GPUMaterial::attribs.
Referenced by BL_BlenderShader::GetAttribNum(), GPU_enable_material(), RAS_OpenGLRasterizer::IndexPrimitivesInternal(), and BL_BlenderShader::SetAttribs().
| void GPU_materials_free | ( | void | ) |
Definition at line 1427 of file gpu_material.c.
References defmaterial, ListBase::first, G, GPU_lamp_free(), GPU_material_free(), Material::id, Object::id, Global::main, Main::mat, ID::next, and Main::object.
| void GPU_shadeinput_set | ( | GPUMaterial * | mat, |
| struct Material * | ma, | ||
| GPUShadeInput * | shi | ||
| ) |
Definition at line 1248 of file gpu_material.c.
References Material::alpha, GPUShadeInput::alpha, Material::amb, GPUShadeInput::amb, CD_MCOL, Material::emit, GPUShadeInput::emit, GPU_attribute(), GPU_builtin(), gpu_do_color_management(), GPU_link(), GPU_uniform(), GPU_VIEW_NORMAL, GPU_VIEW_POSITION, GPUShadeInput::gpumat, Material::har, GPUShadeInput::har, GPUShadeInput::mat, Material::r, Material::ref, GPUShadeInput::ref, GPUShadeInput::refl, GPUShadeInput::rgb, Material::spec, GPUShadeInput::spec, Material::specr, GPUShadeInput::specrgb, GPUShadeInput::vcol, GPUShadeInput::view, and GPUShadeInput::vn.
Referenced by GPU_blender_material(), and gpu_shader_material().
| void GPU_shaderesult_set | ( | GPUShadeInput * | shi, |
| GPUShadeResult * | shr | ||
| ) |
Definition at line 1273 of file gpu_material.c.
References Material::alpha, GPUShadeInput::alpha, GPUShadeResult::alpha, Material::amb, GPUShadeInput::amb, World::ambb, World::ambg, World::ambr, GPUShadeResult::combined, GPUShadeResult::diff, do_material_tex(), Material::emit, GPUShadeInput::emit, World::exp, GameData::flag, GAME_GLSL_NO_LIGHTS, Scene::gm, GPU_builtin(), GPU_link(), GPU_link_changed(), GPU_material_enable_alpha(), GPU_OBCOLOR, GPU_uniform(), GPU_VIEW_POSITION, GPUShadeInput::gpumat, World::horr, KDL::log(), MA_NOMIST, MA_OBCOLOR, MA_RAMP_COL, MA_RAMP_SPEC, MA_SHLESS, MA_TRANSP, MA_VERTEXCOL, MA_VERTEXCOLP, MA_ZTRANSP, GPUShadeInput::mat, material_lights(), World::misi, World::mistdist, World::miststa, World::mistype, World::mode, Material::mode, GPUMaterial::obcolalpha, pow(), ramp_diffuse_result(), ramp_spec_result(), World::range, GPUShadeInput::rgb, GPUMaterial::scene, Material::shade_flag, Material::spec, GPUShadeInput::spec, GPUShadeResult::spec, GPUShadeInput::vcol, WO_MIST, and Scene::world.
Referenced by GPU_blender_material(), and gpu_shader_material().
| GPUNodeLink* GPU_socket | ( | GPUNodeStack * | sock | ) |
Definition at line 1221 of file gpu_codegen.c.
References GPU_node_link_create(), link(), and GPUNodeLink::socket.
Referenced by gpu_shader_math(), and gpu_shader_vect_math().
| int GPU_stack_link | ( | GPUMaterial * | mat, |
| const char * | name, | ||
| GPUNodeStack * | in, | ||
| GPUNodeStack * | out, | ||
| ... | |||
| ) |
Definition at line 1275 of file gpu_codegen.c.
References FUNCTION_QUAL_IN, GPU_lookup_function(), gpu_material_add_node(), GPU_node_begin(), GPU_node_end(), gpu_node_input_link(), gpu_node_input_socket(), GPU_node_output(), GPU_NONE, i, link(), GPUNodeLink::socket, and GPUNodeStack::type.
Referenced by gpu_shader_camera(), gpu_shader_combrgb(), gpu_shader_curve_rgb(), gpu_shader_curve_vec(), gpu_shader_geom(), gpu_shader_hue_sat(), gpu_shader_invert(), gpu_shader_mapping(), gpu_shader_math(), gpu_shader_mix_rgb(), gpu_shader_normal(), gpu_shader_output(), gpu_shader_rgb(), gpu_shader_rgbtobw(), gpu_shader_seprgb(), gpu_shader_squeeze(), gpu_shader_texture(), gpu_shader_valtorgb(), gpu_shader_value(), and gpu_shader_vect_math().
| GPUNodeLink* GPU_texture | ( | int | size, |
| float * | pixels | ||
| ) |
Definition at line 1200 of file gpu_codegen.c.
References GPU_node_link_create(), link(), GPUNodeLink::ptr1, size(), GPUNodeLink::texture, and GPUNodeLink::texturesize.
Referenced by do_colorband_blend(), gpu_shader_curve_rgb(), gpu_shader_curve_vec(), gpu_shader_valtorgb(), and lamp_get_visibility().
| GPUNodeLink* GPU_uniform | ( | float * | num | ) |
Definition at line 1168 of file gpu_codegen.c.
References GPU_node_link_create(), link(), NULL, GPUNodeLink::ptr1, and GPUNodeLink::ptr2.
Referenced by do_colorband_blend(), do_material_tex(), gpu_get_input_link(), GPU_shadeinput_set(), gpu_shader_mapping(), gpu_shader_normal(), gpu_shader_rgb(), gpu_shader_value(), GPU_shaderesult_set(), lamp_get_visibility(), and shade_one_light().