Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
663cca79
Commit
663cca79
authored
Jan 16, 2017
by
Jakob Weiss
Browse files
Fixes related to previous merge
* Updated TextureManager * Fixed some warnings and minor cleanup
parent
9a834357
Changes
3
Hide whitespace changes
Inline
Side-by-side
ext/cgt/texturemanager.cpp
View file @
663cca79
...
...
@@ -37,17 +37,20 @@ GLuint cgt::TextureManager::generateId(GLenum type, const cgt::svec3 & dimension
switch
(
type
)
{
case
GL_TEXTURE_1D
:
glTexImage1D
(
type
,
0
,
internalFormat
,
dimensions
.
x
,
0
,
Texture
::
calcMatchingFormat
(
internalFormat
),
Texture
::
calcMatchingDataType
(
internalFormat
),
nullptr
);
glTexImage1D
(
type
,
0
,
internalFormat
,
static_cast
<
GLsizei
>
(
dimensions
.
x
),
0
,
Texture
::
calcMatchingPixelFormat
(
internalFormat
),
Texture
::
calcMatchingPixelDataType
(
internalFormat
),
nullptr
);
break
;
case
GL_TEXTURE_1D_ARRAY
:
// fallthrough
case
GL_TEXTURE_2D
:
glTexImage2D
(
type
,
0
,
internalFormat
,
dimensions
.
x
,
dimensions
.
y
,
0
,
Texture
::
calcMatchingFormat
(
internalFormat
),
Texture
::
calcMatchingDataType
(
internalFormat
),
nullptr
);
glTexImage2D
(
type
,
0
,
internalFormat
,
static_cast
<
GLsizei
>
(
dimensions
.
x
),
static_cast
<
GLsizei
>
(
dimensions
.
y
),
0
,
Texture
::
calcMatchingPixelFormat
(
internalFormat
),
Texture
::
calcMatchingPixelDataType
(
internalFormat
),
nullptr
);
break
;
case
GL_TEXTURE_2D_ARRAY
:
// fallthrough
case
GL_TEXTURE_3D
:
glTexImage3D
(
type
,
0
,
internalFormat
,
dimensions
.
x
,
dimensions
.
y
,
dimensions
.
z
,
0
,
Texture
::
calcMatchingFormat
(
internalFormat
),
Texture
::
calcMatchingDataType
(
internalFormat
),
nullptr
);
glTexImage3D
(
type
,
0
,
internalFormat
,
static_cast
<
GLsizei
>
(
dimensions
.
x
),
static_cast
<
GLsizei
>
(
dimensions
.
y
),
static_cast
<
GLsizei
>
(
dimensions
.
z
),
0
,
Texture
::
calcMatchingPixelFormat
(
internalFormat
),
Texture
::
calcMatchingPixelDataType
(
internalFormat
),
nullptr
);
break
;
}
LGL_ERROR
;
...
...
@@ -60,17 +63,20 @@ GLuint cgt::TextureManager::generateId(GLenum type, const cgt::svec3 & dimension
switch
(
type
)
{
case
GL_TEXTURE_1D
:
glTexImage1D
(
type
,
0
,
internalFormat
,
dimensions
.
x
,
0
,
Texture
::
calcMatchingFormat
(
internalFormat
),
Texture
::
calcMatchingDataType
(
internalFormat
),
nullptr
);
glTexImage1D
(
type
,
0
,
internalFormat
,
static_cast
<
GLsizei
>
(
dimensions
.
x
),
0
,
Texture
::
calcMatchingPixelFormat
(
internalFormat
),
Texture
::
calcMatchingPixelDataType
(
internalFormat
),
nullptr
);
break
;
case
GL_TEXTURE_1D_ARRAY
:
// fallthrough
case
GL_TEXTURE_2D
:
glTexImage2D
(
type
,
0
,
internalFormat
,
dimensions
.
x
,
dimensions
.
y
,
0
,
Texture
::
calcMatchingFormat
(
internalFormat
),
Texture
::
calcMatchingDataType
(
internalFormat
),
nullptr
);
glTexImage2D
(
type
,
0
,
internalFormat
,
static_cast
<
GLsizei
>
(
dimensions
.
x
),
static_cast
<
GLsizei
>
(
dimensions
.
y
),
0
,
Texture
::
calcMatchingPixelFormat
(
internalFormat
),
Texture
::
calcMatchingPixelDataType
(
internalFormat
),
nullptr
);
break
;
case
GL_TEXTURE_2D_ARRAY
:
// fallthrough
case
GL_TEXTURE_3D
:
glTexImage3D
(
type
,
0
,
internalFormat
,
dimensions
.
x
,
dimensions
.
y
,
dimensions
.
z
,
0
,
Texture
::
calcMatchingFormat
(
internalFormat
),
Texture
::
calcMatchingDataType
(
internalFormat
),
nullptr
);
glTexImage3D
(
type
,
0
,
internalFormat
,
static_cast
<
GLsizei
>
(
dimensions
.
x
),
static_cast
<
GLsizei
>
(
dimensions
.
y
),
static_cast
<
GLsizei
>
(
dimensions
.
z
),
0
,
Texture
::
calcMatchingPixelFormat
(
internalFormat
),
Texture
::
calcMatchingPixelDataType
(
internalFormat
),
nullptr
);
break
;
}
LGL_ERROR
;
...
...
modules/preprocessing/glsl/medianfilter.comp
View file @
663cca79
...
...
@@ -22,6 +22,7 @@
//
// ================================================================================================
// (c) 2017 Jakob Weiss <jakob.weiss@tum.de>
// ==================== Shader for median filtering. ====================
// Expects the following dynamic defines:
...
...
@@ -62,18 +63,6 @@ layout(local_size_x = WORK_GROUP_SIZE_X, local_size_y = WORK_GROUP_SIZE_Y, local
float sorted[KERNEL_S];
int end = 0;
void sorted_insert2(float val) {
for(int i=0; i < end; i++) {
if(sorted[i].x < val.x) {
float tmp = val;
val = sorted[i];
sorted[i] = tmp;
}
}
sorted[end] = val;
end++;
}
void sorted_insert(float val) {
int i=end-1;
while( i >= 0) {
...
...
@@ -89,11 +78,6 @@ void sorted_insert(float val) {
end++;
}
void sorted_insert3(float val) {
sorted[end] = val;
end++;
}
void main() {
// get index in global work group i.e x,y position
ivec3 pixel_coords = ivec3(gl_GlobalInvocationID.xyz);
...
...
modules/preprocessing/processors/medianfilter.cpp
View file @
663cca79
...
...
@@ -86,7 +86,7 @@ namespace campvis {
if
(
_shader
)
{
cgt
::
ivec3
size
=
img
->
getSize
();
cgt
::
ivec3
wgSize
=
p_workgroupSize
.
getValue
();
cgt
::
vec3
groups
=
cgt
::
ceil
(
cgt
::
vec3
(
size
)
/
cgt
::
vec3
(
wgSize
));
cgt
::
i
vec3
groups
(
cgt
::
ceil
(
cgt
::
vec3
(
size
)
/
cgt
::
vec3
(
wgSize
))
)
;
cgt
::
TextureUnit
inputUnit
;
inputUnit
.
activate
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment