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
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
e8ec00fd
Commit
e8ec00fd
authored
May 05, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
line drawing ok
parent
0c420188
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
31 deletions
+27
-31
CGoGN/include/Utils/Shaders/shaderBoldColorLines.geom
CGoGN/include/Utils/Shaders/shaderBoldColorLines.geom
+5
-7
CGoGN/include/Utils/Shaders/shaderBoldLines.geom
CGoGN/include/Utils/Shaders/shaderBoldLines.geom
+7
-5
CGoGN/include/Utils/Shaders/shaderColorDarts.geom
CGoGN/include/Utils/Shaders/shaderColorDarts.geom
+5
-8
CGoGN/include/Utils/Shaders/shaderDarts.geom
CGoGN/include/Utils/Shaders/shaderDarts.geom
+5
-8
CGoGN/src/Utils/Shaders/shaderBold3DColorLines.cpp
CGoGN/src/Utils/Shaders/shaderBold3DColorLines.cpp
+3
-3
CGoGN/src/Utils/Shaders/shaderBoldLines.cpp
CGoGN/src/Utils/Shaders/shaderBoldLines.cpp
+2
-0
No files found.
CGoGN/include/Utils/Shaders/shaderBoldColorLines.geom
View file @
e8ec00fd
...
...
@@ -31,15 +31,14 @@ void main()
A
=
A
/
A
.
w
;
B
=
B
/
B
.
w
;
vec2
U2
=
normalize
((
B
.
xyz
-
A
.
xyz
).
xy
);
vec3
U
=
vec3
(
lineWidths
*
U2
,
0
.
0
);
vec3
V
=
vec3
(
lineWidths
*
vec2
(
U2
[
1
],
-
U2
[
0
]),
0
.
0
);
// U2 *= (lineWidths[0]+lineWidths[1])/2.0;
vec2
U2
=
normalize
(
vec2
(
lineWidths
[
1
],
lineWidths
[
0
])
*
(
B
.
xy
-
A
.
xy
));
vec2
LWCorr
=
lineWidths
*
max
(
abs
(
U2
.
x
),
abs
(
U2
.
y
));
vec3
U
=
vec3
(
LWCorr
*
U2
,
0
.
0
);
vec3
V
=
vec3
(
LWCorr
*
vec2
(
U2
[
1
],
-
U2
[
0
]),
0
.
0
);
fragClip
=
posClip
[
0
];
fragColor
=
vcolor
[
0
];
// A -= vec4(U2,0.0,0.0);
gl_Position
=
vec4
(
A
.
xyz
-
U
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
A
.
xyz
+
V
,
1
.
0
);
...
...
@@ -49,7 +48,6 @@ void main()
fragClip
=
posClip
[
1
];
fragColor
=
vcolor
[
1
];
// B += vec4(U2,0.0,0.0);
gl_Position
=
vec4
(
B
.
xyz
+
V
,
1
.
0
);
EmitVertex
();
gl_Position
=
vec4
(
B
.
xyz
-
V
,
1
.
0
);
...
...
CGoGN/include/Utils/Shaders/shaderBoldLines.geom
View file @
e8ec00fd
...
...
@@ -9,7 +9,7 @@ void main()
{
vec4
A
=
POSITION_IN
(
0
);
vec4
B
=
POSITION_IN
(
1
);
float
nearZ
=
1
.
0
;
if
(
ProjectionMatrix
[
2
][
2
]
!=
1
.
0
)
nearZ
=
-
ProjectionMatrix
[
3
][
2
]
/
(
ProjectionMatrix
[
2
][
2
]
-
1
.
0
);
...
...
@@ -23,12 +23,13 @@ void main()
A
=
ProjectionMatrix
*
A
;
B
=
ProjectionMatrix
*
B
;
A
=
A
/
A
.
w
;
B
=
B
/
B
.
w
;
vec2
U2
=
normalize
((
B
.
xyz
-
A
.
xyz
).
xy
);
vec3
U
=
vec3
(
lineWidths
*
U2
,
0
.
0
);
vec3
V
=
vec3
(
lineWidths
*
vec2
(
U2
[
1
],
-
U2
[
0
]),
0
.
0
);
vec2
U2
=
normalize
(
vec2
(
lineWidths
[
1
],
lineWidths
[
0
])
*
(
B
.
xy
-
A
.
xy
));
vec2
LWCorr
=
lineWidths
*
max
(
abs
(
U2
.
x
),
abs
(
U2
.
y
));
vec3
U
=
vec3
(
LWCorr
*
U2
,
0
.
0
);
vec3
V
=
vec3
(
LWCorr
*
vec2
(
U2
[
1
],
-
U2
[
0
]),
0
.
0
);
fragClip
=
posClip
[
0
];
gl_Position
=
vec4
(
A
.
xyz
-
U
,
1
.
0
);
...
...
@@ -45,6 +46,7 @@ void main()
EmitVertex
();
gl_Position
=
vec4
(
B
.
xyz
+
U
,
1
.
0
);
EmitVertex
();
EndPrimitive
();
}
}
CGoGN/include/Utils/Shaders/shaderColorDarts.geom
View file @
e8ec00fd
...
...
@@ -31,14 +31,11 @@ void main()
A
=
A
/
A
.
w
;
B
=
B
/
B
.
w
;
vec2
U2
=
normalize
((
B
.
xyz
-
A
.
xyz
).
xy
);
vec3
V
=
vec3
(
lineWidths
*
vec2
(
U2
[
1
],
-
U2
[
0
]),
0
.
0
)
*
3
.
0
;
U2
*=
(
lineWidths
[
0
]
+
lineWidths
[
1
])
/
2
.
0
;
vec3
U
=
vec3
(
U2
,
0
.
0
)
*
3
.
0
;
// vec3 U3 = normalize(B.xyz - A.xyz);
// U3 *= (lineWidths[0]+lineWidths[1])/2.0;
vec2
U2
=
normalize
(
vec2
(
lineWidths
[
1
],
lineWidths
[
0
])
*
(
B
.
xy
-
A
.
xy
));
vec2
LWCorr
=
lineWidths
*
max
(
abs
(
U2
.
x
),
abs
(
U2
.
y
));
vec3
U
=
vec3
(
LWCorr
*
U2
,
0
.
0
)
*
3
.
0
;
vec3
V
=
vec3
(
LWCorr
*
vec2
(
U2
[
1
],
-
U2
[
0
]),
0
.
0
)
*
3
.
0
;
fragClip
=
posClip
[
0
];
fragColor
=
vcolor
[
0
];
...
...
CGoGN/include/Utils/Shaders/shaderDarts.geom
View file @
e8ec00fd
...
...
@@ -24,17 +24,14 @@ void main()
A
=
ProjectionMatrix
*
A
;
B
=
ProjectionMatrix
*
B
;
A
=
A
/
A
.
w
;
B
=
B
/
B
.
w
;
vec2
U2
=
normalize
((
B
.
xyz
-
A
.
xyz
).
xy
);
vec3
V
=
vec3
(
lineWidths
*
vec2
(
U2
[
1
],
-
U2
[
0
]),
0
.
0
)
*
3
.
0
;
U2
*=
(
lineWidths
[
0
]
+
lineWidths
[
1
])
/
2
.
0
;
vec3
U
=
vec3
(
U2
,
0
.
0
)
*
3
.
0
;
// vec3 U3 = normalize(B.xyz - A.xyz);
// U3 *= (lineWidths[0]+lineWidths[1])/2.0;
vec2
U2
=
normalize
(
vec2
(
lineWidths
[
1
],
lineWidths
[
0
])
*
(
B
.
xy
-
A
.
xy
));
vec2
LWCorr
=
lineWidths
*
max
(
abs
(
U2
.
x
),
abs
(
U2
.
y
));
vec3
U
=
vec3
(
LWCorr
*
U2
,
0
.
0
)
*
3
.
0
;
vec3
V
=
vec3
(
LWCorr
*
vec2
(
U2
[
1
],
-
U2
[
0
]),
0
.
0
)
*
3
.
0
;
fragClip
=
posClip
[
0
];
...
...
CGoGN/src/Utils/Shaders/shaderBold3DColorLines.cpp
View file @
e8ec00fd
...
...
@@ -31,9 +31,9 @@ namespace CGoGN
namespace
Utils
{
#include "
S
haderBold3DColorLines.vert"
#include "
S
haderBold3DColorLines.geom"
#include "
S
haderBold3DColorLines.frag"
#include "
s
haderBold3DColorLines.vert"
#include "
s
haderBold3DColorLines.geom"
#include "
s
haderBold3DColorLines.frag"
ShaderBold3DColorLines
::
ShaderBold3DColorLines
()
:
...
...
CGoGN/src/Utils/Shaders/shaderBoldLines.cpp
View file @
e8ec00fd
...
...
@@ -23,6 +23,7 @@
*******************************************************************************/
#define CGoGN_UTILS_DLL_EXPORT 1
#include "Utils/Shaders/shaderBoldLines.h"
#include <algorithm>
namespace
CGoGN
{
...
...
@@ -88,6 +89,7 @@ void ShaderBoldLines::setLineWidth(float pix)
glGetIntegerv
(
GL_VIEWPORT
,
&
(
viewport
[
0
]));
m_lineWidth
[
0
]
=
pix
/
float
(
viewport
[
2
]);
m_lineWidth
[
1
]
=
pix
/
float
(
viewport
[
3
]);
bind
();
glUniform2fv
(
*
m_uniform_lineWidth
,
1
,
m_lineWidth
.
data
());
unbind
();
...
...
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