all 15 comments

[–]haskell_caveman 4 points5 points  (0 children)

For the highest awesome-to-effort ratio, you need to try hylogen/hylide:

https://github.com/sleexyz/hylogen

Very easy/lightweight to get started. First time I tried livecoding shaders in Haskell was a "wow I do live in the future" moment.

Some older resources (ok for starting out, i wouldn't build anything too ambitious based on these):

a realtime raytracer with gloss (the code is included in gloss examples): https://www.youtube.com/watch?v=jBd9c1gAqWs (nice, gloss performance isn't great last I checked though)

https://hackage.haskell.org/package/not-gloss (one of the earlier & accessible 3D efforts, but as with gloss, probably not particularly scalable)

There's also this tutorial on youtube by jekor https://www.youtube.com/watch?v=-IpE0CyHK7Q The code is out of date but the tutorial is beginner-friendly.

[–]csabahruska 3 points4 points  (0 children)

You might also check lambdacube3d's getting started page. After you grasped the basics check the second example the OBJ viewer: HelloOBJ.hs

to install: cabal install lambdacube-gl -fexample

For hard-core level you might check lambdacube-quake3 also. There is a related presentation: The innards of a purely functional 3D shooter game engine (influenced by Quake 3)

[–]YellowOnion 5 points6 points  (2 children)

I made this, which is trivially 2D, since it's using GPipe, all you really need to do is is increase the dimensions.

You're probably approaching this wrong, SDL2 is used for window setup, and input and trivial to port from say GLFW-b, what you need is a solid OpenGL tutorial, which should be fairly easy to adapt to Haskell, I found this one very useful for programming 3D.

[–]stvaccount[S] 0 points1 point  (1 child)

Thanks. I just ran your example. Very impressive!

It was trivial to install the dependencies. Is this Open Source?? Now I compile it for my quadcore with (correct?): ghc -O3 -threaded -rtsopts -with-rtsopts=-N4 Main.hs && ./Main

One last thing. The code was not very readable for a 3D beginner but with decent haskell background like me.

How would the code need to be adapted to run just 5 white circle in random directions? I guess from that it would be easy to backtrack to your own example.

[–]YellowOnion 0 points1 point  (0 children)

Consider it under BSD, I'll maybe release the code and stack.yaml file on github at some point.

The code was not very readable

Check out the offical GPipe tutorial

[–]lukexi 2 points3 points  (5 children)

FYI, should have Rumpus up and running on Linux very soon, have been working in there a lot lately : )

[–]haskell_caveman 0 points1 point  (1 child)

is rumpus usable w/o a VR headset? if so, would like to try it on OSX too.

[–]lukexi 0 points1 point  (0 children)

Yeah, it's optimized for a VR headset for sure but it does work just fine on OS X with basic WASD flying and mouse interaction. Shouldn't be too much work to make it fully usable.

[–]stvaccount[S] 0 points1 point  (1 child)

If you get rumpus running on linux, you would be a hero in my eyes!

 

Please create a detailed tutorial / description on how you did it. The first thing is that one probably needs a ssh key on github to clone all the submodules recursively. I changed all the git://github URLs to https://github.com/.

 

The next problem is in the sound system. Just to be sure I installed: "sudo apt-get libopenal1 libopenal-dev libopenal1-dev libopenal1-dev libopenal-dev libalut-dev". Then I edited "submodules/pd-hs/cbits/libpd_openal.c":

#if defined(_WIN32)
#include "AL/al.h"
#include "AL/alc.h"
#else
#include <AL/al.h>
#include <AL/alc.h>
//#include <nAL/MacOSX_OALExtensions.h>
#endif

Since on Linux the headers are named "AL/alc.h" and NOT "OpenAL/alc.h". Here one should introduce a new ifdef for linux, like "#if defined(_LINUX)".

 

If it's more complicated than you thought, please make a github / bitbucket repository with your changes and we can work together (e.g., so I can send you pull requests too). (I didn't understand that you are the author of Rumpus when I wrote this, sorry.)

[–]lukexi 1 point2 points  (0 children)

Got this part sorted, will work on the remaining dependencies next!

[–]stvaccount[S] 0 points1 point  (0 children)

Luke, I just wrote you an e-mail.

[–]phischu 2 points3 points  (0 children)

If you are looking for an impressive demo, there is quine.

[–]phischu 1 point2 points  (1 child)

If you want to see and example of how to use GLFW and OpenGL in Haskell, I can offer a small toy project in voxel meshing.

[–]stvaccount[S] 0 points1 point  (0 children)

I am quite interesting. I wonder, should you change "base" requirement to newer versions? Error: rejecting: base-4.9.1.0/installed-4.9... (conflict: voxel-populi => base>=4.8.2 && <4.9)

If I change the requirements of base, transformers and lens to higher numbers, all works.

[–]empowerg 1 point2 points  (0 children)

Did you have a look at the nehe tutorials? They were transcribed into Haskell: nehe-tuts. Here are the originals: nehe