Blender V2.61 - r43446
|
#include <math.h>
#include <string.h>
#include "GL/glew.h"
#include "MEM_guardedalloc.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_world_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BKE_anim.h"
#include "BKE_colortools.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_scene.h"
#include "BKE_texture.h"
#include "IMB_imbuf_types.h"
#include "GPU_extensions.h"
#include "GPU_material.h"
#include "gpu_codegen.h"
Go to the source code of this file.
Definition in file gpu_material.c.
typedef enum DynMatProperty DynMatProperty |
enum DynMatProperty |
Definition at line 71 of file gpu_material.c.
static void add_to_diffuse | ( | GPUMaterial * | mat, |
Material * | ma, | ||
GPUShadeInput * | shi, | ||
GPUNodeLink * | is, | ||
GPUNodeLink * | rgb, | ||
GPUNodeLink ** | diff | ||
) | [static] |
Definition at line 526 of file gpu_material.c.
References do_colorband_blend(), GameData::flag, GAME_GLSL_NO_RAMPS, Scene::gm, GPU_link(), MA_RAMP_COL, MA_RAMP_IN_ENERGY, MA_RAMP_IN_NOR, MA_RAMP_IN_RESULT, MA_RAMP_IN_SHADER, Material::mode, Material::ramp_col, Material::rampblend_col, Material::rampfac_col, Material::rampin_col, GPUShadeInput::rgb, GPUMaterial::scene, GPUShadeInput::view, and GPUShadeInput::vn.
Referenced by shade_one_light().
static void add_user_list | ( | ListBase * | list, |
void * | data | ||
) | [static] |
Definition at line 611 of file gpu_material.c.
References BLI_addtail(), LinkData::data, data, link(), and MEM_callocN().
Referenced by shade_one_light().
static void do_colorband_blend | ( | GPUMaterial * | mat, |
ColorBand * | coba, | ||
GPUNodeLink * | fac, | ||
float | rampfac, | ||
int | type, | ||
GPUNodeLink * | incol, | ||
GPUNodeLink ** | outcol | ||
) | [static] |
Definition at line 490 of file gpu_material.c.
References colorband_table_RGBA(), GPU_link(), GPU_texture(), GPU_uniform(), ramp_blend(), and size().
Referenced by add_to_diffuse(), do_specular_ramp(), ramp_diffuse_result(), and ramp_spec_result().
static void do_material_tex | ( | GPUShadeInput * | shi | ) | [static] |
(texco_uv && strcmp(mtex->uvname, lastuvname) == 0)) {
Definition at line 894 of file gpu_material.c.
References GPUShadeInput::alpha, MTex::alphafac, GPUShadeInput::amb, MTex::ambfac, BKE_image_get_ibuf(), MTex::blendtype, CD_MTFACE, CD_ORCO, CD_TANGENT, MTex::colfac, MTex::colspecfac, MTex::def_var, MTex::difffac, GPUShadeInput::emit, MTex::emitfac, fabsf, GameData::flag, GAME_GLSL_NO_EXTRA_TEX, Scene::gm, GPU_attribute(), GPU_AUTO_BUMPSCALE, GPU_bicubic_bump_support(), GPU_builtin(), gpu_do_color_management(), GPU_image(), GPU_INVERSE_OBJECT_MATRIX, GPU_INVERSE_VIEW_MATRIX, GPU_link(), GPU_link_changed(), GPU_OBJECT_MATRIX, GPU_uniform(), GPU_VIEW_MATRIX, GPU_VIEW_NORMAL, GPU_VIEW_POSITION, GPUShadeInput::gpumat, GPUShadeInput::har, MTex::hardfac, Tex::ima, Tex::imaflag, Tex::iuser, MAP_ALPHA, MAP_AMB, MAP_COL, MAP_COLSPEC, MAP_EMIT, MAP_HAR, MAP_NORM, MAP_REF, MAP_SPEC, MAP_VARS, MTex::mapto, GPUShadeInput::mat, MAX2, MAX_MTEX, MIN2, Material::mtex, MTEX_3TAP_BUMP, MTEX_5TAP_BUMP, MTEX_BICUBIC_BUMP, MTEX_BUMP_OBJECTSPACE, MTEX_BUMP_TEXTURESPACE, MTEX_NEGATIVE, MTEX_NSPACE_TANGENT, MTEX_RGBTOINT, MTEX_STENCIL, MTex::norfac, MTex::normapspace, NULL, MTex::ofs, MTex::r, GPUShadeInput::ref, GPUShadeInput::refl, GPUShadeInput::rgb, GPUMaterial::scene, Material::septex, MTex::size, GPUShadeInput::spec, MTex::specfac, GPUShadeInput::specrgb, sqrtf, MTex::tex, TEX_DERIVATIVEMAP, TEX_IMAGE, TEX_NORMALMAP, TEX_RGB, TEX_USEALPHA, MTex::texco, TEXCO_GLOB, TEXCO_NORM, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_REFL, TEXCO_TANGENT, TEXCO_UV, MTex::texflag, texture_rgb_blend(), texture_value_blend(), Tex::type, MTex::uvname, GPUShadeInput::view, GPUShadeInput::vn, ImBuf::x, and ImBuf::y.
Referenced by displace_render_vert(), GPU_shaderesult_set(), RE_sample_material_color(), shade_color(), and shade_lamp_loop().
static void do_specular_ramp | ( | GPUShadeInput * | shi, |
GPUNodeLink * | is, | ||
GPUNodeLink * | t, | ||
GPUNodeLink ** | spec | ||
) | [static] |
Definition at line 579 of file gpu_material.c.
References do_colorband_blend(), GPU_link(), GPUShadeInput::gpumat, MA_RAMP_IN_ENERGY, MA_RAMP_IN_NOR, MA_RAMP_IN_RESULT, MA_RAMP_IN_SHADER, GPUShadeInput::mat, Material::ramp_spec, Material::rampblend_spec, Material::rampfac_spec, Material::rampin_spec, GPUShadeInput::specrgb, GPUShadeInput::view, and GPUShadeInput::vn.
Referenced by shade_one_light().
static GPUNodeLink* GPU_blender_material | ( | GPUMaterial * | mat, |
Material * | ma | ||
) | [static] |
Definition at line 1421 of file gpu_material.c.
References GPUShadeResult::combined, GPU_shadeinput_set(), and GPU_shaderesult_set().
Referenced by GPU_material_from_blender().
static int gpu_do_color_management | ( | GPUMaterial * | mat | ) | [static] |
Definition at line 377 of file gpu_material.c.
References RenderData::color_mgt_flag, GameData::flag, GAME_GLSL_NO_COLOR_MANAGEMENT, Scene::gm, Scene::r, R_COLOR_MANAGEMENT, and GPUMaterial::scene.
Referenced by do_material_tex(), GPU_material_from_blender(), and GPU_shadeinput_set().
void GPU_free_shader_export | ( | GPUShaderExport * | shader | ) |
Definition at line 1879 of file gpu_material.c.
References GPUShaderExport::attributes, BLI_freelistN(), ListBase::first, GPUShaderExport::fragment, MEM_freeN(), GPUInputUniform::next, NULL, GPUInputUniform::texpixels, GPUShaderExport::uniforms, and GPUShaderExport::vertex.
Referenced by GPU_export_shader().
void GPU_lamp_free | ( | Object * | ob | ) |
Definition at line 1632 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().
static void gpu_lamp_from_blender | ( | Scene * | scene, |
Object * | ob, | ||
Object * | par, | ||
Lamp * | la, | ||
GPULamp * | lamp | ||
) | [static] |
Definition at line 1519 of file gpu_material.c.
References angle(), GPULamp::att1, Lamp::att1, GPULamp::att2, Lamp::att2, Lamp::b, Lamp::bias, GPULamp::bias, Lamp::bufsize, Lamp::clipend, GPULamp::clipend, Lamp::clipsta, GPULamp::col, cosf, Lamp::curfalloff, GPULamp::curfalloff, GPULamp::d, GPULamp::dist, Lamp::dist, GPULamp::energy, Lamp::energy, Lamp::falloff_type, GPULamp::falloff_type, Lamp::g, GPU_lamp_update(), Lamp::k, GPULamp::k, GPULamp::la, LA_HALO, LA_NEG, Object::lay, M_PI, Lamp::mode, GPULamp::mode, GPULamp::ob, OB_RESTRICT_RENDER, Object::obmat, GPULamp::par, perspective_m4(), Lamp::r, Object::restrictflag, saacos(), GPULamp::scene, sinf, GPULamp::size, GPULamp::spotbl, Lamp::spotblend, GPULamp::spotsi, Lamp::spotsize, GPULamp::type, Lamp::type, and GPULamp::winmat.
Referenced by GPU_lamp_from_blender().
Definition at line 1585 of file gpu_material.c.
References BLI_addtail(), Object::data, LinkData::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 1659 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 1666 of file gpu_material.c.
References copy_m4_m4(), GPULamp::fb, GPU_framebuffer_texture_bind(), GPU_texture_opengl_height(), GPU_texture_opengl_width(), invert_m4_m4(), mult_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 1701 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().
static void gpu_lamp_shadow_free | ( | GPULamp * | lamp | ) | [static] |
Definition at line 1573 of file gpu_material.c.
References GPULamp::fb, GPU_framebuffer_free(), GPU_texture_free(), NULL, and GPULamp::tex.
Referenced by GPU_lamp_free(), and GPU_lamp_from_blender().
int GPU_lamp_shadow_layer | ( | GPULamp * | lamp | ) |
Definition at line 1708 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 1493 of file gpu_material.c.
References GPULamp::co, copy_m4_m4(), copy_v3_v3(), GPULamp::hide, GPULamp::imat, invert_m4_m4(), GPULamp::lay, normalize_m4(), GPULamp::obmat, and GPULamp::vec.
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 1509 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().
void gpu_material_add_node | ( | GPUMaterial * | material, |
GPUNode * | node | ||
) |
Definition at line 370 of file gpu_material.c.
References BLI_addtail(), and GPUMaterial::nodes.
Referenced by GPU_link(), GPU_stack_link(), and GPU_stack_link_mute().
GPUBlendMode GPU_material_alpha_blend | ( | GPUMaterial * | material, |
float | obcol[4] | ||
) |
Definition at line 362 of file gpu_material.c.
References GPUMaterial::alpha, GPU_BLEND_ALPHA, GPU_BLEND_SOLID, and GPUMaterial::obcolalpha.
Referenced by GPU_begin_object_materials(), and LOD_QuadricEditor::Update().
void GPU_material_bind | ( | GPUMaterial * | material, |
int | oblay, | ||
int | viewlay, | ||
double | time, | ||
int | mipmap | ||
) |
Definition at line 252 of file gpu_material.c.
References GPUMaterial::bound, GPULamp::col, copy_v3_v3(), 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, and GPUMaterial::pass.
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], | ||
float | autobumpscale | ||
) |
Definition at line 277 of file gpu_material.c.
References GPUMaterial::builtins, CLAMP(), GPULamp::co, copy_v3_v3(), copy_v4_v4(), 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_AUTO_BUMPSCALE, 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_v3(), mul_mat3_m4_v3(), mult_m4_m4m4(), negate_v3(), LinkData::next, normalize_v3(), GPUMaterial::obautobumpscaleloc, GPUMaterial::obcolloc, GPUMaterial::obmatloc, GPUMaterial::pass, GPULamp::persmat, GPULamp::vec, and GPUMaterial::viewmatloc.
Referenced by GPU_enable_material(), and LOD_QuadricEditor::Update().
int GPU_material_bound | ( | GPUMaterial * | material | ) |
Definition at line 341 of file gpu_material.c.
References GPUMaterial::bound.
Referenced by LOD_QuadricEditor::Update().
static GPUMaterial* GPU_material_construct_begin | ( | Material * | ma | ) | [static] |
Definition at line 141 of file gpu_material.c.
References GPUMaterial::ma, and MEM_callocN().
Referenced by GPU_material_from_blender().
static int GPU_material_construct_end | ( | GPUMaterial * | material | ) | [static] |
Definition at line 188 of file gpu_material.c.
References GPUMaterial::attribs, GPUMaterial::builtins, GPU_AUTO_BUMPSCALE, GPU_builtin_name(), GPU_generate_pass(), GPU_INVERSE_OBJECT_MATRIX, GPU_INVERSE_VIEW_MATRIX, gpu_material_set_attrib_id(), GPU_OBCOLOR, GPU_OBJECT_MATRIX, GPU_pass_shader(), GPU_shader_get_uniform(), GPU_VIEW_MATRIX, Material::id, GPUMaterial::invobmatloc, GPUMaterial::invviewmatloc, GPUMaterial::ma, ID::name, GPUMaterial::nodes, GPUMaterial::obautobumpscaleloc, GPUMaterial::obcolloc, GPUMaterial::obmatloc, GPUMaterial::outlink, GPUMaterial::pass, and GPUMaterial::viewmatloc.
Referenced by GPU_material_from_blender().
void GPU_material_enable_alpha | ( | GPUMaterial * | material | ) |
Definition at line 357 of file gpu_material.c.
References GPUMaterial::alpha.
Referenced by GPU_shaderesult_set().
void GPU_material_free | ( | Material * | ma | ) |
Definition at line 223 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 ED_node_set_active(), free_material(), GPU_codegen_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 | ( | Scene * | scene, |
Material * | ma | ||
) |
Definition at line 1432 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, scene_use_new_shading_nodes(), and Material::use_nodes.
Referenced by GPU_begin_object_materials(), GPU_disable_material(), GPU_enable_material(), GPU_shader_export(), RAS_OpenGLRasterizer::IndexPrimitivesInternal(), and BL_BlenderShader::ReloadMaterial().
void GPU_material_output_link | ( | GPUMaterial * | material, |
GPUNodeLink * | link | ||
) |
Definition at line 351 of file gpu_material.c.
References link(), and GPUMaterial::outlink.
Referenced by GPU_material_from_blender(), gpu_shader_output(), and node_shader_gpu_output_material().
static void gpu_material_set_attrib_id | ( | GPUMaterial * | material | ) | [static] |
Definition at line 150 of file gpu_material.c.
References GPUVertexAttribs::attribid, GPUMaterial::attribs, BLI_snprintf(), GPUVertexAttribs::glindex, GPU_pass_shader(), GPU_shader_get_attribute(), GPUVertexAttribs::layer, GPUMaterial::pass, and GPUVertexAttribs::totlayer.
Referenced by GPU_material_construct_end().
void GPU_material_unbind | ( | GPUMaterial * | material | ) |
Definition at line 333 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, |
GPUVertexAttribs * | attribs | ||
) |
Definition at line 346 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 1476 of file gpu_material.c.
References defmaterial, G, GPU_lamp_free(), GPU_material_free(), Material::id, Object::id, and ID::next.
void GPU_shadeinput_set | ( | GPUMaterial * | mat, |
Material * | ma, | ||
GPUShadeInput * | shi | ||
) |
Definition at line 1293 of file gpu_material.c.
References Material::alpha, GPUShadeInput::alpha, GPUShadeInput::amb, Material::amb, CD_MCOL, GPUShadeInput::emit, Material::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, GPUShadeInput::spec, Material::spec, Material::specr, GPUShadeInput::specrgb, GPUShadeInput::vcol, GPUShadeInput::view, and GPUShadeInput::vn.
Referenced by GPU_blender_material(), and gpu_shader_material().
GPUShaderExport* GPU_shader_export | ( | struct Scene * | scene, |
struct Material * | ma | ||
) |
Definition at line 1718 of file gpu_material.c.
References GPUVertexAttribs::attribid, GPUMaterial::attribs, GPUShaderExport::attributes, BLI_addtail(), BLI_snprintf(), BLI_strdup(), BLI_strncpy(), GPUMaterial::builtins, CD_MCOL, CD_MTFACE, CD_ORCO, CD_TANGENT, GPUInputUniform::datatype, GPUInputAttribute::datatype, GPUInput::dynamicdata, GPUInput::dynamictype, ListBase::first, GPUShaderExport::fragment, GPUPass::fragmentcode, GPUVertexAttribs::glindex, GPU_AUTO_BUMPSCALE, GPU_builtin_name(), GPU_DATA_16F, GPU_DATA_1F, GPU_DATA_1I, GPU_DATA_2F, GPU_DATA_3F, GPU_DATA_4F, GPU_DATA_4UB, GPU_DATA_9F, GPU_DATA_NONE, GPU_DYNAMIC_LAMP_FIRST, GPU_DYNAMIC_LAMP_LAST, GPU_DYNAMIC_NONE, GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE, GPU_DYNAMIC_OBJECT_COLOR, GPU_DYNAMIC_OBJECT_IMAT, GPU_DYNAMIC_OBJECT_MAT, GPU_DYNAMIC_OBJECT_VIEWIMAT, GPU_DYNAMIC_OBJECT_VIEWMAT, GPU_DYNAMIC_SAMPLER_2DBUFFER, GPU_DYNAMIC_SAMPLER_2DIMAGE, GPU_DYNAMIC_SAMPLER_2DSHADOW, GPU_glsl_support(), GPU_INVERSE_OBJECT_MATRIX, GPU_INVERSE_VIEW_MATRIX, GPU_material_from_blender(), GPU_OBCOLOR, GPU_OBJECT_MATRIX, GPU_SHADOW2D, GPU_TEX2D, GPU_texture_opengl_bindcode(), GPU_texture_opengl_height(), GPU_texture_opengl_width(), GPU_VIEW_MATRIX, i, GPUInput::ima, GPUInputUniform::image, GPUPass::inputs, GPUInputUniform::lamp, GPUVertexAttribs::layer, GPUPass::libcode, MEM_callocN(), MEM_freeN(), MEM_mallocN(), GPUInputAttribute::name, GPUVertexAttribs::name, GPUInput::next, NULL, GPUInputAttribute::number, GPUMaterial::pass, GPUInput::shadername, strlen(), GPUInput::tex, GPUInput::texid, GPUInputUniform::texnumber, GPUInputUniform::texpixels, GPUInputUniform::texsize, GPUInput::textype, GPUVertexAttribs::totlayer, GPUInput::type, GPUInputUniform::type, GPUVertexAttribs::type, GPUInputAttribute::type, GPUShaderExport::uniforms, GPUInputUniform::varname, GPUInputAttribute::varname, GPUShaderExport::vertex, and GPUPass::vertexcode.
Referenced by GPU_export_shader().
void GPU_shaderesult_set | ( | GPUShadeInput * | shi, |
GPUShadeResult * | shr | ||
) |
Definition at line 1318 of file gpu_material.c.
References Material::alpha, GPUShadeInput::alpha, GPUShadeResult::alpha, GPUShadeInput::amb, Material::amb, World::ambb, World::ambg, World::ambr, GPUShadeResult::combined, GPUShadeResult::diff, do_material_tex(), GPUShadeInput::emit, Material::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, logf, 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, powf, ramp_diffuse_result(), ramp_spec_result(), World::range, GPUShadeInput::rgb, GPUMaterial::scene, Material::shade_flag, GPUShadeInput::spec, Material::spec, GPUShadeResult::spec, GPUShadeInput::vcol, WO_MIST, and Scene::world.
Referenced by GPU_blender_material(), and gpu_shader_material().
static GPUNodeLink* lamp_get_visibility | ( | GPUMaterial * | mat, |
GPULamp * | lamp, | ||
GPUNodeLink ** | lv, | ||
GPUNodeLink ** | dist | ||
) | [static] |
Definition at line 383 of file gpu_material.c.
References GPULamp::att1, GPULamp::att2, GPULamp::curfalloff, curvemapping_table_RGBA(), GPULamp::dist, DYN_LAMP_CO, DYN_LAMP_IMAT, DYN_LAMP_VEC, GPULamp::dynco, GPULamp::dynimat, GPUMaterial::dynproperty, GPULamp::dynvec, GPULamp::falloff_type, GPU_builtin(), GPU_DYNAMIC_LAMP_DYNCO, GPU_DYNAMIC_LAMP_DYNIMAT, GPU_DYNAMIC_LAMP_DYNVEC, GPU_dynamic_uniform(), GPU_link(), GPU_texture(), GPU_uniform(), GPU_VIEW_POSITION, LA_AREA, LA_FALLOFF_CONSTANT, LA_FALLOFF_CURVE, LA_FALLOFF_INVLINEAR, LA_FALLOFF_INVSQUARE, LA_FALLOFF_SLIDERS, LA_HEMI, LA_SPHERE, LA_SPOT, LA_SQUARE, LA_SUN, GPULamp::mode, GPULamp::ob, size(), GPULamp::spotbl, GPULamp::spotsi, and GPULamp::type.
Referenced by shade_lamp_loop_only_shadow(), shade_one_light(), and vol_shade_one_lamp().
static void material_lights | ( | GPUShadeInput * | shi, |
GPUShadeResult * | shr | ||
) | [static] |
Definition at line 770 of file gpu_material.c.
References copy_m4_m4(), ListBase::first, free_object_duplilist(), GPU_lamp_from_blender(), GPUShadeInput::gpumat, DupliObject::mat, DupliObject::next, NULL, DupliObject::ob, OB_DUPLI, OB_LAMP, Base::object, object_duplilist(), Object::obmat, GPUMaterial::scene, SETLOOPER, shade_one_light(), Object::transflag, and Object::type.
Referenced by GPU_shaderesult_set().
static void ramp_blend | ( | GPUMaterial * | mat, |
GPUNodeLink * | fac, | ||
GPUNodeLink * | col1, | ||
GPUNodeLink * | col2, | ||
int | type, | ||
GPUNodeLink ** | outcol | ||
) | [static] |
Definition at line 480 of file gpu_material.c.
References GPU_link(), and names.
static void ramp_diffuse_result | ( | GPUShadeInput * | shi, |
GPUNodeLink ** | diff | ||
) | [static] |
Definition at line 508 of file gpu_material.c.
References do_colorband_blend(), GameData::flag, GAME_GLSL_NO_RAMPS, Scene::gm, GPU_link(), GPUShadeInput::gpumat, MA_RAMP_IN_RESULT, GPUShadeInput::mat, Material::ramp_col, Material::rampblend_col, Material::rampfac_col, Material::rampin_col, and GPUMaterial::scene.
Referenced by GPU_shaderesult_set().
static void ramp_spec_result | ( | GPUShadeInput * | shi, |
GPUNodeLink ** | spec | ||
) | [static] |
Definition at line 564 of file gpu_material.c.
References do_colorband_blend(), GameData::flag, GAME_GLSL_NO_RAMPS, Scene::gm, GPU_link(), GPUShadeInput::gpumat, MA_RAMP_IN_RESULT, GPUShadeInput::mat, Material::ramp_spec, Material::rampblend_spec, Material::rampfac_spec, Material::rampin_spec, and GPUMaterial::scene.
Referenced by GPU_shaderesult_set().
static void shade_one_light | ( | GPUShadeInput * | shi, |
GPUShadeResult * | shr, | ||
GPULamp * | lamp | ||
) | [static] |
Definition at line 618 of file gpu_material.c.
References add_to_diffuse(), add_user_list(), GPULamp::bias, Material::darkness, GPUShadeResult::diff, Material::diff_shader, do_specular_ramp(), DYN_LAMP_CO, DYN_LAMP_PERSMAT, DYN_LAMP_VEC, GPULamp::dynco, GPULamp::dyncol, GPULamp::dynenergy, GPULamp::dynpersmat, GPUMaterial::dynproperty, GPULamp::dynvec, GameData::flag, GAME_GLSL_NO_SHADERS, GAME_GLSL_NO_SHADOWS, Scene::gm, GPU_builtin(), GPU_DYNAMIC_LAMP_DYNCO, GPU_DYNAMIC_LAMP_DYNCOL, GPU_DYNAMIC_LAMP_DYNENERGY, GPU_DYNAMIC_LAMP_DYNPERSMAT, GPU_DYNAMIC_LAMP_DYNVEC, GPU_DYNAMIC_SAMPLER_2DSHADOW, GPU_dynamic_texture(), GPU_dynamic_uniform(), GPU_lamp_has_shadow_buffer(), GPU_link(), GPU_link_changed(), GPU_uniform(), GPU_VIEW_POSITION, GPUShadeInput::gpumat, GPUShadeInput::har, i, GPULamp::k, LA_AREA, LA_HEMI, LA_NO_DIFF, LA_NO_SPEC, LA_ONLYSHADOW, lamp_get_visibility(), GPUMaterial::lamps, GPUMaterial::ma, MA_CUBIC, MA_DIFF_FRESNEL, MA_DIFF_MINNAERT, MA_DIFF_ORENNAYAR, MA_DIFF_TOON, MA_RAMP_SPEC, MA_SHADOW, MA_SPEC_BLINN, MA_SPEC_COOKTORR, MA_SPEC_PHONG, MA_SPEC_WARDISO, GPUShadeInput::mat, GPULamp::materials, Material::mode, GPULamp::mode, NULL, GPULamp::ob, Material::param, Material::ref, GPUShadeInput::refl, Material::refrac, GPUShadeInput::rgb, Material::rms, Material::roughness, GPUMaterial::scene, Material::shade_flag, spec(), Material::spec, GPUShadeInput::spec, GPUShadeResult::spec, Material::spec_shader, GPUShadeInput::specrgb, GPULamp::tex, GPULamp::type, GPUShadeInput::view, and GPUShadeInput::vn.
Referenced by material_lights().
static void texture_rgb_blend | ( | GPUMaterial * | mat, |
GPUNodeLink * | tex, | ||
GPUNodeLink * | out, | ||
GPUNodeLink * | fact, | ||
GPUNodeLink * | facg, | ||
int | blendtype, | ||
GPUNodeLink ** | in | ||
) | [static] |
Definition at line 807 of file gpu_material.c.
References GPU_link(), MTEX_ADD, MTEX_BLEND, MTEX_BLEND_COLOR, MTEX_BLEND_HUE, MTEX_BLEND_SAT, MTEX_BLEND_VAL, MTEX_DARK, MTEX_DIFF, MTEX_DIV, MTEX_LIGHT, MTEX_MUL, MTEX_OVERLAY, MTEX_SCREEN, and MTEX_SUB.
Referenced by do_lamp_tex(), do_material_tex(), do_sky_tex(), do_volume_tex(), and RE_inithalo_particle().
static void texture_value_blend | ( | GPUMaterial * | mat, |
GPUNodeLink * | tex, | ||
GPUNodeLink * | out, | ||
GPUNodeLink * | fact, | ||
GPUNodeLink * | facg, | ||
int | blendtype, | ||
GPUNodeLink ** | in | ||
) | [static] |
Definition at line 858 of file gpu_material.c.
References GPU_link(), MTEX_ADD, MTEX_BLEND, MTEX_DARK, MTEX_DIFF, MTEX_DIV, MTEX_LIGHT, MTEX_MUL, MTEX_SCREEN, and MTEX_SUB.
Referenced by do_material_tex(), do_sky_tex(), do_volume_tex(), get_cpa_texture(), psys_get_texture(), and RE_inithalo_particle().