Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_material.h
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
| struct GPULamp; | struct GPULamp; | ||||
| struct PreviewImage; | struct PreviewImage; | ||||
| struct World; | struct World; | ||||
| typedef struct GPUNode GPUNode; | typedef struct GPUNode GPUNode; | ||||
| typedef struct GPUNodeLink GPUNodeLink; | typedef struct GPUNodeLink GPUNodeLink; | ||||
| typedef struct GPUMaterial GPUMaterial; | typedef struct GPUMaterial GPUMaterial; | ||||
| typedef struct GPULamp GPULamp; | typedef struct GPULamp GPULamp; | ||||
| typedef struct GPUParticleInfo GPUParticleInfo; | |||||
| /* Functions to create GPU Materials nodes */ | /* Functions to create GPU Materials nodes */ | ||||
| typedef enum GPUType { | typedef enum GPUType { | ||||
| /* The value indicates the number of elements in each type */ | /* The value indicates the number of elements in each type */ | ||||
| GPU_NONE = 0, | GPU_NONE = 0, | ||||
| GPU_FLOAT = 1, | GPU_FLOAT = 1, | ||||
| GPU_VEC2 = 2, | GPU_VEC2 = 2, | ||||
| Show All 12 Lines | typedef enum GPUBuiltin { | ||||
| GPU_OBJECT_MATRIX = (1 << 1), | GPU_OBJECT_MATRIX = (1 << 1), | ||||
| GPU_INVERSE_VIEW_MATRIX = (1 << 2), | GPU_INVERSE_VIEW_MATRIX = (1 << 2), | ||||
| GPU_INVERSE_OBJECT_MATRIX = (1 << 3), | GPU_INVERSE_OBJECT_MATRIX = (1 << 3), | ||||
| GPU_VIEW_POSITION = (1 << 4), | GPU_VIEW_POSITION = (1 << 4), | ||||
| GPU_VIEW_NORMAL = (1 << 5), | GPU_VIEW_NORMAL = (1 << 5), | ||||
| GPU_OBCOLOR = (1 << 6), | GPU_OBCOLOR = (1 << 6), | ||||
| GPU_AUTO_BUMPSCALE = (1 << 7), | GPU_AUTO_BUMPSCALE = (1 << 7), | ||||
| GPU_CAMERA_TEXCO_FACTORS = (1 << 8), | GPU_CAMERA_TEXCO_FACTORS = (1 << 8), | ||||
| GPU_PARTICLE_SCALAR_PROPS = (1 << 9), | |||||
| GPU_PARTICLE_LOCATION = (1 << 10), | |||||
| GPU_PARTICLE_VELOCITY = (1 << 11), | |||||
| GPU_PARTICLE_ANG_VELOCITY = (1 << 12), | |||||
| } GPUBuiltin; | } GPUBuiltin; | ||||
| typedef enum GPUOpenGLBuiltin { | typedef enum GPUOpenGLBuiltin { | ||||
| GPU_MATCAP_NORMAL = 1, | GPU_MATCAP_NORMAL = 1, | ||||
| GPU_COLOR = 2, | GPU_COLOR = 2, | ||||
| } GPUOpenGLBuiltin; | } GPUOpenGLBuiltin; | ||||
| typedef enum GPUMatType { | typedef enum GPUMatType { | ||||
| ▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | |||||
| GPUNodeLink *GPU_uniform(float *num); | GPUNodeLink *GPU_uniform(float *num); | ||||
| GPUNodeLink *GPU_dynamic_uniform(float *num, GPUDynamicType dynamictype, void *data); | GPUNodeLink *GPU_dynamic_uniform(float *num, GPUDynamicType dynamictype, void *data); | ||||
| GPUNodeLink *GPU_image(struct Image *ima, struct ImageUser *iuser, bool is_data); | GPUNodeLink *GPU_image(struct Image *ima, struct ImageUser *iuser, bool is_data); | ||||
| GPUNodeLink *GPU_image_preview(struct PreviewImage *prv); | GPUNodeLink *GPU_image_preview(struct PreviewImage *prv); | ||||
| GPUNodeLink *GPU_texture(int size, float *pixels); | GPUNodeLink *GPU_texture(int size, float *pixels); | ||||
| GPUNodeLink *GPU_dynamic_texture(struct GPUTexture *tex, GPUDynamicType dynamictype, void *data); | GPUNodeLink *GPU_dynamic_texture(struct GPUTexture *tex, GPUDynamicType dynamictype, void *data); | ||||
| GPUNodeLink *GPU_builtin(GPUBuiltin builtin); | GPUNodeLink *GPU_builtin(GPUBuiltin builtin); | ||||
| GPUNodeLink *GPU_opengl_builtin(GPUOpenGLBuiltin builtin); | GPUNodeLink *GPU_opengl_builtin(GPUOpenGLBuiltin builtin); | ||||
| void GPU_node_link_set_type(GPUNodeLink *link, GPUType type); | |||||
| bool GPU_link(GPUMaterial *mat, const char *name, ...); | bool GPU_link(GPUMaterial *mat, const char *name, ...); | ||||
| bool GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...); | bool GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...); | ||||
| void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link); | void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link); | ||||
| void GPU_material_enable_alpha(GPUMaterial *material); | void GPU_material_enable_alpha(GPUMaterial *material); | ||||
| GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4]); | GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4]); | ||||
| /* High level functions to create and use GPU materials */ | /* High level functions to create and use GPU materials */ | ||||
| GPUMaterial *GPU_material_world(struct Scene *scene, struct World *wo); | GPUMaterial *GPU_material_world(struct Scene *scene, struct World *wo); | ||||
| GPUMaterial *GPU_material_from_blender(struct Scene *scene, struct Material *ma); | GPUMaterial *GPU_material_from_blender(struct Scene *scene, struct Material *ma); | ||||
| GPUMaterial *GPU_material_matcap(struct Scene *scene, struct Material *ma); | GPUMaterial *GPU_material_matcap(struct Scene *scene, struct Material *ma); | ||||
| void GPU_material_free(struct ListBase *gpumaterial); | void GPU_material_free(struct ListBase *gpumaterial); | ||||
| void GPU_materials_free(void); | void GPU_materials_free(void); | ||||
| bool GPU_lamp_override_visible(GPULamp *lamp, struct SceneRenderLayer *srl, struct Material *ma); | bool GPU_lamp_override_visible(GPULamp *lamp, struct SceneRenderLayer *srl, struct Material *ma); | ||||
| void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time, int mipmap, float viewmat[4][4], float viewinv[4][4], float cameraborder[4], bool scenelock); | void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time, int mipmap, float viewmat[4][4], float viewinv[4][4], float cameraborder[4], bool scenelock); | ||||
| void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[4][4], float obcol[4], float autobumpscale); | void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[4][4], float obcol[4], float autobumpscale, GPUParticleInfo *pi); | ||||
| void GPU_material_unbind(GPUMaterial *material); | void GPU_material_unbind(GPUMaterial *material); | ||||
| bool GPU_material_bound(GPUMaterial *material); | bool GPU_material_bound(GPUMaterial *material); | ||||
| struct Scene *GPU_material_scene(GPUMaterial *material); | struct Scene *GPU_material_scene(GPUMaterial *material); | ||||
| GPUMatType GPU_Material_get_type(GPUMaterial *material); | GPUMatType GPU_Material_get_type(GPUMaterial *material); | ||||
| void GPU_material_vertex_attributes(GPUMaterial *material, | void GPU_material_vertex_attributes(GPUMaterial *material, | ||||
| struct GPUVertexAttribs *attrib); | struct GPUVertexAttribs *attrib); | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
| GPUNodeLink *GPU_lamp_get_data(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **col, GPUNodeLink **lv, GPUNodeLink **dist, GPUNodeLink **shadow, GPUNodeLink **energy); | GPUNodeLink *GPU_lamp_get_data(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **col, GPUNodeLink **lv, GPUNodeLink **dist, GPUNodeLink **shadow, GPUNodeLink **energy); | ||||
| /* World */ | /* World */ | ||||
| void GPU_mist_update_enable(short enable); | void GPU_mist_update_enable(short enable); | ||||
| void GPU_mist_update_values(int type, float start, float dist, float inten, float color[3]); | void GPU_mist_update_values(int type, float start, float dist, float inten, float color[3]); | ||||
| void GPU_horizon_update_color(float color[3]); | void GPU_horizon_update_color(float color[3]); | ||||
| void GPU_ambient_update_color(float color[3]); | void GPU_ambient_update_color(float color[3]); | ||||
| typedef struct GPUParticleInfo | |||||
| { | |||||
| float scalprops[4]; | |||||
| float location[3]; | |||||
| float velocity[3]; | |||||
| float angular_velocity[3]; | |||||
| } GPUParticleInfo; | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||
| #endif /*__GPU_MATERIAL_H__*/ | #endif /*__GPU_MATERIAL_H__*/ | ||||