Commit Graph

78 Commits

Author SHA1 Message Date
MitchellHansen
8c1f18ac70 Software raycasting now works, but has some major problems / is extremely
slow. Perhaps it will only be useful in debugging the kernel via emulation
2016-11-04 23:11:24 -07:00
MitchellHansen
b2988f0e13 Would help if I added the files 2016-11-04 04:18:34 -07:00
MitchellHansen
5f24a4cf3f A good portion of the fallback software caster is done.
Need to test, add global lighting, add switch
2016-11-04 04:16:03 -07:00
MitchellHansen
d1bd4ce667 The new rendering method now works on the full compat case.
Added a kernel to help test opencl data passing
renamed the kernels, buffers, etc.
2016-11-04 03:28:23 -07:00
MitchellHansen
5528e03c69 Saving minor tweaks 2016-11-02 15:58:15 -07:00
MitchellHansen
518cc757a3 Lots of work done moving the various raycasting implementations over to a
consolidated RayCaster class.
2016-11-02 00:09:32 -07:00
MitchellHansen
45627e6a85 Whoops, forgot to save the files, same commit as before 2016-10-29 23:56:50 -07:00
MitchellHansen
51093beaca Starting to condense the rendering and switching between the different
methods
2016-10-29 23:55:58 -07:00
MitchellHansen
ef4c001bf2 Bug in the current crimson drivers (16.10.3) which incurs a 500kb per
cycle memory leak when using printf statements inside cl kernels
2016-10-29 18:49:43 -07:00
MitchellHansen
561c07c602 Turned off experimental phong lighting in the kernel
fixed all compiler errors thrown by MSVC
Switched experimental octree map back to the old map
Refactored old map system, prettied it up
2016-10-29 00:42:49 -07:00
391dc63ec8 Bit of fiddling around while refractoring 2016-10-25 19:18:50 -07:00
c734614e5f cleaned up an unused file, added check for sharing 2016-10-10 23:14:45 -07:00
MitchellHansen
de2f0ad6a1 In the middle of a couple of things right now, but decided to focus a
little bit less on the lighting and start laying groundwork for the SVO
The map section was in real need of some love so I deleted a bunch of
stuff and started prototyping the pointer arithmetic that I need to do
2016-10-06 23:25:31 -07:00
MitchellHansen
4c31cfaf48 remove some debug to make it clearer where I left off 2016-10-03 00:13:45 -07:00
MitchellHansen
1c750451f3 Added a 1/4 working phong shading function, breaks when the light
direction in in negative values. The normals of voxels also are
symmetrical which needs to be fixed.
2016-10-02 23:42:13 -07:00
MitchellHansen
ed56511eab Merge branch 'master' of https://github.com/mitchellhansen/voxel-raycaster 2016-10-02 13:08:45 -07:00
MitchellHansen
0b3557cd5e Tweaked indexing, there is a discrepancy at z_max values that I need to
sort out. Added some 2d optimization functions for fun, currently doing a
class involving them
2016-10-01 23:01:52 -07:00
Mitchell
5421e6a183 Update README.md 2016-09-23 21:38:26 -07:00
MitchellHansen
582e37f540 added small example video 2016-09-23 21:36:10 -07:00
MitchellHansen
1620f40d02 Fixed the camera movement so it now take into account sub-voxel movement
Also fixed the distortion around the XY axes
2016-09-23 14:08:01 -07:00
MitchellHansen
fe0fbc04e1 little edit to get rid of some cl boilerplate 2016-09-22 22:18:30 -07:00
MitchellHansen
e13280bb07 added relative camera controls, now handles like an actual fly cam. 2016-09-22 21:48:38 -07:00
92aee8c4ca Would help if I actually added the files 2016-09-19 03:01:47 -07:00
fecf8dd8ee Reveting to an older build. Something on the mac build stopped my card from running it.
Added camera class
Added a create_buffer method
Cleaned up much of the main function
Added Vector4 class, ported from sf::Vector3
Various other edits
2016-09-19 02:59:33 -07:00
3220a03677 Redid the colors, added a few comments 2016-09-05 22:17:52 -07:00
10bc771807 MBP was having problems with out of bounds memory operations with the way the cam dir was handled. sf::vector3f -> float3 and while accessign the Zth element. I'm assuming it was because of some weird backend stuff regarding that gentypeOdds are actually gentypeOdds + 1. Converted write_imagef's to write_imageui's though I don't think that really helps anything. Fixed the bottom half of the screen getting cut off. View matrix import error. Fixed problem the MBP had with negative values during device init, that was a weird one. 2016-09-05 22:01:07 -07:00
MitchellHansen
4e96985104 added lighting, stole a terrain generator and ported it. 2016-09-05 15:35:46 -07:00
MitchellHansen
e1080baab0 opencl has no rand, SO rand method to make fog a little better 2016-09-05 00:24:26 -07:00
MitchellHansen
6f5d2b2f6f Changed to non branching algo, sped up a good 30-50 ms at the current max
ray dist. Also changed bounds checking a little, not sure if it's faster
2016-09-04 23:59:39 -07:00
MitchellHansen
160756186d mouse and camera movement work, stress testing. Can actually handle an
impressive amount of resolution and voxel space for 0 optimization!
2016-09-03 21:13:03 -07:00
MitchellHansen
f487895f9f that was a pain. Got it working on windows again. MSVC was being really
picky about a few errors. Good thing though, I'm not really sure why
clang + osx let me be that lax with memory
2016-09-03 19:23:50 -07:00
9c99f9edd0 some tweaks, switching to windows for the weekend 2016-09-03 17:46:48 -07:00
cf607382a9 WORKING! Awesome! It now casts fully inside the gpu,
context is then switched to gl and then rendered via sfml.
It has no loop, no controls, and the aspect ratio is off,
but holy hell it works!
2016-09-01 22:45:48 -07:00
c565d0facc Refactored the cl init stuff, added the rest of the image handling in.
The test kernel now draws a few pixels to the screen. Pretty much set up nowto start writing the raycaster
2016-09-01 21:35:08 -07:00
a7234675cb Continuing on adding argument handling.
Added a small sample texture and sprite which can be handed over to either gl or cl and then handed back. It can then be rendered.
Changed to just an array of floats for the view matrix
2016-08-31 21:47:56 -07:00
11146a6551 Getting things passed over to cl. No vector4 datatype in sfml,
and cl only passes by even numbers of vectors. Update to 2.4? or
make my own sf::Vector4?
2016-08-30 20:43:35 -07:00
0b9010b007 little tweaks, tomorrow/this week will hook up the arguments and data loading 2016-08-29 21:31:04 -07:00
5d9d3c4f4d Ah, I'm a dummy. Forgot to initialize the command queue! No wonder why it
was invalid...
2016-08-29 20:29:56 -07:00
c3902c2f6e Added args and buffer handling, but now clEnqueueNDRangeKernel is failing
with the error invalid command queue. Haven't seen that one before, and
cursory google suggests it's a problem with MBP's. Fun! I'll keep taking
a look, and I'll try it on my windows machine here soon
2016-08-29 18:51:46 -07:00
0c70c24a52 Switched names, thinking about how to do kernel args, and buffers.
Need to do a bit more reading on how to set up interop.
Also need to figure out the buffer thing for regular primative buffers, and also image buffers
2016-08-28 22:40:29 -07:00
5dea2494a0 Large amount done. OpenCL is almost completely abstracted out to the class
from init to kernel compilation. Next will be getting buffer handling, executing, and reading done.
Changed the kernel to a more minimal example.
Added a jump table for error codes and an assert function for error checking.
Added a routine to compare all the available cl devices and platforms, chooses the high clock of either the GPU or CPU.
2016-08-15 00:07:30 -07:00
MitchellHansen
ce2623f302 cl wrapper, clapper, hah 2016-08-14 16:51:31 -07:00
MitchellHansen
edd8075afb Added a quick printout of the hardware info. Running into a problem choosing between platforms, going to abstract CL out into it's own class and hide all that logic 2016-08-14 00:03:44 -07:00
3c9b39f682 added the final kernel create function, moved around includes
Next on the plate is either, abstract the cl routine, or
begin digging into creating the kernel
2016-08-11 21:48:37 -07:00
d2b79ceec3 Added a compilation routine, probably will abstract all this out into
it's own class / function. Added a small kernel that I got from a tutorial
to test the compilers error codes. Added a small notes file with error
codes. Added some error checking for the error codes
2016-08-11 21:39:06 -07:00
49817f94b7 Had a linking problem in the CMakeLists, fixed.
Added a test file to check for cl/gl interop support & supported cl version
Finished CL setup up to the creation of the command queue
2016-08-11 20:25:43 -07:00
bc093ef4e4 Cleaned up the cmake file. Imports SFML, CL, and GL now.
But I'm not sure how well it will work on windows so I need
to test that out. Also added a stack overflow snippet to
check your compute devices and give their opencl version
2016-08-09 18:31:02 -07:00
98be74d0f4 Merge branch 'master' of https://github.com/mitchellhansen/voxel-raycaster 2016-08-08 22:35:45 -07:00
8f809f5f70 Starting on OpenCL, got cmake to link it correctly, and started on
a minimal example
2016-08-08 22:33:47 -07:00
Mitchell
c26b765a8f Update README.md 2016-08-08 21:37:33 -07:00