In January 2021 we will introduce a 10 GB quota for project repositories. Higher limits for individual projects will be available on request. Please see https://doku.lrz.de/display/PUBLIC/GitLab for more information.

* Added tgt::Shader::setUniform() overloads for unsigned integers

* Fixed SliceExtractor not rendering Y slice position correctly in XZ-plane mode
* Minor improvements in DataContainerInspector fragment shader and GlGradientVolumeGenerator
parent b15b50e3
......@@ -61,7 +61,21 @@ void main() {
else {
// render the corresponding slice
vec3 coord = vec3(ex_TexCoord.xy, (_sliceNumber * _3dTextureParams._sizeRCP.z) + (_3dTextureParams._sizeRCP.z / 2.0));
out_Color = lookupTF(_transferFunction, _transferFunctionParams, texture(_texture3d, coord).r);
vec4 texel = texture(_texture3d, coord);
if (_3dTextureParams._numChannels == 1) {
out_Color = lookupTF(_transferFunction, _transferFunctionParams, texel.r);
}
else if (_3dTextureParams._numChannels == 3) {
out_Color = vec4((abs(texel.rgb) - vec3(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x), 1.0);
}
else if (_3dTextureParams._numChannels == 4) {
out_Color = (abs(texel) - vec4(_transferFunctionParams._intensityDomain.x)) / (_transferFunctionParams._intensityDomain.y - _transferFunctionParams._intensityDomain.x);
}
else {
out_Color = vec4(0.1, 0.6, 1.0, 0.75);
}
//out_Color = lookupTF(_transferFunction, _transferFunctionParams, texture(_texture3d, coord).r);
}
}
else {
......
......@@ -863,6 +863,49 @@ bool Shader::setUniform(const string& name, GLint* v, int count) {
}
// Unsigned Integers
bool Shader::setUniform(const string& name, GLuint value) {
GLint l = getUniformLocation(name);
if (l == -1)
return false;
glUniform1ui(l, value);
return true;
}
bool Shader::setUniform(const string& name, GLuint v1, GLuint v2) {
GLint l = getUniformLocation(name);
if (l == -1)
return false;
glUniform2ui(l, v1, v2);
return true;
}
bool Shader::setUniform(const string& name, GLuint v1, GLuint v2, GLuint v3) {
GLint l = getUniformLocation(name);
if (l == -1)
return false;
glUniform3ui(l, v1, v2, v3);
return true;
}
bool Shader::setUniform(const string& name, GLuint v1, GLuint v2, GLuint v3, GLuint v4) {
GLint l = getUniformLocation(name);
if (l == -1)
return false;
glUniform4ui(l, v1, v2, v3, v4);
return true;
}
bool Shader::setUniform(const string& name, GLuint* v, int count) {
GLint l = getUniformLocation(name);
if (l == -1)
return false;
glUniform1uiv(l, count, v);
return true;
}
bool Shader::setUniform(const string& name, bool value) {
GLint l = getUniformLocation(name);
if (l == -1)
......
......@@ -262,6 +262,13 @@ public:
bool setUniform(const std::string& name, GLint v1, GLint v2, GLint v3, GLint v4);
bool setUniform(const std::string& name, GLint* v, int count);
// Unsigned Integers
bool setUniform(const std::string& name, GLuint value);
bool setUniform(const std::string& name, GLuint v1, GLuint v2);
bool setUniform(const std::string& name, GLuint v1, GLuint v2, GLuint v3);
bool setUniform(const std::string& name, GLuint v1, GLuint v2, GLuint v3, GLuint v4);
bool setUniform(const std::string& name, GLuint* v, int count);
// Booleans
bool setUniform(const std::string& name, bool value);
bool setUniform(const std::string& name, bool v1, bool v2);
......
......@@ -45,7 +45,7 @@ namespace campvis {
GlGradientVolumeGenerator::GlGradientVolumeGenerator(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_PROPERTIES | AbstractProcessor::INVALID_RESULT)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT)
, p_outputImage("OutputImage", "Output Image", "GlGradientVolumeGenerator.out", DataNameProperty::WRITE)
, _shader(0)
{
......
......@@ -186,7 +186,7 @@ namespace campvis {
modelMatrix.t11 = 0.f;
modelMatrix.t03 = 0.f;
modelMatrix.t13 = 2.f * sliceTexCoord.y - 1.f;
modelMatrix.t13 *= (ratioRatio > 1) ? 1.f : ratioRatio;
modelMatrix.t13 *= (ratioRatio > 1) ? 1.f / ratioRatio : 1.f;
_shader->setUniform("_modelMatrix", modelMatrix);
_shader->setUniform("_color", p_ySliceColor.getValue());
QuadRdr.renderQuad(GL_LINE_STRIP);
......
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