Raytracing speed again, this time with gdc.
dominik
aha at aha.com
Wed Nov 7 10:37:02 PST 2007
"downs" <default_357-line at yahoo.de> wrote in message
news:fgskq5$1p5n$1 at digitalmars.com...
> writefln("P5\n", n, " ", n, "\n255");
> for (int y=n-1; y>=0; --y)
> for (int x=0; x<n; ++x) {
> double g=0;
> for (int d=0; d<ss*ss; ++d) {
> auto dir=Vec(x+(d%ss)*1.0/ss-n/2.0, y+(d/ss)*1.0/ss-n/2.0,
> n).unitise();
> g += ray_trace(light, Ray(Vec(0, 0, -4), dir), s);
> }
> printf("%c", cast(ubyte)(0.5 + 255.0 * g / (ss*ss)));
> }
> }
what kind of output is this? how do you view result?
More information about the Digitalmars-d-learn
mailing list