Ray tracer performance

Started by
17 comments, last by Geri 11 years, 10 months ago
I've not touched my ray tracer experiment in a few years, it was never meant to be real time, but it was quite feature rich outside of geometry.

Spheres/Boxes/Tori/Cylinders/Cones/Heightmap terrain aswell as any affine transformation. with point lights and directed ponit lights (emmiting light like a cone)
more importantly. CSG operations on the primitives with ability to group objects together and perform multiple CSG operations.

It was more feature rich in terms of shading, you could combine alpha maps and different textures to overlay on the primitives to vary reflective properties, refractive properties at that point of the surface and diffuse/specular properties, and normal maps of course and multisampling for nicer renderings.

And i also got ruond to adding a primitive photon mapping pass.

Uploaded the old screenshots i have to here:http://gust.isjackd.in/luca/drt/

with my favourites being:
http://gust.isjackd.in/luca/drt/terr3.jpg Terrain with a subtracted torus, all nice and reflective with the heightmap using a normal map and a smooth torus surface.

http://gust.isjackd.in/luca/drt/new3.jpg showing some photon mapping.

http://gust.isjackd.in/luca/drt/csg6.jpg cool shape by subtracting a double-cone from a torus.
Advertisement
I have some real time stuffs, too: plug.

There's also a quite (SSE) optimized 4DOF one: tinscape. Should render 10 fps on a quadcore at 1680x1050.

And I also have a special thingy that happens to be a non-runtime ray tracer, i.e. the image data is generated during compilation.
at the last week, i got sick from gpu's FOREVER.

so i made a new ray tracing conception. in last year, i was like ,,i cant write it enough fast, i forget ray tracing for a while''.
even my graphics engine is starts to be a bit obsolete. so i will need some new, within years.
so i got sick from hardware 3d at all, there is only suck with it
GERI I DOWNLOADED THE NEWEST DRIVER AND NOW YOUR PRODUCT RUNS WITH 15 FPS. WITH THE LAST, IT WAS 65.
or:
GERI I HAVE INTEL, AND YOUR STUFF CRASHING.
1765-96-20090311100848.jpeg

hardware 3d is enough for me. gpus are buggy, limited. platform dependent, driver dependent. funny io-waits from the times of 80286 architecture.
incohesive with the system, slow, in the past 15 years, its not evolved (no, shaders arent one, 3dfx was alreday experimented with them in 97)...
overcompilcated, overmistifyed, ugly, unusable.

oh, both directx, opengl, and opencl, cuda, and other useless craps can go to garbage with they retard propaganda too.

so i will switch to software rendering, if i can.

my first ray tracer bakc then, years before, was too slow.
so i rewrited it, and created a new. it was slow too.

so i revited it at third time (the songoku image up) but that is too limited
(no dynamic scene, and even if it supports unlimited polygons, its slow, only 20 fps in 512x256)

but now i MAYBEE found a way, how i would able to create a ray tracer that is:
-unlimited polygons
-dynamic
-shadow, reflection, refraction, light component division
-maybee i would able to run it playable on a 4 core cpu
-HD image with core2quad or above
-10-200x (!) faster than the previous (da songoku)
-no gpu at all
-ARM support
-only eats very little ram (total loaded polygons and textures + ~40 mbyte)
-aa, dof
-clear image
-light overbright
-24 bit rendering

i would copy my existing particle system and hack it together with phisics
and i would maybee write a new phisics engine that is cohesive with this


in the past 3 days, i have coded it: the renderer is 130 kbyte, and its almost 100% finished
(i should not write 45 kbyte source code on one day, it makes me sick)

done = does not even tested, but putted and coded everything together, it will need probably days/weeks/months to debug and pseed it up.
codename: InstantPath
platform: CPU (Win64, linux64, OSX)
type: Box based

speed:
cpu: Q9450 @ 2.67GHz (stock performance)
loading time: <1 sec
poly num: 8 boxes
res: 512x512
effects: path tracing (with specializations like MetropolisLT or bidirectional-PT)
fps: 15-20 fps

http://twitpic.com/3vatoi

I started it as a research to validate my long time idea, to calculate lighting based on a grid/boxes/voxel on cpu.
the first version took about 45min to render that picture, I've added:
-task system optimized for fine grain jobs
-sse4 lib, supporting everything I've done in singles in a vectorized ways, like random number generation, sin/cos/pow/log, branchless intersections etc.
-quite a lot of boost was given by choosing the random ray direction in a smarter way, which is a cosine importance samples hemisphere with a very regular, yet random distribution
-some salt and pepper to eliminate death paths (as this is an unbiased tracer and ~98% were death with this lightsource size -> wasted time).
I've not done much research on real time ray tracing, but couldn't you use rasterization, in the form of something similar to deferred shading to accelerate the performance? You could generate all your primary rays by rasterizing the scene on the GPU into multiple render targets, which would give you depth, color, normal and position for each pixel. Then you could ray trace only your secondary rays and do your shading. It seems like a waste to spend so much time tracing primary rays.

I fully agree and I had the same sensation back in 2006-2007 where I decided to make the jump to pure software rendering again. Ah, liberating. Finally some fresh air :-) Btw ray tracing is not necessarily your best bet even if it's the coolest ;-)

at the last week, i got sick from gpu's FOREVER. so i made a new ray tracing conception. in last year, i was like ,,i cant write it enough fast, i forget ray tracing for a while''. even my graphics engine is starts to be a bit obsolete. so i will need some new, within years. so i got sick from hardware 3d at all, there is only suck with it GERI I DOWNLOADED THE NEWEST DRIVER AND NOW YOUR PRODUCT RUNS WITH 15 FPS. WITH THE LAST, IT WAS 65. or: GERI I HAVE INTEL, AND YOUR STUFF CRASHING. hardware 3d is enough for me. gpus are buggy, limited. platform dependent, driver dependent. funny io-waits from the times of 80286 architecture. incohesive with the system, slow, in the past 15 years, its not evolved (no, shaders arent one, 3dfx was alreday experimented with them in 97)... overcompilcated, overmistifyed, ugly, unusable. oh, both directx, opengl, and opencl, cuda, and other useless craps can go to garbage with they retard propaganda too.
(btw, it seems my new ray tracer code is also damn slow biggrin.png)

however, i will try to optimise it.

i have a very good idea for the API, i designed a very good conception. if it will work in reality, i will release the api documentation publically, for free, even if i cant code it myself.
maybee some peoples will find this api usable, this api can be wrapped to every existing ray tracer (even over gpu's, it does not matter if i hate them or not tongue.png).

it would be nice if there would be an usable, free ray tracing api for games (like directx and opengl).
(yeah, i know, there is some attempts for this alreday, but i find them overcomplicated, heavy, and the does not satisfy my conceptions at all)
my conception successing.

i was able to reach 33 fps with a 4 core amd cpu with a simle shadow, in 1024x512, with a ~4 million polygons.
so basically it matches my old simple opengl graphics engine with 1 shadow in the same resolution

i also succesfully implemented unlimit polygon technique with logarithmical compute demand. 1 billion polygon eats only around 1 gbyte of ram, and almost runs on playable framerate.

my current problem is the x86's low random memory reaching performance, i hope i will find a trick to do something with that shortly
btw i created a topic on phantomus site at http://igad2.nhtv.nl...c.php?f=3&t=328 to blog the news from my ray tracer.

also a block diagram from my ray tracing engine

122-csillamtraceblockdiagram.png

suprisingly, it works

This topic is closed to new replies.

Advertisement