Commit graph

241 commits

Author SHA1 Message Date
ZappoMan
ef2d27aba6 getting closer to working delete 2013-05-21 10:43:31 -07:00
Andrzej Kapolka
1be859ede9 Use glDrawRangeElements, which indicates the range of used indices. It may or
may not make a difference in performance, but it won't hurt.
2013-05-20 17:14:41 -07:00
ZappoMan
e1c89aac87 Merge branch 'master' of https://github.com/worklist/hifi into voxel_animation 2013-05-20 15:52:04 -07:00
ZappoMan
a53f84fcb9 latest hacking 2013-05-20 15:51:47 -07:00
Andrzej Kapolka
06c78c2f12 Tweak: let the reader know when it needs to load the full VBO. 2013-05-20 15:41:19 -07:00
Andrzej Kapolka
8d522cd3ed I believe the problem with voxel rendering is caused by the update thread's
writing the data while the render thread is attempting to read it.  This
should fix the issue.
2013-05-20 15:15:44 -07:00
ZappoMan
321d1952d6 first cut at exists bits 2013-05-20 12:56:59 -07:00
Andrzej Kapolka
3f0fd2f976 Added toggle for voxel textures; they may be slowing some machines down. 2013-05-20 12:13:23 -07:00
Andrzej Kapolka
0f2f4ee8f9 Add the discussed four lines to disable blending and enable backface culling. 2013-05-20 11:32:32 -07:00
Stephen Birarda
fc0448a148 disallow copying of VoxelSystem objects 2013-05-17 12:32:42 -07:00
Andrzej Kapolka
86ddcea87f Better names for the shaders. 2013-05-16 13:08:21 -07:00
Andrzej Kapolka
0a6b4702c6 Experimenting with simple Perlin noise shader for voxels. 2013-05-15 22:18:56 -07:00
ZappoMan
8dc61d89fc Added support for "destructive" vs "non-destructive" voxel create
- changed VoxelTree to support destructive and non-destructive mode
- added protocol packet headers to differentiate
- added new UI to switch modes
- default mode now, non-destructive.
2013-05-14 14:19:31 -07:00
ZappoMan
b196227385 Added wantResIn and wantColor feature between client and server
- Updated Voxel Server to support non-res-in version of voxel distribution
- Updated agent data to allow client to send desired res-in and color state
- added menu items to client debug menu to toggle wantResIn and wantColor
2013-05-13 15:02:46 -07:00
Andrzej Kapolka
7a653741de Don't set the renderFullVBOs flag; that's not the problem. 2013-05-13 12:30:56 -07:00
Andrzej Kapolka
eb77f5ff83 Removed debug code, more tests for staged-for-deletion. 2013-05-12 20:36:10 -07:00
Andrzej Kapolka
be88fec7d3 Fixed the major bug, which is that non-leaves were being collapsed. Update
full VBO on deletion, since otherwise we don't see the update.
2013-05-12 20:08:01 -07:00
Andrzej Kapolka
9802403749 Let's do some locking to prevent simultaneous access from different threads. 2013-05-11 15:38:49 -07:00
Andrzej Kapolka
750843e867 More editing progress. Now there are threading issues. Joy! 2013-05-10 21:02:08 -07:00
ZappoMan
ddd55104c1 CR feedback 2013-05-10 14:45:18 -07:00
ZappoMan
ef20b3e4b3 optimized performance of VoxelNode::isLeaf() 2013-05-10 14:32:44 -07:00
ZappoMan
322cb2ff23 implemented partial VBOs support in copyWrittenDataToReadArrays() 2013-05-10 13:18:51 -07:00
ZappoMan
3af8a1b8f4 code review fixes 2013-05-10 10:03:28 -07:00
ZappoMan
9dc09de75e make VoxelSystem::deleteVoxelAt() work properly 2013-05-10 09:32:56 -07:00
ZappoMan
4fe93af5cd create and delete voxels locally 2013-05-09 22:22:32 -07:00
ZappoMan
bd3ea6ef65 create and delete voxels locally 2013-05-09 22:20:13 -07:00
ZappoMan
2128cb8bff get rid of dead code 2013-05-09 17:10:25 -07:00
ZappoMan
33fc9f5389 fixed partial VBO updates 2013-05-09 17:01:20 -07:00
ZappoMan
3aa862fa34 removed some debug messages 2013-05-09 14:19:42 -07:00
ZappoMan
c73d4ddfa4 Merge branch 'master' of https://github.com/worklist/hifi into render_voxels_optimization 2013-05-09 14:06:42 -07:00
ZappoMan
f490f3ed53 More work on partial VBO updates still not working 100% correctly 2013-05-09 14:04:08 -07:00
Andrzej Kapolka
7ff8b84f4c Return the box face, as well as the distance, from the ray intersection test.
Use it to determine which voxel neighbor we create when adding.
2013-05-09 10:46:52 -07:00
ZappoMan
655f14121d Voxel Render Optimization - using blended VBO update strategy
- Fixed a bug in updateNodeInArraysAsFullVBO() that caused blended strategy
  to not work properly.
- Implement strategy to usually update only the portion of the VBOs that
  have changed, unless nodes have been removed, and then update the full
  VBO. This siginificantly improves treeToArrays() performance
- Still to do implement partial strategy for copy buffers and update GPU
2013-05-09 10:25:12 -07:00
Andrzej Kapolka
0cff127082 Merge branch 'master' of https://github.com/worklist/hifi 2013-05-09 09:56:58 -07:00
Andrzej Kapolka
785e55e06f Working on voxel editing. 2013-05-09 09:56:35 -07:00
ZappoMan
bb65137b7e Optimized performance of newTreeToArrays() by implementing blended VBO strategy
- Introduced concept of sometimes only updating the new/changed part of the VBO
  while other times updating the full VBO. This allows us to get the speed
  advantage of only partial VBO updates when nodes haven't been removed
- Some debugging output related to _alwaysRenderFullVBO
- added cleanupRemovedVoxels() which actually deletes the nodes that were
  previously removed (fixes a memory leak!!)
2013-05-08 20:33:41 -07:00
ZappoMan
244b4a17f7 lowered voxel count so Ryan can run, and handle too many voxels case slightly more gracefully than crashing 2013-05-08 18:06:13 -07:00
ZappoMan
cb5ccee1e4 CR cleanup 2013-05-08 14:32:55 -07:00
ZappoMan
ed30a03b2e CR cleanup 2013-05-08 14:30:18 -07:00
ZappoMan
70557cd51c Optimized removeOutOfView()
- don't recurse down trees that are fully INSIDE of the view frustum, because those nodes
  are guaranteed to also be INSIDE
- changes to extraData of the recurse operation to make this possible
- adding debug stats to track how many nodes are inside, outside, intersect
- change call to removeOutOfView() to not call if last elapsed time has not
  yet passed since last call (similar to treeToArrays() logic)
2013-05-08 14:24:08 -07:00
ZappoMan
7a5ce57b4e added alwaysDisplay mode to PerformanceWarnings class 2013-05-08 12:01:55 -07:00
ZappoMan
f1425216ba removed VoxelSystem::createSphere() which was dead code 2013-05-08 00:45:27 -07:00
ZappoMan
84da976383 removed _voxelCleanupLock 2013-05-06 16:38:24 -07:00
ZappoMan
f5808f43b5 some cleanup pre CR 2013-05-06 16:24:09 -07:00
ZappoMan
94529d54e8 some cleanup pre CR 2013-05-06 16:16:21 -07:00
ZappoMan
b69c1a3474 some cleanup pre CR 2013-05-06 16:14:10 -07:00
ZappoMan
68d58650a5 removed some debug code 2013-05-06 16:09:21 -07:00
ZappoMan
09923d1c97 second cut at view culling voxels 2013-05-06 15:51:56 -07:00
ZappoMan
7ba9d4aa86 First cut are removing out of view voxels and switch to using PerformanceWarnings 2013-05-06 13:32:09 -07:00
ZappoMan
af6f51527a short circuit shouldRender logic in treeToArrays() 2013-05-05 10:34:09 -07:00
ZappoMan
2c8c6a2600 Coding standard cleanup and VoxelNode optimization
- make octalCode and children members private
- add public getters for accessing these private members
- change constructor to require an OctalCode for all non-roots
- default constructor constructs a rootNode
- make primary access for deleting, adding, and accessing children through public methods that do bookkeeping
- calculate AABox on voxel creation so that we don't need to do all the math when we deal with voxels
- added methods on VoxelNode for common items like getCorner(), getCenter(), getLevel(), etc
2013-05-05 10:17:02 -07:00
ZappoMan
a4f2dc283d various changes to help debug render pipeline
- fixing some cases where TREE_SCALE was not using constant in prep for making TREE_SCALE larger
- added createLine() to VoxelTree
- added axis lines made of voxels to scene
- added corner points made of voxels to scene
2013-05-03 09:58:52 -07:00
ZappoMan
34a059db9a more optimizations of render pipeline 2013-05-02 22:26:56 -07:00
ZappoMan
771c604121 more render pipeline optimizations 2013-05-02 18:12:55 -07:00
ZappoMan
fcce4753c9 more optimizations on render pipeline 2013-05-02 16:37:31 -07:00
ZappoMan
5a14c71225 added dirty bit support to VoxelTree, use it to determine when to call treeToArrays 2013-05-02 15:57:31 -07:00
ZappoMan
8f0dd1ffa1 added render pipeline warnings menu item 2013-05-02 13:17:06 -07:00
ZappoMan
e2481f514c lower warning threshold to 1 millisecond for voxel render pipeline steps 2013-05-02 12:53:56 -07:00
ZappoMan
275772bb3d debugging voxel sending behavior 2013-05-02 12:26:51 -07:00
ZappoMan
a6d2bb73ad added warnings if bitstream processing takes too long 2013-05-01 23:24:46 -07:00
ZappoMan
6a7ebb3a55 fixed LOD issue in client 2013-05-01 22:57:19 -07:00
ZappoMan
015fd05e62 code cleanup 2013-05-01 18:37:14 -07:00
ZappoMan
62e7c0383b cleaned up some code for distanceToCamera() 2013-05-01 18:31:05 -07:00
ZappoMan
4f86b5570f first cut at improved render pipeline 2013-05-01 18:21:13 -07:00
ZappoMan
622a078d24 code review cleanup 2013-04-30 10:10:17 -07:00
ZappoMan
accda966d5 Add LOD culling to the server protocol.
- Add LOD/distance culling to VoxelTree:encodeTreeBitstreamRecursion()
  and VoxelTree::searchForColoredNodesRecursion()
- added new levels to boundaryDistanceForRenderLevel()
- added more spheres to the scene to get a better sense of LOD behavior
2013-04-29 17:38:52 -07:00
ZappoMan
781721b79c clean up constants for voxels 2013-04-29 06:49:57 -07:00
ZappoMan
7c180c800f printf/pringLog cleanup 2013-04-29 06:28:19 -07:00
ZappoMan
999930743e removed some debug code 2013-04-27 14:55:34 -07:00
ZappoMan
2f2af7ec09 removed some debug code 2013-04-27 14:53:08 -07:00
ZappoMan
70818bd3fe Added some new debugging code, removed some old debugging code, some small coding standard tweaks 2013-04-27 12:03:20 -07:00
ZappoMan
91f6aaa96e testing of new searchForColoredNodes() 2013-04-26 09:23:48 -07:00
ZappoMan
a176753379 added VoxelNodeBag 2013-04-25 23:47:12 -07:00
ZappoMan
32da105d62 new testing/debug code for encodeTreeBitstream() 2013-04-25 17:33:43 -07:00
ZappoMan
2c48139ff3 some cleanup 2013-04-25 00:02:51 -07:00
ZappoMan
0bec7156aa Merge branch 'master' of https://github.com/worklist/hifi into view_frustum_work 2013-04-24 23:50:57 -07:00
ZappoMan
9bc2f667b6 adding some temporary debugging code 2013-04-24 23:46:47 -07:00
Jeffrey Ventrella
e54fd0dd7d renamed "Head" to "Avatar" and did a bunch a cleanups, including removing the three-lined comments 2013-04-24 16:54:07 -07:00
Andrzej Kapolka
63a581dae4 Added normals to voxel geometry, enabling lighting. 2013-04-24 11:47:44 -07:00
Jeffrey Ventrella
eb631e2ef6 renamed "bodyPosition" to "position". (This corresponds to the position of the avatar on the ground, where y=0). I will next add a new "getBodyPosition" which returns the avatar's center of gravity - is useful for certain purposes, such as setting collision volumes, etc. 2013-04-23 14:05:23 -07:00
Stephen Birarda
4956370d52 have parseData return the number of bytes consumed 2013-04-22 18:05:27 -07:00
ZappoMan
4e0a3e3b58 switch to boxInFrustum() instead of pointInFrustum() for more accuracy 2013-04-22 17:21:47 -07:00
ZappoMan
358efb472d Clean up AABox to coding standard, made several methods const
- Cleaned up AABox to be consistent with the coding standard
- converted some methods to const and fixed up callers
2013-04-21 22:46:13 -07:00
ZappoMan
3dc818d31e Changed false colorization to use point in frustum for now, since that works 2013-04-21 15:22:36 -07:00
ZappoMan
67910a2c29 Merge branch 'master' of https://github.com/worklist/hifi into view_frustum_work 2013-04-19 20:08:47 -07:00
ZappoMan
75a79a09ed fixed LOD bug, added support for false colors
- fixed LOD bug related to mismatch with getting node position
- changed VoxelSystem to honor new VoxelNode color support for false color
- added some implementations of tree recursion that do things like false
  color the tree for distance, randomly, or resetting to true color, or
  stomping on the local version of the true color to debug packet sending
2013-04-19 19:58:37 -07:00
Stephen Birarda
44cb57afad put back brad's voxel stats, he loves them too much 2013-04-18 15:33:17 -07:00
Stephen Birarda
b9a1faf284 add a new SimpleMovingAverage class, replaces CounterStats 2013-04-18 14:46:39 -07:00
tosh
349e89aaa6 integrates logging for interface 2013-04-17 19:04:10 +02:00
Stephen Birarda
5c091a51a6 change signature of parseData to use unsigned char*, include packet header always 2013-04-16 11:51:36 -07:00
Stephen Birarda
a5a93443c6 re-work AvatarData to handle body position and rotation 2013-04-15 18:05:22 -07:00
vincent
56aac7077c changes after merge 2013-04-09 19:12:49 +02:00
ZappoMan
17f4c5d184 cleanup of packet header constants 2013-04-08 19:56:42 -07:00
ZappoMan
7480283dd4 cleanup of packet header constants 2013-04-08 19:54:14 -07:00
ZappoMan
53cfd0ecdd adding CounterStats class and support for showing running average stats on voxels recieved, created, and colored in client 2013-04-08 17:03:22 -07:00
ZappoMan
5415543dcd adding Z command to voxel server and interface, Z command allows sending "erase all" and "add scene" commands 2013-04-06 12:03:46 -07:00
ZappoMan
57829785eb fix to LOD bug caused by flip-flopped X and Z, add color randomization to inserted voxels on server, added head position display to display_stats() 2013-04-04 20:50:51 -07:00
ZappoMan
9220ba3ee5 Added agentTypes to AgentList::broadcastToAgents()
Make voxel server rebroadcast "remove voxel" messages to all it's connected heads
Cleaned up processing of Remove voxel messages to live in VoxelTree
2013-04-03 12:42:24 -07:00
Stephen Birarda
761daf684f don't NULL out buffer data, just draw less 2013-04-01 17:25:31 -07:00
Stephen Birarda
ec6b8d2016 bring MAX_VOXELS_PER_SYSTEM back down to 250k 2013-04-01 17:14:39 -07:00
Stephen Birarda
f38df5579b remove the VBO transfer frequency tests 2013-04-01 15:12:39 -07:00
Stephen Birarda
3135d50ca9 drop redraw frequency to 0.5s 2013-04-01 15:08:20 -07:00
Stephen Birarda
793ac841f2 only allow VBO re-transfer every 5 seconds for test 2013-04-01 14:08:42 -07:00
Stephen Birarda
2de86bfa92 Revert "allow the bad triangles to render"
This reverts commit b5d1ae1a36.
2013-03-29 16:22:10 -07:00
Stephen Birarda
b5d1ae1a36 allow the bad triangles to render 2013-03-29 15:18:34 -07:00
vincent
622053b38c #19197 Create basic visual studio 2013-03-29 20:20:52 +01:00
Stephen Birarda
3186254a93 initial LOD drop off when moving back 2013-03-29 03:42:54 -07:00
Stephen Birarda
80170bd4c4 don't do gross things if data is being written while GPU is copying it 2013-03-29 03:12:11 -07:00
ZappoMan
270f77799d added random color options, cleaned up compiler warnings, add reAverageParentColors when modifying voxel tree 2013-03-28 17:21:47 -07:00
Stephen Birarda
f109916125 move the voxel tree back to origin 2013-03-28 15:30:14 -07:00
Stephen Birarda
1b3c15a701 Merge remote-tracking branch 'origin/master' 2013-03-28 14:39:59 -07:00
Stephen Birarda
9cd314d3c4 move the voxel system to 40,0,40, only re-render on new voxels 2013-03-28 14:35:02 -07:00
ZappoMan
fe8b6f7d63 * Moved load file and create sphere from VoxelSystem to VoxelTree
* Added --local command line support to domain and voxel servers so that
  you can run them locally without recompiling.
* made command line option parsing more cross platform
* added --NoColorRandomizer to interface when loading local models
* added -i file load support to voxel server to load in a preexisting model at launch
* added --NoRandomVoxelSheet to voxel server to NOT create the built in voxel sheet
* added first cut at 'I' command from clients to voxel server to insert voxels into voxel tree
* changed ambient light settings in interface to not be so aggressive
* added randInIntRange() helper to SharedUtils
* tweat to pruneTree() to also repair child mask
* some coding standard refactoring
2013-03-28 13:54:28 -07:00
vincent
83abc571f1 #19197 Create basic visual studio 2013-03-28 18:20:50 +01:00
ZappoMan
23c6a9017c Merge branch 'master' of https://github.com/worklist/hifi
Conflicts:
	interface/src/main.cpp
	shared/src/SharedUtil.cpp
	shared/src/SharedUtil.h
2013-03-25 22:51:59 -07:00
ZappoMan
2f6b2466ea Fixed getCommandOption and cmOptionExists to be more porable
added support for --NoConnect command line option to test running without connecting
added pruneTree to VoxelTree
2013-03-25 22:39:24 -07:00
Stephen Birarda
c8190b95aa remove un-needed AgentList include from VoxelSystem 2013-03-25 16:23:42 -07:00
ZappoMan
0711539fc6 Changed colors of spheres to be a gradient along phi between to random colors
this gives the spheres a little bit more natural look.
Also increased the level of detail (smaller voxels)
2013-03-24 13:00:23 -07:00
ZappoMan
ef8694dd60 1) Added createSphere() to VoxelSystem to create a sphere
2) Added pointToVoxel() to SharedUtils, this will give you a voxel code
   given x,y,z,s,r,g,b
3) Added '.' keyboard interface to create a random sphere in the local
   voxel system
2013-03-24 10:06:43 -07:00
ZappoMan
8ecc0d53ad Added a utility to VoxelSystem for loading voxels from a local file
Also added a couple shared utility functions for reading command
line options (since that's how you can load a local file at this
point).
2013-03-23 21:59:27 -07:00
Stephen Birarda
6712d23cd1 push and pop the matrix for voxel system draw 2013-03-21 17:12:50 -07:00
Stephen Birarda
5f052d7c9e scale back heads after voxel system draw 2013-03-21 17:03:52 -07:00
Stephen Birarda
f97932353b fix conditional inclusion of voxel in vertices and color arrays 2013-03-20 16:28:28 -07:00
Stephen Birarda
1efbaef44b only add voxel to be drawn if not transparent 2013-03-20 16:21:45 -07:00
Stephen Birarda
e8f84aee78 fix rendering bugs 2013-03-20 15:32:12 -07:00
Stephen Birarda
634e9c4bf7 parse the bitstream tree and create an in memory representation to render 2013-03-20 13:25:11 -07:00
Stephen Birarda
92fc1ed1a6 receive bitstream from voxel server on client 2013-03-19 15:51:48 -07:00
Stephen Birarda
42fe3ce077 remove unused methods from VoxelSystem 2013-03-15 12:27:00 -07:00
Stephen Birarda
99e21be12c include cstring for memcpy 2013-03-13 13:29:39 -07:00
Stephen Birarda
012b4a92fd add a missing glBindBuffer that caused client to crash on voxel drawing 2013-03-13 11:58:58 -07:00
Philip Rosedale
5c1bd68580 Merge remote-tracking branch 'origin/master' 2013-03-08 16:00:17 -08:00
Philip Rosedale
f014fcd0ac transmitter tweaks 2013-03-08 15:58:49 -08:00
Stephen Birarda
686404be2b add a voxel server 2013-03-08 14:32:06 -08:00
Philip Rosedale
26fd44f030 100,000 voxel death star with concentric shells 2013-03-06 16:58:38 -08:00
Stephen Birarda
f004479e39 bump up to 300000 voxels, with color 2013-03-06 14:34:14 -08:00
Stephen Birarda
e16cd4ffc3 use vertex buffer objects to speed up voxel rendering 2013-03-06 13:56:11 -08:00
Stephen Birarda
0fbb534566 randomly draw 50000 voxels for glDrawElements test 2013-03-06 12:04:27 -08:00
Philip Rosedale
67115ccad4 First commit of 'Death Star' voxel planet 2013-02-21 11:25:52 -08:00
Philip Rosedale
5f60bf6376 recursive position vector is same as rendering. 2013-02-20 21:42:10 -08:00
Philip Rosedale
15fd9638d6 remove deadhead (of self) at origin. First commit of voxels with LOD, recursive test pattern. 2013-02-20 21:38:42 -08:00
Philip Rosedale
bd45740dc6 Partial progress on new voxel model. 2013-02-18 08:59:44 -08:00