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
e7c6b10b
Commit
e7c6b10b
authored
Feb 01, 2013
by
Sebastian Eichelbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] fixed severe bug where vectors on surfaces got clipped although they are in the render plane
parent
c612791d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
src/modules/imageSpaceLIC/shaders/WMImageSpaceLIC-Transformation-fragment.glsl
...eLIC/shaders/WMImageSpaceLIC-Transformation-fragment.glsl
+5
-12
src/modules/imageSpaceLIC/shaders/WMImageSpaceLIC-Transformation-varyings.glsl
...eLIC/shaders/WMImageSpaceLIC-Transformation-varyings.glsl
+5
-0
src/modules/imageSpaceLIC/shaders/WMImageSpaceLIC-Transformation-vertex.glsl
...aceLIC/shaders/WMImageSpaceLIC-Transformation-vertex.glsl
+6
-2
No files found.
src/modules/imageSpaceLIC/shaders/WMImageSpaceLIC-Transformation-fragment.glsl
View file @
e7c6b10b
...
...
@@ -108,7 +108,7 @@ void main()
discard
;
}
// project the vectors to image space
// project the vectors to image space
as the input vector is in the tangent space
vecProjected
=
projectVector
(
vec
).
xyz
;
#endif
...
...
@@ -152,19 +152,12 @@ void main()
// if( isZero( cmap.r - 1.0, 0.15 ) )
// gl_FragData[1] = vec4( 1.0, 0.0, 0.0, 1.0 );
// }
gl_FragData
[
1
]
=
colormapping
();
// is the vector very orthogonal to the surface?
// is the vector very orthogonal to the surface? We scale our advection according to this.
float
dotS
=
abs
(
dot
(
v_normal
,
vec
.
xyz
)
);
vec2
dotScaled
=
(
1
.
0
-
dotS
)
*
scaleMaxToOne
(
vecProjected
).
xy
;
float
dotS
=
dot
(
v_normal
,
vec
.
xyz
);
vec2
dotScaled
=
(
1
.
0
+
sign
(
dotS
)
)
*
scaleMaxToOne
(
vecProjected
).
xy
;
// MPI Paper Hack;
// dotScaled = 40.0*vecProjected.xy;
gl_FragData
[
0
]
=
vec4
(
vec2
(
0
.
5
)
+
(
0
.
5
*
dotScaled
),
light
,
noise3D
);
// MPI PAper Hack:
// {
// //gl_FragData[1] = colormapping();
// }
gl_FragData
[
1
]
=
colormapping
();
}
src/modules/imageSpaceLIC/shaders/WMImageSpaceLIC-Transformation-varyings.glsl
View file @
e7c6b10b
...
...
@@ -27,6 +27,11 @@
*/
varying
vec3
v_normal
;
/**
* The normal interpolated and projected to screenspace
*/
varying
vec3
v_normalProjected
;
/**
* The light source in local coordinates
*/
...
...
src/modules/imageSpaceLIC/shaders/WMImageSpaceLIC-Transformation-vertex.glsl
View file @
e7c6b10b
...
...
@@ -33,12 +33,12 @@
/**
* How much should the slice be moved along u_vertexShiftDirection?
*/
uniform
int
u_vertexShift
;
uniform
int
u_vertexShift
=
0
;
/**
* The direction along which the slice gets moved
*/
uniform
vec3
u_vertexShiftDirection
;
uniform
vec3
u_vertexShiftDirection
=
vec3
(
0
.
0
,
0
.
0
,
0
.
0
)
;
/**
* Size of input texture in pixels
...
...
@@ -96,6 +96,10 @@ void main()
// some light precalculations
v_normal
=
gl_Normal
;
// NOTE: we normalize the vec here although we need to normalize it again in the fragment shader since the projected vector might be very
// small and we want to avoid numerical issues when interpolating.
v_normalProjected
=
normalize
(
projectVector
(
vec4
(
gl_Normal
.
xyz
,
0
.
0
)
)
);
// if we use 3d noise textures and auto resolution feature:
#ifdef NOISE3D_ENABLED
vec4
vec1
=
vec4
(
float
(
u_texture0SizeX
)
/
float
(
u_texture1SizeX
),
...
...
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