Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
b142eed5
Commit
b142eed5
authored
Jul 17, 2017
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[STYLE
#364
] fixed style
parent
ae601552
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
22 deletions
+24
-22
src/modules/imageSpaceTensorLIC/WMImageSpaceTensorLIC.cpp
src/modules/imageSpaceTensorLIC/WMImageSpaceTensorLIC.cpp
+2
-2
src/modules/imageSpaceTensorLIC/WTuringTextureCreator.cpp
src/modules/imageSpaceTensorLIC/WTuringTextureCreator.cpp
+10
-3
src/modules/imageSpaceTensorLIC/WTuringTextureCreator.h
src/modules/imageSpaceTensorLIC/WTuringTextureCreator.h
+0
-4
src/modules/imageSpaceTensorLIC/shaders/WMImageSpaceTensorLIC-Transformation-fragment.glsl
...haders/WMImageSpaceTensorLIC-Transformation-fragment.glsl
+12
-13
No files found.
src/modules/imageSpaceTensorLIC/WMImageSpaceTensorLIC.cpp
View file @
b142eed5
...
...
@@ -74,7 +74,7 @@ void genReactionDiffusion( unsigned char* target,
unsigned
int
width
,
unsigned
int
/* height */
,
unsigned
int
iterations
,
float
spotSize
,
float
spotIrregularity
)
float
spotIrregularity
)
{
/////////////////////////////////////////////////////////////////////////////////////////////
// 1: get memory
...
...
@@ -131,7 +131,7 @@ void genReactionDiffusion( unsigned char* target,
float
kaMin
=
0.02
;
float
kaMax
=
0.6
;
float
ka
=
(
kaMin
+
((
kaMax
-
kaMin
)
*
(
1.0
-
spotSize
))
)
/
15.0
;
// size of spots
float
ka
=
(
kaMin
+
(
(
kaMax
-
kaMin
)
*
(
1.0
-
spotSize
)
)
)
/
15.0
;
// size of spots
float
d1
=
0.25
/
2.0
;
float
d2
=
0.0625
/
2.0
;
float
speed
=
1.0
;
...
...
src/modules/imageSpaceTensorLIC/WTuringTextureCreator.cpp
View file @
b142eed5
...
...
@@ -22,6 +22,7 @@
//
//---------------------------------------------------------------------------
#include <algorithm>
#include <iostream>
#include <vector>
...
...
@@ -239,12 +240,18 @@ void WTuringTextureCreator::TextureThread::threadMain()
// diffusion
(
*
m_delta1
)[
idx
]
=
m_spotFactor
*
(
16.0
f
-
(
*
m_concentration1
)[
idx
]
*
(
*
m_concentration2
)[
idx
]
)
+
m_diffusionConstant1
*
dc1
;
(
*
m_delta2
)[
idx
]
=
m_spotFactor
*
(
(
*
m_concentration1
)[
idx
]
*
(
*
m_concentration2
)[
idx
]
-
(
*
m_concentration2
)[
idx
]
-
(
*
m_noise
)[
idx
]
)
+
m_diffusionConstant2
*
dc2
;
(
*
m_delta2
)[
idx
]
=
m_spotFactor
*
(
(
*
m_concentration1
)[
idx
]
*
(
*
m_concentration2
)[
idx
]
-
(
*
m_concentration2
)[
idx
]
-
(
*
m_noise
)[
idx
]
)
+
m_diffusionConstant2
*
dc2
;
}
}
void
WTuringTextureCreator
::
TextureThread
::
setBufferPointers
(
std
::
vector
<
float
>
const
*
concentration1
,
std
::
vector
<
float
>
const
*
concentration2
,
std
::
vector
<
float
>
const
*
noise
,
std
::
vector
<
float
>*
delta1
,
std
::
vector
<
float
>*
delta2
)
void
WTuringTextureCreator
::
TextureThread
::
setBufferPointers
(
std
::
vector
<
float
>
const
*
concentration1
,
std
::
vector
<
float
>
const
*
concentration2
,
std
::
vector
<
float
>
const
*
noise
,
std
::
vector
<
float
>*
delta1
,
std
::
vector
<
float
>*
delta2
)
{
WPrecond
(
concentration1
!=
0
,
"Invalid pointer!"
);
WPrecond
(
concentration2
!=
0
,
"Invalid pointer!"
);
...
...
src/modules/imageSpaceTensorLIC/WTuringTextureCreator.h
View file @
b142eed5
...
...
@@ -35,7 +35,6 @@
class
WTuringTextureCreator
{
public:
WTuringTextureCreator
(
std
::
size_t
numThreads
=
boost
::
thread
::
hardware_concurrency
()
);
~
WTuringTextureCreator
();
...
...
@@ -49,11 +48,9 @@ public:
void
setNumIterations
(
std
::
size_t
iter
);
private:
class
TextureThread
:
public
WThreadedRunner
{
public:
TextureThread
(
std
::
size_t
id
,
std
::
size_t
max
);
~
TextureThread
();
...
...
@@ -70,7 +67,6 @@ private:
virtual
void
threadMain
();
private:
std
::
size_t
m_id
;
std
::
size_t
m_maxThreads
;
...
...
src/modules/imageSpaceTensorLIC/shaders/WMImageSpaceTensorLIC-Transformation-fragment.glsl
View file @
b142eed5
...
...
@@ -126,14 +126,14 @@ uniform float u_clipFA = 0.01;
// computes FA from eigenvalues
float
getFA
(
vec3
evalues
)
{
float
sqrt32
=
sqrt
(
3
.
/
2
.
);
// would make this const, if compiler let me
float
sqrt32
=
sqrt
(
3
.
/
2
.
);
// would make this const, if compiler let me
float
I1
=
evalues
.
x
+
evalues
.
y
+
evalues
.
z
;
float
mu
=
I1
/
3
.;
float
mu
=
I1
/
3
.;
vec3
deriv
;
deriv
.
x
=
(
evalues
.
x
-
mu
);
deriv
.
y
=
(
evalues
.
y
-
mu
);
deriv
.
z
=
(
evalues
.
z
-
mu
);
float
FA
=
sqrt32
*
length
(
deriv
)
/
length
(
evalues
);
deriv
.
x
=
(
evalues
.
x
-
mu
);
deriv
.
y
=
(
evalues
.
y
-
mu
);
deriv
.
z
=
(
evalues
.
z
-
mu
);
float
FA
=
sqrt32
*
length
(
deriv
)
/
length
(
evalues
);
return
FA
;
}
...
...
@@ -157,11 +157,11 @@ void main()
// find nearest cube planes in direction of the normal
int
nearestPlane
=
0
;
float
smallestD
=
1e10
;
vec3
cubeBase
=
vec3
(
0
.
0
);
//cubeBaseX, cubeBaseY, cubeBaseZ);
vec3
cubeBase
=
vec3
(
0
.
0
);
//cubeBaseX, cubeBaseY, cubeBaseZ);
#ifdef CUBETEXTUREMAPPING_VARIANT1_A
// try each of the 6 planes and find nearest (positive) hit
for
(
int
axis
=
0
;
axis
<
3
;
axis
++
)
for
(
int
axis
=
0
;
axis
<
3
;
axis
++
)
{
// search the n in : vertex[axis]+n*_normal[axis] = 1.0 | 0.0
float
n1
=
(
1
.
0
-
v
[
axis
]
)
/
v_normalObject
[
axis
];
...
...
@@ -185,7 +185,7 @@ void main()
#ifdef CUBETEXTUREMAPPING_VARIANT1_B
// try each of the 6 planes and find nearest (positive) hit
for
(
int
axis
=
0
;
axis
<
3
;
axis
++
)
for
(
int
axis
=
0
;
axis
<
3
;
axis
++
)
{
float
d1
=
v
[
axis
];
float
d2
=
1
.
0
-
v
[
axis
];
...
...
@@ -196,7 +196,7 @@ void main()
float
d
=
min
(
d1
,
d2
);
// smaller than currently found one?
if
(
d
<
smallestD
)
if
(
d
<
smallestD
)
{
smallestD
=
d
;
nearestPlane
=
axis
;
...
...
@@ -245,7 +245,7 @@ void main()
#endif
#ifdef CUBETEXTUREMAPPING_VARIANT2
vec3
v
=
v_vertex
.
xyz
;
// - floor( v_vertex.xyz );
vec3
v
=
v_vertex
.
xyz
;
// - floor( v_vertex.xyz );
float
scaler
=
(
u_noiseResoultuion
/
100
.
0
);
v
*=
scaler
;
if
(
abs
(
v_normalObject
.
x
)
==
max
(
abs
(
v_normalObject
.
x
),
max
(
abs
(
v_normalObject
.
y
),
abs
(
v_normalObject
.
z
)
)
)
)
...
...
@@ -263,7 +263,7 @@ void main()
#endif
#ifdef CUBETEXTUREMAPPING_VARIANT3
float
scaler
=
10
.
0
/
u_noiseResoultuion
;
float
scaler
=
10
.
0
/
u_noiseResoultuion
;
noiseTexCoords
=
vec2
(
scaler
*
gl_FragCoord
.
x
/
u_texture3SizeX
,
scaler
*
gl_FragCoord
.
y
/
u_texture3SizeY
);
#endif
...
...
@@ -357,6 +357,5 @@ void main()
gl_FragData
[
1
]
=
vec4
(
light
,
noise
,
gl_FragCoord
.
z
,
1
.
0
);
gl_FragData
[
2
]
=
vec4
(
abs
(
evals
.
r
-
evals
.
g
),
fa
,
0
.
0
,
1
.
0
);
gl_FragData
[
3
]
=
cmap
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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