8 ms·
Show HN: Procedural Voxel Rendering in WebGL
- nergal 11y agoNice! What shader (I guess?) is used to make the cube borders looking a bit rounded?
- guillaumec 11y agoAuthor here: this is simply using a bump texture.
- vog 11y agoDoesn't work here: Blocked loading mixed active content "http://bootswatch.com/slate/bootstrap.min.css" Blocked loading mixed active content ... You may want to include your JavaScript via "//bootswatch.com/..." instead of hard-coding unencrypted HTTP via "http://bootswatch.com/..." http://bootswatch.com/..."
- guillaumec 11y agoThanks, I just put the js in the webpage directly. That should fix it.
- willvarfar 11y agoLovely! Reminds me of L-Systems such as the 2D Context-Free Art http://www.contextfreeart.org/gallery/ http://www.contextfreeart.org/gallery/ and the 3D Structure Synth https://www.flickr.com/groups/structuresynth/ https://www.flickr.com/groups/structuresynth/ I had planned to use such a system one day for a Ludum Dare entry :)
- guillaumec 11y agoYes, the syntax is directly inspired by ContextFreeArt. I didn't know about Structure Synth, it looks very cool.
- im_down_w_otp 11y agoNeeds more Comanche ;-)
- bobajeff 11y agoWorks on my phone!
- stcredzero 11y agoIs this actually voxel rendering, or is it voxels rendered with polygon rendering techniques? https://en.wikipedia.org/wiki/Voxel#Rendering https://en.wikipedia.org/wiki/Voxel#Rendering
- deleted 11y ago[deleted]
- Cacti 11y agoHuh? What is "actual voxel rendering"? I mean, short of using special hardware and raycasting methods, everything is going to be reduced to triangles of some form. Even the more specialized stuff that NVIDIA has been working on.
- stcredzero 11y agoI mean, short of using special hardware and raycasting methods, everything is going to be reduced to triangles of some form The state of the art practice is to reduce everything to triangles. But in the 90's, voxels were more proposed as a more "pure" way of viewing complicated/spatial/geometric scientific datasets. If I recall correctly, there were specialized raycasting methods involved.
- oofabz 11y agoNot everything has to be drawn as a triangle. You can apply a fragment shader symmetrically to every pixel in a framebuffer, instead of using geometry to apply different fragment shaders within each triangle. This technique is commonly used to post-process already-rendered scenes, like with a tone mapping shader or depth of field effects. But for simple scenes you can also put an entire rendering engine in the fragment shader, typically using ray marching. Here are some examples of this technique being used to draw voxels: https://www.shadertoy.com/results?query=voxel https://www.shadertoy.com/results?query=voxel
- Cacti 11y agoThat is a very good point, I forgot about that option. Do you think this will be a realistic option at some point for wide-spread use? The stuff I saw from NVIDIA looked like they think a hybrid approach (voxels are shoveled to the GPU in a octree arrangement to handle ray marching, but the output is traditional triangles) would work best for efficiency reasons.
- vmorgulis 11y agoVery cool and powered by emscripten!