ksundberg / CS5500

Course project for CS5500 at Utah State University
GNU General Public License v2.0
2 stars 11 forks source link

Voxel Rendering #35

Closed tefu closed 9 years ago

tefu commented 9 years ago

I managed to get a very barebones voxel world up and running. 2015-02-27-15_23_15

One small issue though. When you look at voxels from the negative X, Y, or Z directions, voxels that are further away overlap voxels that are closer. 2015-02-27-15_24_18

While I work on fixing that, I thought it'd be nice if everyone could see what I have so far.

ksundberg commented 9 years ago

I do have GLM installed and still can not run cmake with the error above.

ostlerc commented 9 years ago

on osx I get this error:

/Users/costler/src/CS5500/client/forms/graphics.h:14:9: error: no template named 'tvec4' in namespace 'glm::detail'; did you mean 'glm::tvec4'? typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^~~~~~ glm::tvec4 /usr/local/include/glm/detail/type_vec4.hpp:103:9: note: 'glm::tvec4' declared here struct tvec4 ^ 1 error generated. make[2]: * [CMakeFiles/common.dir/common/voxel/chunk.cpp.o] Error 1 make[2]: * Waiting for unfinished jobs.... In file included from /Users/costler/src/CS5500/common/voxel/chunkmanager.cpp:1: In file included from /Users/costler/src/CS5500/common/voxel/chunkmanager.h:10: In file included from /Users/costler/src/CS5500/common/voxel/chunk.h:6: /Users/costler/src/CS5500/client/forms/graphics.h:14:9: error: no template named 'tvec4' in namespace 'glm::detail'; did you mean 'glm::tvec4'? typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^~~~~~ glm::tvec4 /usr/local/include/glm/detail/type_vec4.hpp:103:9: note: 'glm::tvec4' declared here struct tvec4 ^ In file included from /Users/costler/src/CS5500/client/forms/graphics.cpp:7: /Users/costler/src/CS5500/client/forms/graphics.h:14:9: error: no template named 'tvec4' in namespace 'glm::detail'; did you mean 'glm::tvec4'? typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^~~~~~ glm::tvec4 /usr/local/include/glm/detail/type_vec4.hpp:103:9: note: 'glm::tvec4' declared here struct tvec4 ^ 1 error generated. make[2]: * [CMakeFiles/common.dir/common/voxel/chunkmanager.cpp.o] Error 1 1 error generated. make[2]: * [CMakeFiles/common.dir/client/forms/graphics.cpp.o] Error 1 In file included from /Users/costler/src/CS5500/common/dungeon.cpp:4: In file included from /Users/costler/src/CS5500/common/dungeon.h:6: In file included from /Users/costler/src/CS5500/common/voxel/chunkmanager.h:10: In file included from /Users/costler/src/CS5500/common/voxel/chunk.h:6: /Users/costler/src/CS5500/client/forms/graphics.h:14:9: error: no template named 'tvec4' in namespace 'glm::detail'; did you mean 'glm::tvec4'? typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^~~~~~ glm::tvec4 /usr/local/include/glm/detail/type_vec4.hpp:103:9: note: 'glm::tvec4' declared here struct tvec4 ^

on ubuntu i get these errors:

make -j6 [ 3%] [ 6%] [ 10%] [ 13%] Building CXX object CMakeFiles/common.dir/common/voxel/chunkmanager.cpp.o Building CXX object CMakeFiles/common.dir/common/voxel/chunk.cpp.o Building CXX object CMakeFiles/common.dir/common/dungeon.cpp.o Building CXX object CMakeFiles/common.dir/client/forms/graphics.cpp.o In file included from /home/costler/src/CS5500/common/voxel/chunk.h:6:0, from /home/costler/src/CS5500/common/voxel/chunk.cpp:2: /home/costler/src/CS5500/client/forms/graphics.h:14:36: error: ‘lowp’ is not a member of ‘glm’ typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ /home/costler/src/CS5500/client/forms/graphics.h:14:36: error: ‘lowp’ is not a member of ‘glm’ /home/costler/src/CS5500/client/forms/graphics.h:14:45: error: wrong number of template arguments (2, should be 1) typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ In file included from /usr/include/glm/core/type.hpp:19:0, from /usr/include/glm/glm.hpp:63, from /home/costler/src/CS5500/client/forms/graphics.h:10, from /home/costler/src/CS5500/common/voxel/chunk.h:6, from /home/costler/src/CS5500/common/voxel/chunk.cpp:2: /usr/include/glm/core/type_vec1.hpp:35:32: error: provided for ‘template struct glm::detail::tvec4’ template struct tvec4; ^ In file included from /home/costler/src/CS5500/common/voxel/chunk.h:6:0, from /home/costler/src/CS5500/common/voxel/chunk.cpp:2: /home/costler/src/CS5500/client/forms/graphics.h:14:52: error: invalid type in declaration before ‘;’ token typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ /home/costler/src/CS5500/common/voxel/chunk.cpp: In lambda function: /home/costler/src/CS5500/common/voxel/chunk.cpp:77:43: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:77:43: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:77:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:77:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:78:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:78:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:78:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:78:38: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:79:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:79:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:79:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:79:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:80:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:80:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:80:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:80:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:81:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:81:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:81:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:81:38: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:82:51: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:82:51: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:82:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:82:42: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp: In lambda function: /home/costler/src/CS5500/common/voxel/chunk.cpp:87:43: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:87:43: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:87:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:87:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:88:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:88:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:88:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:88:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:89:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:89:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:89:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:89:38: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:90:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:90:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:90:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:90:38: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:91:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:91:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:91:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:91:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:92:51: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:92:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:92:51: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:92:42: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp: In lambda function: /home/costler/src/CS5500/common/voxel/chunk.cpp:97:43: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:97:43: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:97:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:97:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:98:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:98:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:98:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:98:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:99:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:99:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:99:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:99:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:100:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:100:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:100:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:100:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:101:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:101:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:101:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:101:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:102:51: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:102:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:102:39: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:102:51: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp: In lambda function: /home/costler/src/CS5500/common/voxel/chunk.cpp:107:51: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:107:51: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:107:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:107:42: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:108:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:108:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:108:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:108:38: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:109:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:109:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:109:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:109:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:110:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:110:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:110:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:110:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:111:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:111:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:111:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:111:38: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:112:43: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:112:43: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:112:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:112:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp: In lambda function: /home/costler/src/CS5500/common/voxel/chunk.cpp:117:51: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:117:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:117:51: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:117:42: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:118:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:118:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:118:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:118:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:119:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:119:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:119:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:119:38: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:120:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:120:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:120:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:120:38: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j, k + 1, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:121:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:121:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:121:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:121:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:122:43: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:122:43: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:122:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:122:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp: In lambda function: /home/costler/src/CS5500/common/voxel/chunk.cpp:127:51: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:127:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:127:39: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:127:51: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:128:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:128:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:128:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:128:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:129:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:129:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:129:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:129:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:130:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:130:32: error: left operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:130:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i + 1, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:130:47: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:131:47: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:131:47: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:131:35: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:131:47: error: right operand of comma operator has no effect [-Werror=unused-value] vertex[vindex++] = byte4(i, j + 1, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:132:43: error: expression list treated as compound expression in functional cast [-fpermissive] vertex[vindex++] = byte4(i, j, k, type); ^ /home/costler/src/CS5500/common/voxel/chunk.cpp:132:43: error: left operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:132:43: error: right operand of comma operator has no effect [-Werror=unused-value] /home/costler/src/CS5500/common/voxel/chunk.cpp:132:43: error: right operand of comma operator has no effect [-Werror=unused-value] cc1plus: all warnings being treated as errors make[2]: * [CMakeFiles/common.dir/common/voxel/chunk.cpp.o] Error 1 make[2]: * Waiting for unfinished jobs.... In file included from /home/costler/src/CS5500/common/voxel/chunk.h:6:0, from /home/costler/src/CS5500/common/voxel/chunkmanager.h:10, from /home/costler/src/CS5500/common/voxel/chunkmanager.cpp:1: /home/costler/src/CS5500/client/forms/graphics.h:14:36: error: ‘lowp’ is not a member of ‘glm’ typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ /home/costler/src/CS5500/client/forms/graphics.h:14:36: error: ‘lowp’ is not a member of ‘glm’ /home/costler/src/CS5500/client/forms/graphics.h:14:45: error: wrong number of template arguments (2, should be 1) typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ In file included from /usr/include/glm/core/type.hpp:19:0, from /usr/include/glm/glm.hpp:63, from /home/costler/src/CS5500/client/forms/graphics.h:10, from /home/costler/src/CS5500/common/voxel/chunk.h:6, from /home/costler/src/CS5500/common/voxel/chunkmanager.h:10, from /home/costler/src/CS5500/common/voxel/chunkmanager.cpp:1: /usr/include/glm/core/type_vec1.hpp:35:32: error: provided for ‘template struct glm::detail::tvec4’ template struct tvec4; ^ In file included from /home/costler/src/CS5500/common/voxel/chunk.h:6:0, from /home/costler/src/CS5500/common/voxel/chunkmanager.h:10, from /home/costler/src/CS5500/common/voxel/chunkmanager.cpp:1: /home/costler/src/CS5500/client/forms/graphics.h:14:52: error: invalid type in declaration before ‘;’ token typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ make[2]: * [CMakeFiles/common.dir/common/voxel/chunkmanager.cpp.o] Error 1 In file included from /home/costler/src/CS5500/client/forms/graphics.cpp:7:0: /home/costler/src/CS5500/client/forms/graphics.h:14:36: error: ‘lowp’ is not a member of ‘glm’ typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ /home/costler/src/CS5500/client/forms/graphics.h:14:36: error: ‘lowp’ is not a member of ‘glm’ /home/costler/src/CS5500/client/forms/graphics.h:14:45: error: wrong number of template arguments (2, should be 1) typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ In file included from /usr/include/glm/core/type.hpp:19:0, from /usr/include/glm/glm.hpp:63, from /home/costler/src/CS5500/client/forms/graphics.h:10, from /home/costler/src/CS5500/client/forms/graphics.cpp:7: /usr/include/glm/core/type_vec1.hpp:35:32: error: provided for ‘template struct glm::detail::tvec4’ template struct tvec4; ^ In file included from /home/costler/src/CS5500/client/forms/graphics.cpp:7:0: /home/costler/src/CS5500/client/forms/graphics.h:14:52: error: invalid type in declaration before ‘;’ token typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ make[2]: * [CMakeFiles/common.dir/client/forms/graphics.cpp.o] Error 1 In file included from /home/costler/src/CS5500/common/voxel/chunk.h:6:0, from /home/costler/src/CS5500/common/voxel/chunkmanager.h:10, from /home/costler/src/CS5500/common/dungeon.h:6, from /home/costler/src/CS5500/common/dungeon.cpp:4: /home/costler/src/CS5500/client/forms/graphics.h:14:36: error: ‘lowp’ is not a member of ‘glm’ typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ /home/costler/src/CS5500/client/forms/graphics.h:14:36: error: ‘lowp’ is not a member of ‘glm’ /home/costler/src/CS5500/client/forms/graphics.h:14:45: error: wrong number of template arguments (2, should be 1) typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ In file included from /usr/include/glm/core/type.hpp:19:0, from /usr/include/glm/glm.hpp:63, from /home/costler/src/CS5500/client/forms/graphics.h:10, from /home/costler/src/CS5500/common/voxel/chunk.h:6, from /home/costler/src/CS5500/common/voxel/chunkmanager.h:10, from /home/costler/src/CS5500/common/dungeon.h:6, from /home/costler/src/CS5500/common/dungeon.cpp:4: /usr/include/glm/core/type_vec1.hpp:35:32: error: provided for ‘template struct glm::detail::tvec4’ template struct tvec4; ^ In file included from /home/costler/src/CS5500/common/voxel/chunk.h:6:0, from /home/costler/src/CS5500/common/voxel/chunkmanager.h:10, from /home/costler/src/CS5500/common/dungeon.h:6, from /home/costler/src/CS5500/common/dungeon.cpp:4: /home/costler/src/CS5500/client/forms/graphics.h:14:52: error: invalid type in declaration before ‘;’ token typedef glm::detail::tvec4<GLbyte, glm::lowp> byte4; ^ make[2]: * [CMakeFiles/common.dir/common/dungeon.cpp.o] Error 1 make[1]: * [CMakeFiles/common.dir/all] Error 2 make: *\ [all] Error 2

tefu commented 9 years ago

Could you tell me what version of GLM you're using? I'm having trouble reproducing the error.

On my Arch Linux box I'm using GLM 0.9.5.4-2, and on my Linux Mint virtual machine I'm using GLM 0.9.5.1-1. Both seem to build fine.

I found this from running dpkg -s libglm-dev on Mint, by the way.

tefu commented 9 years ago

Alright, I made the typedefs dependent on the GLM version. It should work for GLM versions 0.9.4-0.9.6 now. I also fixed the depth issue with OpenGL I was having earlier.

@ksundberg Can you review the pull request again?

ostlerc commented 9 years ago

OSX compiles, but the opengl displays nothing and my mouse is trapped in the middle of the box. Not sure what's happening there. On ubuntu I get string errors, which normally means you need to use the wxT("").

/home/costler/src/CS5500/client/forms/MainWindow.cpp: In constructor ‘MainWindow::MainWindow(const wxString&, const wxPoint&, const wxSize&)’: /home/costler/src/CS5500/client/forms/MainWindow.cpp:53:80: error: conversion from ‘const char [62]’ to ‘const wxString’ is ambiguous SetStatusText("WASD keys to move, JK to go up and down, ESC to toggle mouse."); ^ /home/costler/src/CS5500/client/forms/MainWindow.cpp:53:80: note: candidates are: In file included from /usr/include/wx-2.8/wx/memory.h:16:0, from /usr/include/wx-2.8/wx/object.h:20, from /usr/include/wx-2.8/wx/wx.h:16, from /home/costler/src/CS5500/include/wxwidget.h:5, from /home/costler/src/CS5500/client/forms/MainWindow.h:4, from /home/costler/src/CS5500/client/forms/MainWindow.cpp:3: /usr/include/wx-2.8/wx/string.h:692:3: note: wxString::wxString(wxChar, size_t) wxString(wxChar ch, size_t nRepeat = 1) ^ /usr/include/wx-2.8/wx/string.h:692:3: note: no known conversion for argument 1 from ‘const char [62]’ to ‘wxChar {aka wchar_t}’ /usr/include/wx-2.8/wx/string.h:682:3: note: wxString::wxString(int) wxString(int); ^ /usr/include/wx-2.8/wx/string.h:682:3: note: no known conversion for argument 1 from ‘const char [62]’ to ‘int’ In file included from /usr/include/wx-2.8/wx/wx.h:40:0, from /home/costler/src/CS5500/include/wxwidget.h:5, from /home/costler/src/CS5500/client/forms/MainWindow.h:4, from /home/costler/src/CS5500/client/forms/MainWindow.cpp:3: /usr/include/wx-2.8/wx/frame.h:110:18: error: initializing argument 1 of ‘virtual void wxFrameBase::SetStatusText(const wxString&, int)’ virtual void SetStatusText(const wxString &text, int number = 0); ^

tefu commented 9 years ago

The mouse is supposed to be trapped. I was using that to control the camera, while keeping the mouse in window. You can disable it with ESC.

I'll try getting an Ubuntu VM up and running so I can reproduce your errors.

ostlerc commented 9 years ago

so, everything compiles now and it runs. But both on ubuntu and osx I don't see anything being rendered. I assume this isn't what you're seeing. But I do think there might be something more wrong than just my setup. What is wrong, however, I don't know. I would be interested to know if anyone else is having this issue.

ksundberg commented 9 years ago

So this compiles and passes unit tests for me but the behavior of the application is clearly incorrect. The window is not being drawn, which leads to a number of artifacts on the screen, none of which look like your screen shots. Also switching between the views via the menu causes lock-ups and crashes.

tefu commented 9 years ago

I managed to get an Ubuntu VM in VirtualBox to run the application. Here's what I see now. 2015-03-04_17-05-22

I'm not getting crashes, so I don't think this is what you're experiencing. I tried running on an old Arch laptop I had lying around with a much weaker graphics card, and I got the same torn up blocks. Still no crashes. I thought that maybe the application was making assumptions about the host operating system, so I tried running the Ubuntu VM from Windows, and still got the same results. Lowering the problem size doesn't seem to do much. 2015-03-04_17-11-10

I'll try playing computer with this over the next few days, provided midterms don't get in the way. I'm sure I'm doing something crazy with OpenGL, but I'm not sure exactly what yet.

ostlerc commented 9 years ago

as a data point, osx still displays nothing as well

waredavid commented 9 years ago

I just looked online and for some reason our most recent pull request got the wrong code a large amount of it has been changed. That might be why things are appearing wrong. I apologize that I did not realize this sooner.

On Fri, Feb 27, 2015 at 3:37 PM, Trevor Hullinger notifications@github.com wrote:

I managed to get a very barebones voxel world up and running. [image: 2015-02-27-15_23_15] https://cloud.githubusercontent.com/assets/10508654/6422400/523926fa-be95-11e4-8081-fe37ad1a862c.png

One small issue though. When you look at voxels from the negative X, Y, or Z directions, voxels that are further away overlap voxels that are closer. [image: 2015-02-27-15_24_18] https://cloud.githubusercontent.com/assets/10508654/6422418/a1d350dc-be95-11e4-85e7-2ad20965e362.png

While I work on fixing that, I thought it'd be nice if everyone could see

what I have so far.

You can view, comment on, or merge this pull request online at:

https://github.com/ksundberg/CS5500/pull/35 Commit Summary

  • Moved the Block class' "is active" logic into the enum for its type and
  • Toning down the ChunkManager and Chunk classes; putting the game loop in
  • Adding tests for ChunkManager.
  • Add error checking for set and get in ChunkManager; add function stubs
  • Move graphics into its own file.
  • ChunkManager's render function now takes a TestGLContext as an argument.
  • Only allocate chunks when someone wants to set a BlockType.
  • Adding GLM as a dependency for graphics.
  • Add GLEW and GLM as dependencies. Start work on chunk updating.
  • Playing with GLSL shaders to render voxels.
  • Copy shaders to CMake build directory.
  • Render one Chunk on the screen. With very naive rendering for now.
  • Remove deprecated functions to draw cubes.
  • Avoid rendering the sides of a voxel that are touching another voxel.
  • Parameterize the position vector from within the game loop.
  • Now we can move in the right direction with the arrow keys.
  • Have each chunk decide the model of the model view projection matrix.
  • Each chunk now renders in its correct location.
  • Allow mouse to move camera position. Also renamed classes.
  • Force voxels to render all sides.
  • Creating more BlockTypes.
  • Playing with shaders.
  • Test the bounds on ChunkManager; also removed deallocation of something
  • Only render the outside of voxels.
  • Parameterize attribute_coord.
  • Generate less voxels.
  • Merge branch 'master' into voxel-rendering

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/ksundberg/CS5500/pull/35.

tefu commented 9 years ago

a large amount of it has been changed.

If you're referring to ChunkManager, I changed it. Our group added all the graphics capabilities, so I don't think yours could be at fault for the cross-platform issues.

Anyway, updates: I switched to using textures instead of raw colors for the voxels. 2015-03-06_21-57-08

Amateur GIMP skills, hurray.

I tested on my Ubuntu VM, but I doubt this will fix the issues of crashing and voxels not appearing, since I haven't been able to reproduce that bug yet. Hopefully our group will have access to an OSX machine soon. Otherwise we'll be stuck blindcoding glEnable's, which is insanity.

sammywhammy commented 9 years ago

Alright, we were able to successfully render the voxels with textures on a mac! screen shot 2015-03-07 at 1 57 06 pm

@ksundberg could you review our pull request once more?

ostlerc commented 9 years ago

ubuntu seems to display properly as well now. Did you remove the shortcut keys for the tools menu for a reason?

tefu commented 9 years ago

Did you remove the shortcut keys for the tools menu for a reason?

I just realized we did. I think adding the EVT_KEY_DOWN event to the canvas overrides the main app's shortcut keys. I'll try looking into getting those keys back.

waredavid commented 9 years ago

I can't get this code to run on my Ubuntu VM

tefu commented 9 years ago

Does it not compile, or does the executable just not run? If it's the latter, did the rotating cubes not run for you as well?

waredavid commented 9 years ago

It compiles but when I run the program it crashes. I can run the program with the rotating cubes. On Mar 17, 2015 12:00 PM, "tehul" notifications@github.com wrote:

Does it not compile, or does the executable just not run? If it's the latter, did the rotating cubes not run for you as well?

— Reply to this email directly or view it on GitHub https://github.com/ksundberg/CS5500/pull/35#issuecomment-82500313.

ostlerc commented 9 years ago

This draws nothing for me on osx. I do not get a crash however.

tefu commented 9 years ago

Huh, not sure what's going on. There's a lot of OpenGL boilerplate we had to play with to get it working, mostly caused by switching to modern OpenGL. Maybe we missed something necessary. I'll try looking into it.