Commit fac4d6b3 authored by schultezub's avatar schultezub
Browse files

* introduced RaycastingProcessor::_jitterStepSizeMultiplier

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@262 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 0d12f058
......@@ -52,6 +52,7 @@ namespace TUMVis {
, _transferFunction("transferFunction", "Transfer Function", new SimpleTransferFunction(256))
, _samplingStepSize("samplingStepSize", "Sampling Step Size", .1f, 0.001f, 1.f)
, _jitterEntryPoints("jitterEntryPoints", "Jitter Entry Points", true)
, _jitterStepSizeMultiplier("jitterStepSizeMultiplier", "Jitter Step Size Multiplier", .5f, .1f, 1.f)
, _fragmentShaderFilename(fragmentShaderFileName)
, _shader(0)
, _bindEntryExitDepthTextures(bindEntryExitDepthTextures)
......@@ -63,6 +64,7 @@ namespace TUMVis {
addProperty(&_transferFunction);
addProperty(&_samplingStepSize);
addProperty(&_jitterEntryPoints);
addProperty(&_jitterStepSizeMultiplier);
}
RaycastingProcessor::~RaycastingProcessor() {
......@@ -100,6 +102,7 @@ namespace TUMVis {
_shader->setIgnoreUniformLocationError(true);
_shader->setUniform("_viewportSizeRCP", 1.f / tgt::vec2(_renderTargetSize.getValue()));
_shader->setUniform("_jitterEntryPoints", _jitterEntryPoints.getValue());
_shader->setUniform("_jitterStepSizeMultiplier", _jitterStepSizeMultiplier.getValue());
_shader->setUniform("_samplingStepSize", _samplingStepSize.getValue());
const tgt::Camera& cam = _camera.getValue();
......
......@@ -103,6 +103,7 @@ namespace TUMVis {
TransferFunctionProperty _transferFunction; ///< Transfer function
FloatProperty _samplingStepSize; ///< Ray casting step size
BoolProperty _jitterEntryPoints; ///< Flag whether to jitter the entry points
FloatProperty _jitterStepSizeMultiplier; ///< Step size multiplier for entry points jitter
protected:
/**
......
......@@ -33,6 +33,7 @@
uniform vec2 _viewportSizeRCP;
uniform bool _jitterEntryPoints;
uniform float _jitterStepSizeMultiplier;
uniform Texture2D _entryPoints; // ray entry points
uniform Texture2D _exitPoints; // ray exit points
......@@ -61,7 +62,7 @@ vec4 raycastDRR(in vec3 entryPoint, in vec3 exitPoint) {
direction = normalize(direction);
if (_jitterEntryPoints)
jitterEntryPoint(entryPoint, direction, _samplingStepSize);
jitterEntryPoint(entryPoint, direction, _samplingStepSize * _jitterStepSizeMultiplier);
while (t < tend) {
vec3 samplePosition = entryPoint.rgb + t * direction;
......
......@@ -33,6 +33,7 @@
uniform vec2 _viewportSizeRCP;
uniform bool _jitterEntryPoints;
uniform float _jitterStepSizeMultiplier;
uniform Texture2D _entryPoints; // ray entry points
uniform Texture2D _entryPointsDepth; // ray entry points depth
......@@ -62,7 +63,7 @@ vec4 performRaycasting(in vec3 entryPoint, in vec3 exitPoint, in vec2 texCoords)
direction = normalize(direction);
if (_jitterEntryPoints)
jitterEntryPoint(entryPoint, direction, _samplingStepSize);
jitterEntryPoint(entryPoint, direction, _samplingStepSize * _jitterStepSizeMultiplier);
while (t < tend) {
vec3 samplePosition = entryPoint.rgb + t * direction;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment