Commit 5cbfe490 authored by Jakob Weiss's avatar Jakob Weiss
Browse files

Merge branch 'advanced-raycasting' into campvis-nx

parents e20da19c cd918f81
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ namespace campvis {
        return new TFGeometry1D(keyPoints);
    }

    TFGeometry1D* TFGeometry1D::crateRamp(const cgt::vec2& interval, const cgt::col4& color) {
    TFGeometry1D* TFGeometry1D::createRamp(const cgt::vec2& interval, const cgt::col4& color) {
        return createQuad(interval, cgt::col4(color.xyz(), 0), cgt::col4(color.xyz(), 255));
    }

+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ namespace campvis {
         * \param   color       Color for ramp
         * \return  A TFGeometry1D modelling a ramp with two KeyPoints.
         */
        static TFGeometry1D* crateRamp(const cgt::vec2& interval, const cgt::col4& color);
        static TFGeometry1D* createRamp(const cgt::vec2& interval, const cgt::col4& color);

        /**
         * Creates a diverging color map of two diverging colors blending over white.
+19 −1
Original line number Diff line number Diff line
@@ -172,3 +172,21 @@ float getPhongShadingIntensity(in vec3 position, in LightSource light, in vec3 c
    #endif
    return (toReturn.x + toReturn.y + toReturn.z) / 3.0;
}

vec3 calculateContourShading(in vec3 position, in vec3 camera, in vec3 normal, in vec3 materialColor, in vec3 outlineColor, in float contourExponent) {
    float outlineStrength = 1. - pow(clamp(-dot(normalize(normal), normalize(position - camera)), 0, 1), contourExponent);
    return mix(materialColor, outlineColor, outlineStrength);
}

vec4 calculateContourShading2(in vec3 position, in vec3 camera, in vec3 normal, in vec4 materialColor, in vec4 outlineColor, in float contourExponent) {
    float outlineStrength = 1. - pow(clamp(dot(normal, normalize(camera - position)), 0, 1), contourExponent);

    return outlineStrength * outlineColor;
}

void blendUnder(inout vec4 colorAbove, in vec4 colorBelow)
{
    colorAbove.rgb = colorAbove.rgb + colorBelow.rgb * colorBelow.a  * (1.0 - colorAbove.a);
    colorAbove.a = colorAbove.a + (1.0 -colorAbove.a) * colorBelow.a;
}
+32 −0
Original line number Diff line number Diff line
# CMake file for vis module

SET(ThisModStatus EXPERIMENTAL)

IF(${ModuleEnabled})
	# Source files:
    FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
        modules/advancedraycasting/decorators/*.cpp
		modules/advancedraycasting/pipelines/*.cpp
		modules/advancedraycasting/processors/*.cpp
		modules/advancedraycasting/tools/*.cpp
		modules/advancedraycasting/*.cpp
	)

	# Header files (including GLSL files so that they'll appear in VS projects)
	FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
		modules/advancedraycasting/glsl/*.frag
		modules/advancedraycasting/glsl/*.geom
        modules/advancedraycasting/glsl/*.vert
        modules/advancedraycasting/glsl/*.comp
        modules/advancedraycasting/decorators/*.h
        modules/advancedraycasting/pipelines/*.h
		modules/advancedraycasting/processors/*.h
		modules/advancedraycasting/tools/*.h
	)

	LIST(APPEND ThisModShaderDirectories "modules/vis/glsl")
	SET(ThisModDependencies base vis)
ENDIF(${ModuleEnabled})

SET(ThisModStatus STABLE)
SET(ThisModExternalDependencies FALSE)
+45 −0
Original line number Diff line number Diff line
// ================================================================================================
// 
// This file is part of the CAMPVis Software Framework.
// 
// If not explicitly stated otherwise: Copyright (C) 2012-2015, all rights reserved,
//      Christian Schulte zu Berge <christian.szb@in.tum.de>
//      Chair for Computer Aided Medical Procedures
//      Technische Universitaet Muenchen
//      Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
// 
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
// 
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 
// except in compliance with the License. You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software distributed under the 
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
// either express or implied. See the License for the specific language governing permissions 
// and limitations under the License.
// 
// ================================================================================================

#include "core/pipeline/pipelinefactory.h"
#include "core/pipeline/processorfactory.h"

#include "modules/advancedraycasting/pipelines/preintegratedraycasterdemo.h"

#include "modules/advancedraycasting/processors/ambientvolumegenerator.h"
#include "modules/advancedraycasting/processors/laoraycaster.h"
#include "modules/advancedraycasting/processors/preintegratedraycaster.h"
#include "modules/advancedraycasting/processors/tfpreintegrator.h"

namespace campvis {

    // explicitly instantiate templates to register the pipelines
    template class PipelineRegistrar<PreintegratedRayCasterDemo>;

    template class SmartProcessorRegistrar<AmbientVolumeGenerator>;
    template class SmartProcessorRegistrar<LAORaycaster>;
    template class SmartProcessorRegistrar<PreintegratedRaycaster>;
    template class SmartProcessorRegistrar<TFPreIntegrator>;

}
Loading