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'

Preview of image 'albedo.png'

Preview of image 'ao.png'

Preview of image 'bouncedepth.png'

Preview of image 'crossshape0_1.png'

Preview of image 'crossshape0_4.png'

Preview of image 'crossshape4_0.png'

Preview of image 'depth.png'

Preview of image 'light0.png'

Preview of image 'light1.png'

Preview of image 'normals.png'

Preview of image 'raygraphlength.png'

Preview of image 'reflectiondepth2.png'

Preview of image 'reflectiondepth4.png'

Preview of image 'shadow.png'

Preview of image 'shapemask.png'

|