very simple pure CPU raymarching demo

2016-01-24 Thread ketmar via Digitalmars-d-announce
the following[1] is the demo of pure CPU implementation of the famous "raymarching" algorithm[2]. of course, doing that in GLSL shader will be many times faster (10x? 20x? dunno), but i'm too lazy to port the necessary gl headers (and don't want to use derelict for some random reason ;-), so i

Re: very simple pure CPU raymarching demo

2016-01-24 Thread ketmar via Digitalmars-d-announce
ok, just4fun, mulththreaded renderer[1]. set ThreadCount to number of your CPU cores to get some speedup. note: this is not how `std.concurrency` should be used! please, don't do wroker queues as i did! [1] http://ketmar.no-ip.org/dmd/zrm3_adam_trd_x4.d

Re: very simple pure CPU raymarching demo

2016-01-24 Thread karabuta via Digitalmars-d-announce
On Sunday, 24 January 2016 at 14:18:23 UTC, ketmar wrote: ok, just4fun, mulththreaded renderer[1]. set ThreadCount to number of your CPU cores to get some speedup. note: this is not how `std.concurrency` should be used! please, don't do wroker queues as i did! [1]

Re: very simple pure CPU raymarching demo

2016-01-24 Thread ketmar via Digitalmars-d-announce
This is the kind of maths I hoped I could try to understand. The spirit is not there :) it's very easy, actually. the basic idea is this: our "primitive" functions returns distance from a given point to the primitive. i.e. auto point(1, 2, 3); float dist = BoxPrimitive(point); now `dist` is