Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_material.h
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | typedef enum eGPUBuiltin { | ||||
| GPU_CAMERA_TEXCO_FACTORS = (1 << 8), | GPU_CAMERA_TEXCO_FACTORS = (1 << 8), | ||||
| GPU_PARTICLE_SCALAR_PROPS = (1 << 9), | GPU_PARTICLE_SCALAR_PROPS = (1 << 9), | ||||
| GPU_PARTICLE_LOCATION = (1 << 10), | GPU_PARTICLE_LOCATION = (1 << 10), | ||||
| GPU_PARTICLE_VELOCITY = (1 << 11), | GPU_PARTICLE_VELOCITY = (1 << 11), | ||||
| GPU_PARTICLE_ANG_VELOCITY = (1 << 12), | GPU_PARTICLE_ANG_VELOCITY = (1 << 12), | ||||
| GPU_LOC_TO_VIEW_MATRIX = (1 << 13), | GPU_LOC_TO_VIEW_MATRIX = (1 << 13), | ||||
| GPU_INVERSE_LOC_TO_VIEW_MATRIX = (1 << 14), | GPU_INVERSE_LOC_TO_VIEW_MATRIX = (1 << 14), | ||||
| GPU_OBJECT_INFO = (1 << 15), | GPU_OBJECT_INFO = (1 << 15), | ||||
| GPU_VOLUME_DENSITY = (1 << 16), | GPU_BARYCENTRIC_TEXCO = (1 << 16), | ||||
| GPU_VOLUME_COLOR = (1 << 17), | GPU_BARYCENTRIC_DIST = (1 << 17), | ||||
| GPU_VOLUME_FLAME = (1 << 18), | GPU_WORLD_NORMAL = (1 << 18), | ||||
| GPU_VOLUME_TEMPERATURE = (1 << 19), | |||||
| GPU_BARYCENTRIC_TEXCO = (1 << 20), | |||||
| GPU_BARYCENTRIC_DIST = (1 << 21), | |||||
| GPU_WORLD_NORMAL = (1 << 22), | |||||
| } eGPUBuiltin; | } eGPUBuiltin; | ||||
| typedef enum eGPUMatFlag { | typedef enum eGPUMatFlag { | ||||
| GPU_MATFLAG_DIFFUSE = (1 << 0), | GPU_MATFLAG_DIFFUSE = (1 << 0), | ||||
| GPU_MATFLAG_GLOSSY = (1 << 1), | GPU_MATFLAG_GLOSSY = (1 << 1), | ||||
| GPU_MATFLAG_REFRACT = (1 << 2), | GPU_MATFLAG_REFRACT = (1 << 2), | ||||
| GPU_MATFLAG_SSS = (1 << 3), | GPU_MATFLAG_SSS = (1 << 3), | ||||
| } eGPUMatFlag; | } eGPUMatFlag; | ||||
| Show All 25 Lines | |||||
| GPUNodeLink *GPU_constant(const float *num); | GPUNodeLink *GPU_constant(const float *num); | ||||
| GPUNodeLink *GPU_uniform(const float *num); | GPUNodeLink *GPU_uniform(const float *num); | ||||
| GPUNodeLink *GPU_attribute(GPUMaterial *mat, CustomDataType type, const char *name); | GPUNodeLink *GPU_attribute(GPUMaterial *mat, CustomDataType type, const char *name); | ||||
| GPUNodeLink *GPU_image(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); | GPUNodeLink *GPU_image(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); | ||||
| GPUNodeLink *GPU_image_tiled(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); | GPUNodeLink *GPU_image_tiled(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); | ||||
| GPUNodeLink *GPU_image_tiled_mapping(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); | GPUNodeLink *GPU_image_tiled_mapping(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); | ||||
| GPUNodeLink *GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *layer); | GPUNodeLink *GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *layer); | ||||
| GPUNodeLink *GPU_volume_grid(GPUMaterial *mat, const char *name); | |||||
| GPUNodeLink *GPU_builtin(eGPUBuiltin builtin); | GPUNodeLink *GPU_builtin(eGPUBuiltin builtin); | ||||
| bool GPU_link(GPUMaterial *mat, const char *name, ...); | bool GPU_link(GPUMaterial *mat, const char *name, ...); | ||||
| bool GPU_stack_link(GPUMaterial *mat, | bool GPU_stack_link(GPUMaterial *mat, | ||||
| struct bNode *node, | struct bNode *node, | ||||
| const char *name, | const char *name, | ||||
| GPUNodeStack *in, | GPUNodeStack *in, | ||||
| GPUNodeStack *out, | GPUNodeStack *out, | ||||
| Show All 17 Lines | |||||
| GPUMaterial *GPU_material_from_nodetree_find(struct ListBase *gpumaterials, | GPUMaterial *GPU_material_from_nodetree_find(struct ListBase *gpumaterials, | ||||
| const void *engine_type, | const void *engine_type, | ||||
| int options); | int options); | ||||
| GPUMaterial *GPU_material_from_nodetree(struct Scene *scene, | GPUMaterial *GPU_material_from_nodetree(struct Scene *scene, | ||||
| struct Material *ma, | struct Material *ma, | ||||
| struct bNodeTree *ntree, | struct bNodeTree *ntree, | ||||
| struct ListBase *gpumaterials, | struct ListBase *gpumaterials, | ||||
| const void *engine_type, | const void *engine_type, | ||||
| int options, | const int options, | ||||
| const bool is_volume_shader, | |||||
| const char *vert_code, | const char *vert_code, | ||||
| const char *geom_code, | const char *geom_code, | ||||
| const char *frag_lib, | const char *frag_lib, | ||||
| const char *defines, | const char *defines, | ||||
| const char *name); | const char *name); | ||||
| void GPU_material_compile(GPUMaterial *mat); | void GPU_material_compile(GPUMaterial *mat); | ||||
| void GPU_material_free(struct ListBase *gpumaterial); | void GPU_material_free(struct ListBase *gpumaterial); | ||||
| void GPU_materials_free(struct Main *bmain); | void GPU_materials_free(struct Main *bmain); | ||||
| struct Scene *GPU_material_scene(GPUMaterial *material); | struct Scene *GPU_material_scene(GPUMaterial *material); | ||||
| struct GPUPass *GPU_material_get_pass(GPUMaterial *material); | struct GPUPass *GPU_material_get_pass(GPUMaterial *material); | ||||
| struct ListBase *GPU_material_get_inputs(GPUMaterial *material); | |||||
| struct Material *GPU_material_get_material(GPUMaterial *material); | struct Material *GPU_material_get_material(GPUMaterial *material); | ||||
| eGPUMaterialStatus GPU_material_status(GPUMaterial *mat); | eGPUMaterialStatus GPU_material_status(GPUMaterial *mat); | ||||
| struct GPUUniformBuffer *GPU_material_uniform_buffer_get(GPUMaterial *material); | struct GPUUniformBuffer *GPU_material_uniform_buffer_get(GPUMaterial *material); | ||||
| void GPU_material_uniform_buffer_create(GPUMaterial *material, ListBase *inputs); | void GPU_material_uniform_buffer_create(GPUMaterial *material, ListBase *inputs); | ||||
| struct GPUUniformBuffer *GPU_material_create_sss_profile_ubo(void); | struct GPUUniformBuffer *GPU_material_create_sss_profile_ubo(void); | ||||
| bool GPU_material_use_domain_surface(GPUMaterial *mat); | bool GPU_material_has_surface_output(GPUMaterial *mat); | ||||
| bool GPU_material_use_domain_volume(GPUMaterial *mat); | bool GPU_material_has_volume_output(GPUMaterial *mat); | ||||
| bool GPU_material_is_volume_shader(GPUMaterial *mat); | |||||
| void GPU_material_flag_set(GPUMaterial *mat, eGPUMatFlag flag); | void GPU_material_flag_set(GPUMaterial *mat, eGPUMatFlag flag); | ||||
| bool GPU_material_flag_get(GPUMaterial *mat, eGPUMatFlag flag); | bool GPU_material_flag_get(GPUMaterial *mat, eGPUMatFlag flag); | ||||
| void GPU_pass_cache_init(void); | void GPU_pass_cache_init(void); | ||||
| void GPU_pass_cache_garbage_collect(void); | void GPU_pass_cache_garbage_collect(void); | ||||
| void GPU_pass_cache_free(void); | void GPU_pass_cache_free(void); | ||||
| Show All 13 Lines | typedef struct GPUMaterialTexture { | ||||
| struct Image *ima; | struct Image *ima; | ||||
| struct ImageUser *iuser; | struct ImageUser *iuser; | ||||
| struct GPUTexture **colorband; | struct GPUTexture **colorband; | ||||
| char sampler_name[32]; /* Name of sampler in GLSL. */ | char sampler_name[32]; /* Name of sampler in GLSL. */ | ||||
| char tiled_mapping_name[32]; /* Name of tile mapping sampler in GLSL. */ | char tiled_mapping_name[32]; /* Name of tile mapping sampler in GLSL. */ | ||||
| int users; | int users; | ||||
| } GPUMaterialTexture; | } GPUMaterialTexture; | ||||
| typedef struct GPUMaterialVolumeGrid { | |||||
| struct GPUMaterialVolumeGrid *next, *prev; | |||||
| char *name; | |||||
| char sampler_name[32]; /* Name of sampler in GLSL. */ | |||||
| int users; | |||||
| } GPUMaterialVolumeGrid; | |||||
| ListBase GPU_material_attributes(GPUMaterial *material); | ListBase GPU_material_attributes(GPUMaterial *material); | ||||
| ListBase GPU_material_textures(GPUMaterial *material); | ListBase GPU_material_textures(GPUMaterial *material); | ||||
| ListBase GPU_material_volume_grids(GPUMaterial *material); | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||
| #endif /*__GPU_MATERIAL_H__*/ | #endif /*__GPU_MATERIAL_H__*/ | ||||