Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_material.h
| Show All 37 Lines | |||||
| #include "BLI_sys_types.h" /* for bool */ | #include "BLI_sys_types.h" /* for bool */ | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
| struct Image; | struct Image; | ||||
| struct ImageUser; | struct ImageUser; | ||||
| struct ListBase; | |||||
| struct Material; | struct Material; | ||||
| struct Object; | struct Object; | ||||
| struct Scene; | struct Scene; | ||||
| struct SceneRenderLayer; | struct SceneRenderLayer; | ||||
| struct GPUVertexAttribs; | struct GPUVertexAttribs; | ||||
| struct GPUNode; | struct GPUNode; | ||||
| struct GPUNodeLink; | struct GPUNodeLink; | ||||
| struct GPUNodeStack; | struct GPUNodeStack; | ||||
| struct GPUMaterial; | struct GPUMaterial; | ||||
| struct GPUTexture; | struct GPUTexture; | ||||
| struct GPUUniformBuffer; | |||||
| struct GPULamp; | struct GPULamp; | ||||
| struct PreviewImage; | struct PreviewImage; | ||||
| struct World; | struct World; | ||||
| struct bNodeTree; | struct bNodeTree; | ||||
| typedef struct GPUNode GPUNode; | typedef struct GPUNode GPUNode; | ||||
| typedef struct GPUNodeLink GPUNodeLink; | typedef struct GPUNodeLink GPUNodeLink; | ||||
| typedef struct GPUMaterial GPUMaterial; | typedef struct GPUMaterial GPUMaterial; | ||||
| ▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
| #define GPU_DYNAMIC_GROUP_MISC 0x00010000 | #define GPU_DYNAMIC_GROUP_MISC 0x00010000 | ||||
| #define GPU_DYNAMIC_GROUP_LAMP 0x00020000 | #define GPU_DYNAMIC_GROUP_LAMP 0x00020000 | ||||
| #define GPU_DYNAMIC_GROUP_OBJECT 0x00030000 | #define GPU_DYNAMIC_GROUP_OBJECT 0x00030000 | ||||
| #define GPU_DYNAMIC_GROUP_SAMPLER 0x00040000 | #define GPU_DYNAMIC_GROUP_SAMPLER 0x00040000 | ||||
| #define GPU_DYNAMIC_GROUP_MIST 0x00050000 | #define GPU_DYNAMIC_GROUP_MIST 0x00050000 | ||||
| #define GPU_DYNAMIC_GROUP_WORLD 0x00060000 | #define GPU_DYNAMIC_GROUP_WORLD 0x00060000 | ||||
| #define GPU_DYNAMIC_GROUP_MAT 0x00070000 | #define GPU_DYNAMIC_GROUP_MAT 0x00070000 | ||||
| #define GPU_DYNAMIC_UBO 0x00080000 | |||||
| typedef enum GPUDynamicType { | typedef enum GPUDynamicType { | ||||
| GPU_DYNAMIC_NONE = 0, | GPU_DYNAMIC_NONE = 0, | ||||
| GPU_DYNAMIC_OBJECT_VIEWMAT = 1 | GPU_DYNAMIC_GROUP_OBJECT, | GPU_DYNAMIC_OBJECT_VIEWMAT = 1 | GPU_DYNAMIC_GROUP_OBJECT, | ||||
| GPU_DYNAMIC_OBJECT_MAT = 2 | GPU_DYNAMIC_GROUP_OBJECT, | GPU_DYNAMIC_OBJECT_MAT = 2 | GPU_DYNAMIC_GROUP_OBJECT, | ||||
| GPU_DYNAMIC_OBJECT_VIEWIMAT = 3 | GPU_DYNAMIC_GROUP_OBJECT, | GPU_DYNAMIC_OBJECT_VIEWIMAT = 3 | GPU_DYNAMIC_GROUP_OBJECT, | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | typedef enum GPUDynamicType { | ||||
| GPU_DYNAMIC_MAT_AMB = 7 | GPU_DYNAMIC_GROUP_MAT, | GPU_DYNAMIC_MAT_AMB = 7 | GPU_DYNAMIC_GROUP_MAT, | ||||
| GPU_DYNAMIC_MAT_ALPHA = 8 | GPU_DYNAMIC_GROUP_MAT, | GPU_DYNAMIC_MAT_ALPHA = 8 | GPU_DYNAMIC_GROUP_MAT, | ||||
| GPU_DYNAMIC_MAT_MIR = 9 | GPU_DYNAMIC_GROUP_MAT | GPU_DYNAMIC_MAT_MIR = 9 | GPU_DYNAMIC_GROUP_MAT | ||||
| } GPUDynamicType; | } GPUDynamicType; | ||||
| GPUNodeLink *GPU_attribute(CustomDataType type, const char *name); | GPUNodeLink *GPU_attribute(CustomDataType type, const char *name); | ||||
| 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_uniform_buffer(float *num, GPUType gputype); | |||||
| 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_cube_map(struct Image *ima, struct ImageUser *iuser, bool is_data); | GPUNodeLink *GPU_cube_map(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); | 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, ...); | ||||
| GPUNodeLink *GPU_uniformbuffer_link_in( | |||||
| struct GPUMaterial *mat, struct ListBase *sockets, | |||||
| struct GPUNodeStack *stack, GPUType gputype, const int index); | |||||
| GPUNodeLink *GPU_uniformbuffer_link_out( | |||||
| struct GPUMaterial *mat, struct ListBase *sockets, | |||||
| struct GPUNodeStack *stack, GPUType gputype, const int index); | |||||
| 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); | ||||
| GPUBuiltin GPU_get_material_builtins(GPUMaterial *material); | GPUBuiltin GPU_get_material_builtins(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); | ||||
| Show All 15 Lines | void GPU_material_bind_uniforms( | ||||
| GPUMaterial *material, float obmat[4][4], float viewmat[4][4], float obcol[4], | GPUMaterial *material, float obmat[4][4], float viewmat[4][4], float obcol[4], | ||||
| float autobumpscale, GPUParticleInfo *pi, float object_info[3]); | float autobumpscale, GPUParticleInfo *pi, float object_info[3]); | ||||
| 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); | ||||
| struct GPUPass *GPU_material_get_pass(GPUMaterial *material); | struct GPUPass *GPU_material_get_pass(GPUMaterial *material); | ||||
| struct GPUUniformBuffer *GPU_material_get_uniform_buffer(GPUMaterial *material); | |||||
| void GPU_material_create_uniform_buffer(GPUMaterial *material, struct ListBase *inputs); | |||||
| void GPU_material_uniform_buffer_tag_dirty(struct ListBase *gpumaterials); | |||||
| void GPU_material_vertex_attributes(GPUMaterial *material, | void GPU_material_vertex_attributes(GPUMaterial *material, | ||||
| struct GPUVertexAttribs *attrib); | struct GPUVertexAttribs *attrib); | ||||
| bool GPU_material_do_color_management(GPUMaterial *mat); | bool GPU_material_do_color_management(GPUMaterial *mat); | ||||
| bool GPU_material_use_new_shading_nodes(GPUMaterial *mat); | bool GPU_material_use_new_shading_nodes(GPUMaterial *mat); | ||||
| bool GPU_material_use_world_space_shading(GPUMaterial *mat); | bool GPU_material_use_world_space_shading(GPUMaterial *mat); | ||||
| /* Exported shading */ | /* Exported shading */ | ||||
| ▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines | |||||