diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-12-28 19:30:58 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-12-28 19:30:58 +0300 |
commit | 6ecab6dd8e48d564a2b43e0e81e79d079e8b4c77 (patch) | |
tree | 618e2d24eb34a05a81f726dd52eb2b7468e9296d /source/blender/gpu/intern/gpu_material.c | |
parent | 605263177b8eea24c1449e4dbf0138175ec3dddf (diff) |
Revert particle system and point cache removal in blender2.8 branch.
This reverts commit 5aa19be91263a249ffae75573e3b32f24269d890 and b4a721af694817fa921b119df83d33ede7d7fed0.
Due to postponement of particle system rewrite it was decided to put particle code
back into the 2.8 branch for the time being.
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 3e8f0baf7b0..56b7af787e7 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -117,6 +117,11 @@ struct GPUMaterial { int obcolloc, obautobumpscaleloc; int cameratexcofacloc; + int partscalarpropsloc; + int partcoloc; + int partvel; + int partangvel; + ListBase lamps; bool bound; @@ -255,6 +260,14 @@ static int GPU_material_construct_end(GPUMaterial *material, const char *passnam material->obautobumpscaleloc = GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_AUTO_BUMPSCALE)); if (material->builtins & 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; } else { @@ -387,7 +400,7 @@ void GPU_material_bind( void GPU_material_bind_uniforms( GPUMaterial *material, float obmat[4][4], float viewmat[4][4], float obcol[4], - float autobumpscale) + float autobumpscale, GPUParticleInfo *pi) { if (material->pass) { GPUShader *shader = GPU_pass_shader(material->pass); @@ -424,6 +437,18 @@ void GPU_material_bind_uniforms( if (material->builtins & GPU_AUTO_BUMPSCALE) { 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); + } } } |