Blender V2.61 - r43446
Classes | Typedefs | Enumerations | Functions

GPU_material.h File Reference

#include "DNA_listBase.h"

Go to the source code of this file.

Classes

struct  GPUNodeStack
struct  GPUShadeInput
struct  GPUShadeResult
struct  GPUInputUniform
struct  GPUInputAttribute
struct  GPUShaderExport

Typedefs

typedef struct GPUNode GPUNode
typedef struct GPUNodeLink GPUNodeLink
typedef struct GPUMaterial GPUMaterial
typedef struct GPULamp GPULamp
typedef enum GPUType GPUType
typedef enum GPUBuiltin GPUBuiltin
typedef enum GPUBlendMode GPUBlendMode
typedef struct GPUNodeStack GPUNodeStack
typedef struct GPUShadeInput GPUShadeInput
typedef struct GPUShadeResult GPUShadeResult
typedef enum GPUDynamicType GPUDynamicType
typedef enum GPUDataType GPUDataType
typedef struct GPUInputUniform GPUInputUniform
typedef struct GPUInputAttribute GPUInputAttribute
typedef struct GPUShaderExport GPUShaderExport

Enumerations

enum  GPUType {
  GPU_NONE = 0, GPU_FLOAT = 1, GPU_VEC2 = 2, GPU_VEC3 = 3,
  GPU_VEC4 = 4, GPU_MAT3 = 9, GPU_MAT4 = 16, GPU_TEX2D = 1002,
  GPU_SHADOW2D = 1003, GPU_ATTRIB = 3001
}
enum  GPUBuiltin {
  GPU_VIEW_MATRIX = 1, GPU_OBJECT_MATRIX = 2, GPU_INVERSE_VIEW_MATRIX = 4, GPU_INVERSE_OBJECT_MATRIX = 8,
  GPU_VIEW_POSITION = 16, GPU_VIEW_NORMAL = 32, GPU_OBCOLOR = 64, GPU_AUTO_BUMPSCALE = 128
}
enum  GPUBlendMode {
  GPU_BLEND_SOLID = 0, GPU_BLEND_ADD = 1, GPU_BLEND_ALPHA = 2, GPU_BLEND_CLIP = 4,
  GPU_BLEND_ALPHA_SORT = 8
}
enum  GPUDynamicType {
  GPU_DYNAMIC_NONE = 0, GPU_DYNAMIC_OBJECT_VIEWMAT = 1, GPU_DYNAMIC_OBJECT_MAT = 2, GPU_DYNAMIC_OBJECT_VIEWIMAT = 3,
  GPU_DYNAMIC_OBJECT_IMAT = 4, GPU_DYNAMIC_OBJECT_COLOR = 5, GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE = 15, GPU_DYNAMIC_LAMP_FIRST = 6,
  GPU_DYNAMIC_LAMP_DYNVEC = 6, GPU_DYNAMIC_LAMP_DYNCO = 7, GPU_DYNAMIC_LAMP_DYNIMAT = 8, GPU_DYNAMIC_LAMP_DYNPERSMAT = 9,
  GPU_DYNAMIC_LAMP_DYNENERGY = 10, GPU_DYNAMIC_LAMP_DYNCOL = 11, GPU_DYNAMIC_LAMP_LAST = 11, GPU_DYNAMIC_SAMPLER_2DBUFFER = 12,
  GPU_DYNAMIC_SAMPLER_2DIMAGE = 13, GPU_DYNAMIC_SAMPLER_2DSHADOW = 14
}
enum  GPUDataType {
  GPU_DATA_NONE = 0, GPU_DATA_1I = 1, GPU_DATA_1F = 2, GPU_DATA_2F = 3,
  GPU_DATA_3F = 4, GPU_DATA_4F = 5, GPU_DATA_9F = 6, GPU_DATA_16F = 7,
  GPU_DATA_4UB = 8
}

Functions

GPUNodeLinkGPU_attribute (int type, const char *name)
GPUNodeLinkGPU_uniform (float *num)
GPUNodeLinkGPU_dynamic_uniform (float *num, int dynamictype, void *data)
GPUNodeLinkGPU_image (struct Image *ima, struct ImageUser *iuser)
GPUNodeLinkGPU_texture (int size, float *pixels)
GPUNodeLinkGPU_dynamic_texture (struct GPUTexture *tex, int dynamictype, void *data)
GPUNodeLinkGPU_socket (GPUNodeStack *sock)
GPUNodeLinkGPU_builtin (GPUBuiltin builtin)
int GPU_link (GPUMaterial *mat, const char *name,...)
int GPU_stack_link (GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
int GPU_stack_link_mute (GPUMaterial *mat, const char *name, struct LinkInOutsMuteNode *mlnk)
void GPU_material_output_link (GPUMaterial *material, GPUNodeLink *link)
void GPU_material_enable_alpha (GPUMaterial *material)
GPUBlendMode GPU_material_alpha_blend (GPUMaterial *material, float obcol[4])
GPUMaterialGPU_material_from_blender (struct Scene *scene, struct Material *ma)
void GPU_material_free (struct Material *ma)
void GPU_materials_free (void)
void GPU_material_bind (GPUMaterial *material, int oblay, int viewlay, double time, int mipmap)
void GPU_material_bind_uniforms (GPUMaterial *material, float obmat[][4], float viewmat[][4], float viewinv[][4], float obcol[4], float autobumpscale)
void GPU_material_unbind (GPUMaterial *material)
int GPU_material_bound (GPUMaterial *material)
void GPU_material_vertex_attributes (GPUMaterial *material, struct GPUVertexAttribs *attrib)
void GPU_shadeinput_set (GPUMaterial *mat, struct Material *ma, GPUShadeInput *shi)
void GPU_shaderesult_set (GPUShadeInput *shi, GPUShadeResult *shr)
GPUShaderExportGPU_shader_export (struct Scene *scene, struct Material *ma)
void GPU_free_shader_export (GPUShaderExport *shader)
GPULampGPU_lamp_from_blender (struct Scene *scene, struct Object *ob, struct Object *par)
void GPU_lamp_free (struct Object *ob)
int GPU_lamp_has_shadow_buffer (GPULamp *lamp)
void GPU_lamp_shadow_buffer_bind (GPULamp *lamp, float viewmat[][4], int *winsize, float winmat[][4])
void GPU_lamp_shadow_buffer_unbind (GPULamp *lamp)
void GPU_lamp_update (GPULamp *lamp, int lay, int hide, float obmat[][4])
void GPU_lamp_update_colors (GPULamp *lamp, float r, float g, float b, float energy)
int GPU_lamp_shadow_layer (GPULamp *lamp)

Detailed Description

Definition in file GPU_material.h.


Typedef Documentation

typedef enum GPUBlendMode GPUBlendMode
typedef enum GPUBuiltin GPUBuiltin
typedef enum GPUDataType GPUDataType
typedef struct GPULamp GPULamp

Definition at line 62 of file GPU_material.h.

typedef struct GPUMaterial GPUMaterial

Definition at line 61 of file GPU_material.h.

typedef struct GPUNode GPUNode

Definition at line 59 of file GPU_material.h.

typedef struct GPUNodeLink GPUNodeLink

Definition at line 60 of file GPU_material.h.

typedef struct GPUNodeStack GPUNodeStack
typedef struct GPUShadeInput GPUShadeInput
typedef enum GPUType GPUType

Enumeration Type Documentation

Enumerator:
GPU_BLEND_SOLID 
GPU_BLEND_ADD 
GPU_BLEND_ALPHA 
GPU_BLEND_CLIP 
GPU_BLEND_ALPHA_SORT 

Definition at line 90 of file GPU_material.h.

enum GPUBuiltin
Enumerator:
GPU_VIEW_MATRIX 
GPU_OBJECT_MATRIX 
GPU_INVERSE_VIEW_MATRIX 
GPU_INVERSE_OBJECT_MATRIX 
GPU_VIEW_POSITION 
GPU_VIEW_NORMAL 
GPU_OBCOLOR 
GPU_AUTO_BUMPSCALE 

Definition at line 79 of file GPU_material.h.

Enumerator:
GPU_DATA_NONE 
GPU_DATA_1I 
GPU_DATA_1F 
GPU_DATA_2F 
GPU_DATA_3F 
GPU_DATA_4F 
GPU_DATA_9F 
GPU_DATA_16F 
GPU_DATA_4UB 

Definition at line 180 of file GPU_material.h.

Enumerator:
GPU_DYNAMIC_NONE 
GPU_DYNAMIC_OBJECT_VIEWMAT 
GPU_DYNAMIC_OBJECT_MAT 
GPU_DYNAMIC_OBJECT_VIEWIMAT 
GPU_DYNAMIC_OBJECT_IMAT 
GPU_DYNAMIC_OBJECT_COLOR 
GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE 
GPU_DYNAMIC_LAMP_FIRST 
GPU_DYNAMIC_LAMP_DYNVEC 
GPU_DYNAMIC_LAMP_DYNCO 
GPU_DYNAMIC_LAMP_DYNIMAT 
GPU_DYNAMIC_LAMP_DYNPERSMAT 
GPU_DYNAMIC_LAMP_DYNENERGY 
GPU_DYNAMIC_LAMP_DYNCOL 
GPU_DYNAMIC_LAMP_LAST 
GPU_DYNAMIC_SAMPLER_2DBUFFER 
GPU_DYNAMIC_SAMPLER_2DIMAGE 
GPU_DYNAMIC_SAMPLER_2DSHADOW 

Definition at line 159 of file GPU_material.h.

enum GPUType
Enumerator:
GPU_NONE 
GPU_FLOAT 
GPU_VEC2 
GPU_VEC3 
GPU_VEC4 
GPU_MAT3 
GPU_MAT4 
GPU_TEX2D 
GPU_SHADOW2D 
GPU_ATTRIB 

Definition at line 66 of file GPU_material.h.


Function Documentation

GPUNodeLink* GPU_attribute ( int  type,
const char *  name 
)
GPUNodeLink* GPU_builtin ( GPUBuiltin  builtin)
GPUNodeLink* GPU_dynamic_texture ( struct GPUTexture tex,
int  dynamictype,
void *  data 
)
GPUNodeLink* GPU_dynamic_uniform ( float *  num,
int  dynamictype,
void *  data 
)
void GPU_free_shader_export ( GPUShaderExport shader)
GPUNodeLink* GPU_image ( struct Image ima,
struct ImageUser iuser 
)
void GPU_lamp_free ( struct Object ob)
GPULamp* GPU_lamp_from_blender ( struct Scene scene,
struct Object ob,
struct Object par 
)
int GPU_lamp_has_shadow_buffer ( GPULamp lamp)
void GPU_lamp_shadow_buffer_bind ( GPULamp lamp,
float  viewmat[][4],
int *  winsize,
float  winmat[][4] 
)
void GPU_lamp_shadow_buffer_unbind ( GPULamp lamp)
int GPU_lamp_shadow_layer ( GPULamp lamp)
void GPU_lamp_update ( GPULamp lamp,
int  lay,
int  hide,
float  obmat[][4] 
)
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().

int GPU_link ( GPUMaterial mat,
const char *  name,
  ... 
)
GPUBlendMode GPU_material_alpha_blend ( GPUMaterial material,
float  obcol[4] 
)
void GPU_material_bind ( GPUMaterial material,
int  oblay,
int  viewlay,
double  time,
int  mipmap 
)
void GPU_material_bind_uniforms ( GPUMaterial material,
float  obmat[][4],
float  viewmat[][4],
float  viewinv[][4],
float  obcol[4],
float  autobumpscale 
)
int GPU_material_bound ( GPUMaterial material)

Definition at line 341 of file gpu_material.c.

References GPUMaterial::bound.

Referenced by LOD_QuadricEditor::Update().

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 ( struct Material ma)
GPUMaterial* GPU_material_from_blender ( struct Scene scene,
struct Material ma 
)
void GPU_material_output_link ( GPUMaterial material,
GPUNodeLink link 
)
void GPU_material_unbind ( GPUMaterial material)
void GPU_material_vertex_attributes ( GPUMaterial material,
struct GPUVertexAttribs attrib 
)
void GPU_materials_free ( void  )
void GPU_shadeinput_set ( GPUMaterial mat,
struct Material ma,
GPUShadeInput shi 
)
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 
)
GPUNodeLink* GPU_socket ( GPUNodeStack sock)

Definition at line 1141 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 1195 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(), GPUFunction::paramqual, GPUFunction::paramtype, GPUNodeLink::socket, GPUFunction::totparam, 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(), gpu_shader_vect_math(), node_shader_gpu_add_shader(), node_shader_gpu_bsdf_anisotropic(), node_shader_gpu_bsdf_diffuse(), node_shader_gpu_bsdf_glass(), node_shader_gpu_bsdf_glossy(), node_shader_gpu_bsdf_translucent(), node_shader_gpu_bsdf_transparent(), node_shader_gpu_bsdf_velvet(), node_shader_gpu_emission(), node_shader_gpu_fresnel(), node_shader_gpu_geometry(), node_shader_gpu_light_path(), node_shader_gpu_mix_shader(), node_shader_gpu_output_material(), node_shader_gpu_tex_checker(), node_shader_gpu_tex_coord(), node_shader_gpu_tex_environment(), node_shader_gpu_tex_gradient(), node_shader_gpu_tex_image(), node_shader_gpu_tex_magic(), node_shader_gpu_tex_musgrave(), node_shader_gpu_tex_noise(), node_shader_gpu_tex_sky(), node_shader_gpu_tex_voronoi(), and node_shader_gpu_tex_wave().

int GPU_stack_link_mute ( GPUMaterial mat,
const char *  name,
struct LinkInOutsMuteNode mlnk 
)
GPUNodeLink* GPU_texture ( int  size,
float *  pixels 
)
GPUNodeLink* GPU_uniform ( float *  num)