brightness multiplied by fade and opacity

This commit is contained in:
ElonOlsson
2022-04-15 10:42:48 -04:00
parent ab6f10e423
commit 6a51d3c748
2 changed files with 4 additions and 4 deletions
@@ -451,7 +451,7 @@ void RenderableTimeVaryingVolume::update(const UpdateData&) {
_raycaster->setVolumeTexture(nullptr);
}
_raycaster->setStepSize(_stepSize);
_raycaster->setBrightness(_brightness);
_raycaster->setBrightness(_brightness * opacity());
_raycaster->setRNormalization(_rNormalization);
_raycaster->setRUpperBound(_rUpperBound);
}
+3 -3
View File
@@ -33,7 +33,7 @@ uniform vec2 clipOffsets_#{id}[8];
uniform float brightness_#{id} = 1.0;
// unitless factor that multiplies with the brightness [0,1] to achieve desired visuals.
const float sampling_interval_reference_factor = 500.0;
const float SamplingIntervalReferenceFactor = 500.0;
// Normalization factor x for radius r [0, 1].
// value *= 1/(r^x)
@@ -79,8 +79,8 @@ void sample#{id}(vec3 samplePos, vec3 dir, inout vec3 accumulatedColor,
vec3 backColor = color.rgb;
vec3 backAlpha = color.aaa;
backColor *= stepSize * brightness_#{id} * sampling_interval_reference_factor * clipAlpha;
backAlpha *= stepSize * brightness_#{id} * sampling_interval_reference_factor * clipAlpha;
backColor *= stepSize * brightness_#{id} * SamplingIntervalReferenceFactor * clipAlpha;
backAlpha *= stepSize * brightness_#{id} * SamplingIntervalReferenceFactor * clipAlpha;
backColor = clamp(backColor, 0.0, 1.0);
backAlpha = clamp(backAlpha, 0.0, 1.0);