Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Modules
Commits
92dc9a7f
Commit
92dc9a7f
authored
Mar 26, 2015
by
reichenbach
Browse files
[FIX] fixed 'invalid operation' error, removed unused uniforms, changed to per-vertex bindings
parent
9de7d758
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.cpp
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.cpp
+6
-8
FiberStippleToolbox/src/fiberStipples/shaders/WFiberStipples-uniforms.glsl
...ox/src/fiberStipples/shaders/WFiberStipples-uniforms.glsl
+3
-2
No files found.
FiberStippleToolbox/src/fiberStipples/WMFiberStipples.cpp
View file @
92dc9a7f
...
...
@@ -214,6 +214,8 @@ osg::ref_ptr< osg::Geode > WMFiberStipples::genScatteredDegeneratedQuads( const
vertices
->
push_back
(
quadCenter
);
texcoords2
->
push_back
(
osg
::
Vec3
(
static_cast
<
double
>
(
sliceNum
),
0.0
,
0.0
)
);
texcoords3
->
push_back
(
osg
::
Vec3
(
inSliceNumber
,
0.0
,
0.0
)
);
normals
->
push_back
(
aCrossB
);
colors
->
push_back
(
osg
::
Vec4
(
1.0
,
1.0
,
1.0
,
1.0
)
);
}
texcoords0
->
push_back
(
(
-
aNorm
+
-
bNorm
)
);
...
...
@@ -225,12 +227,8 @@ osg::ref_ptr< osg::Geode > WMFiberStipples::genScatteredDegeneratedQuads( const
texcoords1
->
push_back
(
osg
::
Vec3
(
1.0
,
0.0
,
0.0
)
);
texcoords1
->
push_back
(
osg
::
Vec3
(
1.0
,
1.0
,
0.0
)
);
texcoords1
->
push_back
(
osg
::
Vec3
(
0.0
,
1.0
,
0.0
)
);
}
normals
->
push_back
(
aCrossB
);
colors
->
push_back
(
osg
::
Vec4
(
1.0
,
1.0
,
1.0
,
1.0
)
);
// put it all together
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
new
osg
::
Geometry
();
geometry
->
setVertexArray
(
vertices
);
...
...
@@ -240,8 +238,8 @@ osg::ref_ptr< osg::Geode > WMFiberStipples::genScatteredDegeneratedQuads( const
geometry
->
setTexCoordArray
(
3
,
texcoords3
);
geometry
->
setNormalArray
(
normals
);
geometry
->
setColorArray
(
colors
);
geometry
->
setNormalBinding
(
osg
::
Geometry
::
BIND_
OVERALL
);
geometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_
OVERALL
);
geometry
->
setNormalBinding
(
osg
::
Geometry
::
BIND_
PER_VERTEX
);
geometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_
PER_VERTEX
);
geometry
->
addPrimitiveSet
(
new
osg
::
DrawArrays
(
osg
::
PrimitiveSet
::
QUADS
,
0
,
vertices
->
size
()
)
);
osg
::
ref_ptr
<
osg
::
Geode
>
geode
=
new
osg
::
Geode
();
...
...
@@ -293,14 +291,14 @@ void WMFiberStipples::initOSG( boost::shared_ptr< WDataSetScalar > probTract, co
wge
::
bindAsUniform
(
m_output
,
offsets
[
2
],
"u_pixelSizeZ"
);
wge
::
bindAsUniform
(
m_output
,
aVec
,
"u_aVec"
);
wge
::
bindAsUniform
(
m_output
,
bVec
,
"u_bVec"
);
osg
::
ref_ptr
<
osg
::
Uniform
>
u_WorldTransform
=
new
osg
::
Uniform
(
"u_WorldTransform"
,
osg
::
Matrix
::
identity
()
);
osg
::
ref_ptr
<
osg
::
Uniform
>
u_WorldTransform
=
new
osg
::
Uniform
(
"u_WorldTransform"
,
osg
::
Matrix
f
::
identity
()
);
wge
::
bindAsUniform
(
m_output
,
u_WorldTransform
,
"u_WorldTransform"
);
wge
::
bindAsUniform
(
m_output
,
m_color
,
"u_color"
);
wge
::
bindAsUniform
(
m_output
,
m_minRange
,
"u_minRange"
);
wge
::
bindAsUniform
(
m_output
,
m_maxRange
,
"u_maxRange"
);
wge
::
bindAsUniform
(
m_output
,
m_outline
,
"u_outline"
);
wge
::
bindAsUniform
(
m_output
,
m_threshold
,
"u_threshold"
);
wge
::
bindAsUniform
(
m_output
,
probTract
->
getMax
(),
"u_maxConnectivityScore"
);
//
wge::bindAsUniform( m_output, probTract->getMax(), "u_maxConnectivityScore" );
wge
::
bindAsUniform
(
m_output
,
numDensitySlices
,
"u_numDensitySlices"
);
wge
::
bindAsUniform
(
m_output
,
m_glyphSize
,
"u_glyphSize"
);
wge
::
bindAsUniform
(
m_output
,
m_glyphThickness
,
"u_glyphThickness"
);
...
...
FiberStippleToolbox/src/fiberStipples/shaders/WFiberStipples-uniforms.glsl
View file @
92dc9a7f
...
...
@@ -29,7 +29,8 @@
* back to their original form as they are stored in RBGA (for example allowing
* only values between 0..1 for components but no negative ones).
*/
uniform
float
u_vectorsMin
;
uniform
float
u_vectorsScale
;
// uniform float u_vectorsMin;
// uniform float u_vectorsScale;
/**
* The matrix describes the transformation of gl_Vertex to OpenWalnut Scene Space
...
...
@@ -107,7 +108,7 @@ uniform int u_numDensitySlices;
/**
* Scales the quad which is used later for the stipples.
*/
uniform
float
u_glyphSize
;
//
uniform float u_glyphSize;
/**
* Color of the fiber stipples. This will be further combined with tract probability.
...
...
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