Differential D6951 Diff 22142 source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
| Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | #ifdef USE_COBA | ||||
| scattering = tval.rgb * 1500.0; | scattering = tval.rgb * 1500.0; | ||||
| extinction = max(1e-4, tval.a * 50.0); | extinction = max(1e-4, tval.a * 50.0); | ||||
| #else | #else | ||||
| float flame = sample_volume_texture(flameTexture, co).r; | float flame = sample_volume_texture(flameTexture, co).r; | ||||
| vec4 emission = texture(flameColorTexture, flame); | vec4 emission = texture(flameColorTexture, flame); | ||||
| float shadows = sample_volume_texture(shadowTexture, co).r; | float shadows = sample_volume_texture(shadowTexture, co).r; | ||||
| vec4 density = sample_volume_texture(densityTexture, co); /* rgb: color, a: density */ | vec4 density = sample_volume_texture(densityTexture, co); /* rgb: color, a: density */ | ||||
| scattering = density.rgb * (density.a * densityScale) * activeColor; | scattering = density.rgb * densityScale; | ||||
| extinction = max(1e-4, dot(scattering, vec3(0.33333))); | extinction = max(1e-4, dot(scattering, vec3(0.33333))); | ||||
| scattering *= activeColor; | |||||
| /* Scale shadows in log space and clamp them to avoid completely black shadows. */ | /* Scale shadows in log space and clamp them to avoid completely black shadows. */ | ||||
| scattering *= exp(clamp(log(shadows) * densityScale * 0.1, -2.5, 0.0)) * M_PI; | scattering *= exp(clamp(log(shadows) * densityScale * 0.1, -2.5, 0.0)) * M_PI; | ||||
| /* 800 is arbitrary and here to mimic old viewport. TODO make it a parameter */ | /* 800 is arbitrary and here to mimic old viewport. TODO make it a parameter */ | ||||
| scattering += pow(emission.rgb, vec3(2.2)) * emission.a * 800.0; | scattering += pow(emission.rgb, vec3(2.2)) * emission.a * 800.0; | ||||
| #endif | #endif | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines | |||||