Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
KennethVanhoey
CGoGN
Commits
85fd18da
Commit
85fd18da
authored
Aug 01, 2011
by
thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update systeme de compilation des shaders pour windows
parent
477b3868
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
6 deletions
+39
-6
ThirdParty/CMakeLists.txt
ThirdParty/CMakeLists.txt
+1
-0
ThirdParty/Tools/CMakeLists.txt
ThirdParty/Tools/CMakeLists.txt
+2
-0
ThirdParty/Tools/shader_to_h.cpp
ThirdParty/Tools/shader_to_h.cpp
+12
-3
build/Debug/CMakeLists.txt
build/Debug/CMakeLists.txt
+11
-0
build/Release/CMakeLists.txt
build/Release/CMakeLists.txt
+9
-0
include/Utils/text3d.frag
include/Utils/text3d.frag
+1
-1
include/Utils/text3d.vert
include/Utils/text3d.vert
+3
-2
No files found.
ThirdParty/CMakeLists.txt
View file @
85fd18da
...
...
@@ -20,6 +20,7 @@ IF(WIN32)
add_subdirectory
(
gzstream/Build
)
add_subdirectory
(
Numerical
)
add_subdirectory
(
Assimp/code
)
add_subdirectory
(
Tools
)
# if(CMAKE_CONFIGURATION_TYPES)
# set(CMAKE_CONFIGURATION_TYPES Release)
# set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
...
...
ThirdParty/Tools/CMakeLists.txt
View file @
85fd18da
...
...
@@ -4,6 +4,8 @@ project(Tools)
SET
(
CMAKE_BUILD_TYPE Release
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/ThirdParty/Tools
)
add_executable
(
shader_to_h shader_to_h.cpp
)
target_link_libraries
(
shader_to_h
)
ThirdParty/Tools/shader_to_h.cpp
View file @
85fd18da
...
...
@@ -5,7 +5,7 @@
int
main
(
int
argc
,
char
**
argv
)
{
char
buffer
[
512
];
for
(
unsigned
int
i
=
1
;
i
<
argc
;
++
i
)
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
std
::
string
filename
(
argv
[
i
]);
...
...
@@ -54,13 +54,22 @@ int main(int argc, char **argv)
sso
<<
"std::string "
<<
sub
<<
" ="
;
// text of shader
unsigned
int
nbbl
=
0
;
while
(
!
fs
.
eof
())
{
fs
.
getline
(
buffer
,
512
);
if
(
!
fs
.
eof
()
&&
(
*
buffer
!=
0
))
//std::cout << buffer << std::endl;
if
(
*
buffer
!=
0
)
{
for
(
unsigned
int
i
=
0
;
i
<
nbbl
;
++
i
)
sso
<<
std
::
endl
<<
"
\"\\
n
\"
"
;
nbbl
=
0
;
sso
<<
std
::
endl
<<
"
\"
"
<<
buffer
<<
"
\\
n
\"
"
;
}
else
nbbl
++
;
};
sso
<<
";"
<<
std
::
endl
<<
std
::
endl
;
sso
<<
";"
<<
std
::
endl
<<
std
::
endl
;
std
::
string
ssostr
=
sso
.
str
();
if
(
ssostr
!=
ssi
.
str
())
...
...
build/Debug/CMakeLists.txt
View file @
85fd18da
...
...
@@ -79,10 +79,21 @@ file(
${
CGoGN_ROOT_DIR
}
/include/Utils/Shaders*.geom
)
IF
(
WIN32
)
add_custom_target
(
shader_targetD
${
CGoGN_ROOT_DIR
}
/ThirdParty/Tools/Release/shader_to_h
${
shaders_srcD
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
SOURCES
${
shaders_srcD
}
)
ELSE
(
WIN32
)
add_custom_target
(
shader_targetD
${
CGoGN_ROOT_DIR
}
/ThirdParty/Tools/shader_to_h
${
shaders_srcD
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
SOURCES
${
shaders_srcD
}
)
ENDIF
(
WIN32
)
file
(
...
...
build/Release/CMakeLists.txt
View file @
85fd18da
...
...
@@ -93,10 +93,19 @@ file(
${
CGoGN_ROOT_DIR
}
/include/Utils/Shaders*.geom
)
IF
(
WIN32
)
add_custom_target
(
shader_target
${
CGoGN_ROOT_DIR
}
/ThirdParty/Tools/Release/shader_to_h
${
shaders_src
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
SOURCES
${
shaders_src
}
)
ELSE
(
WIN32
)
add_custom_target
(
shader_target
${
CGoGN_ROOT_DIR
}
/ThirdParty/Tools/shader_to_h
${
shaders_src
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
SOURCES
${
shaders_src
}
)
ENDIF
(
WIN32
)
...
...
include/Utils/text3d.frag
View file @
85fd18da
...
...
@@ -7,4 +7,4 @@ FRAG_OUT_DEF;
void
main
(
void
)
{
float
lum
=
texture2D
(
FontTexture
,
tex_coord
).
s
;;
}
// no "}" because it is added in the shader class code (with other things)
include/Utils/text3d.vert
View file @
85fd18da
...
...
@@ -2,7 +2,7 @@
ATTRIBUTE
vec4
VertexPosition
;
uniform
mat4
ModelViewMatrix
;
uniform
mat4
ProjectionMatrix
uniform
mat4
ProjectionMatrix
;
uniform
vec3
strPos
;
uniform
float
scale
;
VARYING_VERT
vec2
tex_coord
;
...
...
@@ -12,4 +12,5 @@ void main ()
vec4
pos
=
ModelViewMatrix
*
vec4
(
strPos
,
1
.
0
)
+
vec4
(
VertexPosition
[
0
]
*
scale
,
VertexPosition
[
1
]
*
scale
,
0
.
0
,
0
.
0
);
tex_coord
=
vec2
(
VertexPosition
[
2
],
VertexPosition
[
3
]);
gl_Position
=
ProjectionMatrix
*
pos
;
}
\ No newline at end of file
}
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