POV-Ray : Newsgroups : povray.binaries.images : some of my little raytracer results Server Time
24 May 2026 11:17:18 EDT (-0400)
  some of my little raytracer results (Message 1 to 3 of 3)  
From: ingo
Subject: some of my little raytracer results
Date: 21 May 2026 04:19:58
Message: <6a0ec02e@news.povray.org>
In 
https://news.povray.org/povray.general/thread/%3C69f841da%40news.povray.org%3E/ 

I wrote a bit about a little ray tracer I'm writing. Besides the image,
it now writes a lot of data to a SQLite database. Amongst that is the 
ray graph
for each pixel. This, with some other data can then be queried:


  NimRay Query tool
  renders analytical images from a NimRay database.

  Usage:
    nrq <database.db> <query> [options] [output.ppm]

  If output.ppm is omitted, writes P6 binary PPM to stdout.

  Queries:
    pixels              Final composited image
    reconstruct         Reconstruct image from raygraph + lightContribs
    primary             Primary hits only, no reflections (TODO)
    normals             Surface normal map (XYZ → RGB)
    depth [near] [far]  Depth map (default near=0.1 far=20.0)
    raygraphlength      Ray graph length per pixel
    bouncedepth         Deepest reflection bounce per pixel
    albedo              Material base colour, no lighting
    shadow              Shadow occlusion fraction per pixel
    ao                  Ambient occlusion approximation
    shapemask           Shape/background mask (white=hit, black=miss)
    light <n>           Contribution of light N
    reflectiondepth <n> Reflection rays at exactly depth N
    crossshape <y> <x>  Pixels where primary hit shape Y, reflection hit 
shape X

Most of it works fine. The one that doesn't yet is a complete image
reconstruction from the ray-graph. Can't get the query going properly. 
It works for a single ray, but running that for each pixel also takes
ages.

So far a lot of analytical data can be extracted, see images. An 
interesting one
is the ray-graph length. It could be used to analyze and subdivide the
multithreaded work load over different sized areas.

My toy renderer is single threaded. It's 840 KB large and has SQLite 
build in.
Without using the database it renders the image in ~0.3 s. with database
it takes ~2 seconds more. The resulting database is a whopping 220292KB. 
For archiving it can be compressed ~5.5x by 7zip.

Each of the analytical images are created in less than a second, didn't 
time them.

ingo


Post a reply to this message


Attachments:
Download '_pixels.png' (44 KB) Download 'albedo.png' (3 KB) Download 'ao.png' (6 KB) Download 'bouncedepth.png' (4 KB) Download 'crossshape0_1.png' (2 KB) Download 'crossshape0_4.png' (2 KB) Download 'crossshape4_0.png' (2 KB) Download 'depth.png' (12 KB) Download 'light0.png' (22 KB) Download 'light1.png' (36 KB) Download 'normals.png' (30 KB) Download 'raygraphlength.png' (7 KB) Download 'reflectiondepth2.png' (11 KB) Download 'reflectiondepth4.png' (4 KB) Download 'shadow.png' (6 KB) Download 'shapemask.png' (2 KB)

Preview of image '_pixels.png'
_pixels.png

Preview of image 'albedo.png'
albedo.png

Preview of image 'ao.png'
ao.png

Preview of image 'bouncedepth.png'
bouncedepth.png

Preview of image 'crossshape0_1.png'
crossshape0_1.png

Preview of image 'crossshape0_4.png'
crossshape0_4.png

Preview of image 'crossshape4_0.png'
crossshape4_0.png

Preview of image 'depth.png'
depth.png

Preview of image 'light0.png'
light0.png

Preview of image 'light1.png'
light1.png

Preview of image 'normals.png'
normals.png

Preview of image 'raygraphlength.png'
raygraphlength.png

Preview of image 'reflectiondepth2.png'
reflectiondepth2.png

Preview of image 'reflectiondepth4.png'
reflectiondepth4.png

Preview of image 'shadow.png'
shadow.png

Preview of image 'shapemask.png'
shapemask.png


 

From: ingo
Subject: Re: some of my little raytracer results
Date: 22 May 2026 02:42:18
Message: <6a0ffaca$1@news.povray.org>
recreating the image from the ray-graph now works, takes half a second 
single threaded. That makes it possible to change the colour of a light 
in post production.

ingo


Post a reply to this message


Attachments:
Download 'changelight.png' (41 KB)

Preview of image 'changelight.png'
changelight.png


 

From: jr
Subject: Re: some of my little raytracer results
Date: 24 May 2026 05:35:00
Message: <web.6a12c549c5380a4f22ad5b506cde94f1@news.povray.org>
hi,

ingo <ing### [at] nomailcom> wrote:
> In
> https://news.povray.org/povray.general/thread/%3C69f841da%40news.povray.org%3E/
>
> I wrote a bit about a little ray tracer I'm writing. Besides the image,
> it now writes a lot of data to a SQLite database. Amongst that is the
> ray graph
> for each pixel. This, with some other data can then be queried:
> ...
> My toy renderer is single threaded. It's 840 KB large and has SQLite
> build in.
> Without using the database it renders the image in ~0.3 s. with database
> it takes ~2 seconds more. The resulting database is a whopping 220292KB.
> For archiving it can be compressed ~5.5x by 7zip.

v interesting stuff, I wish I had "head space" for.

what happens if, say, you re-render the same scene but with the camera moved a
little, does the whole database need rewriting/rebuilding ?

thanks.


regards, jr.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.