Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_material.c
| Context not available. | |||||
| int obcolloc, obautobumpscaleloc; | int obcolloc, obautobumpscaleloc; | ||||
| int cameratexcofacloc; | int cameratexcofacloc; | ||||
| int partscalarpropsloc; | |||||
| int partcoloc; | |||||
| int partvel; | |||||
| int partangvel; | |||||
| ListBase lamps; | ListBase lamps; | ||||
| bool bound; | bool bound; | ||||
| }; | }; | ||||
| Context not available. | |||||
| material->obautobumpscaleloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_AUTO_BUMPSCALE)); | material->obautobumpscaleloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_AUTO_BUMPSCALE)); | ||||
| if (material->builtins & GPU_CAMERA_TEXCO_FACTORS) | if (material->builtins & GPU_CAMERA_TEXCO_FACTORS) | ||||
| material->cameratexcofacloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_CAMERA_TEXCO_FACTORS)); | material->cameratexcofacloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_CAMERA_TEXCO_FACTORS)); | ||||
| if (material->builtins & GPU_PARTICLE_SCALAR_PROPS) | |||||
| material->partscalarpropsloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_PARTICLE_SCALAR_PROPS)); | |||||
| if (material->builtins & GPU_PARTICLE_LOCATION) | |||||
| material->partcoloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_PARTICLE_LOCATION)); | |||||
| if (material->builtins & GPU_PARTICLE_VELOCITY) | |||||
| material->partvel = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_PARTICLE_VELOCITY)); | |||||
| if (material->builtins & GPU_PARTICLE_ANG_VELOCITY) | |||||
| material->partangvel = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_PARTICLE_ANG_VELOCITY)); | |||||
| return 1; | return 1; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| 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) | ||||
| { | { | ||||
| if (material->pass) { | if (material->pass) { | ||||
| GPUShader *shader = GPU_pass_shader(material->pass); | GPUShader *shader = GPU_pass_shader(material->pass); | ||||
| Context not available. | |||||
| if (material->builtins & GPU_AUTO_BUMPSCALE) { | if (material->builtins & GPU_AUTO_BUMPSCALE) { | ||||
| GPU_shader_uniform_vector(shader, material->obautobumpscaleloc, 1, 1, &autobumpscale); | GPU_shader_uniform_vector(shader, material->obautobumpscaleloc, 1, 1, &autobumpscale); | ||||
| } | } | ||||
| if (material->builtins & GPU_PARTICLE_SCALAR_PROPS) { | |||||
| GPU_shader_uniform_vector(shader, material->partscalarpropsloc, 4, 1, pi->scalprops); | |||||
| } | |||||
| if (material->builtins & GPU_PARTICLE_LOCATION) { | |||||
| GPU_shader_uniform_vector(shader, material->partcoloc, 3, 1, pi->location); | |||||
| } | |||||
| if (material->builtins & GPU_PARTICLE_VELOCITY) { | |||||
| GPU_shader_uniform_vector(shader, material->partvel, 3, 1, pi->velocity); | |||||
| } | |||||
| if (material->builtins & GPU_PARTICLE_ANG_VELOCITY) { | |||||
| GPU_shader_uniform_vector(shader, material->partangvel, 3, 1, pi->angular_velocity); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||