Merge remote-tracking branch 'origin/master' into blender2.8

This commit is contained in:
Dalai Felinto
2016-11-02 10:48:06 +01:00
195 changed files with 6126 additions and 3391 deletions

View File

@@ -8,10 +8,17 @@ uniform float density_scale;
uniform sampler3D soot_texture;
uniform sampler3D shadow_texture;
#ifdef USE_COBA
uniform sampler1D transfer_texture;
uniform sampler3D color_band_texture;
#endif
void main()
{
/* compute color and density from volume texture */
vec4 soot = texture3D(soot_texture, coords);
#ifndef USE_COBA
vec3 soot_color;
if (soot.a != 0) {
soot_color = active_color * soot.rgb / soot.a;
@@ -31,6 +38,11 @@ void main()
/* premultiply alpha */
vec4 color = vec4(soot_alpha * soot_color, soot_alpha);
#else
float color_band = texture3D(color_band_texture, coords).r;
vec4 transfer_function = texture1D(transfer_texture, color_band);
vec4 color = transfer_function * density_scale;
#endif
gl_FragColor = color;
}