Ever wrote your own renderer?


#1

Did you ever write a renderer, just for kicks? I know many computer graphics courses have the assignment of implementing a raytracer, but how about the rest of us? Share your results!

I started writing my own raytracer, it just rendered its first diffuse sphere. It’s @#%} slow (Java), but it’s mine, all mine :wip: I’m going to use this to add some practice to all the theory I sucked in my head from various textbooks, web sites and papers.

Did anyone here ever write a REYES renderer? There are lots of hobby raytracers on the net (mine to be added soon…) but hardly any REYES renderers.


#2

i did write a software renderer, but it was for an exam and i had about 2 weeks, between other exams, so it’s not very interesting!

:wink: all i can say is that it barely works and imports models (unanimated) from Max and Maya.

lots to work yet!
:wip:


#3

Yes, I wrote a Reyes renderer in my free time purely for fun. It took quite a while >3 years, but that was mostly because it was a learning exercise and I didn’t plan it at all, it just evolved. The main reason for writing it for me was that at the time there was no Renderman renderer on Windows (BMRT was Linux only then) and I wanted to play around with the neat features like programmable shading and programmable displacement. As it turned our, ther renderer itself has taken up all of my free time since, so I’ve never really had time to play with it.

The good thing about going Reyes/Renderman for me was the breadth of learning needed to do it properly. In addition to the obvious rendering related stuff, I had to force myself to learn something about compiler development for the shader compiler. Virtual machine design for the shader VM. RIB parsing, memory management, etc.

It is available now as an Open Source project if you want to take a look (http://www.aqsis.com).

Cheers

PaulG


#4

Here’s my extremely poor attempt. it does spheres and almost does planes (never finished that bit). Plus it’s written in Javascript as I was doing boring temp work at the time (about 2 years ago - there are much better implementations around).

http://www.rendermania.com/maniac.html

Paul’s Aqsis is an incredible piece of software and there is now a pretty healthy community around it. I for one am really glad he created it.

Simon


#5

pgregory: I use Aqsis and am very grateful that you make it availalbe to everyone.
:bowdown:
I didn’t dive into its source code yet, but I plan to do that in order to see how REYES looks like from the inside. I know the basic idea of a REYES renderer, but I don’t think I’d be able to write my own implementation of it (yet) since I don’t know how to approach the dicing.

rendermaniac: Neat! Is there any language that hasn’t a raytracer been written in? I’ve seen raytracers in Perl, Haskell and even bash!

In the mean time, my raytracer grew to a size of 15 classes and is playing little 400x300 animations at 5fps (multiple spheres with Blinn/Lambert shading and a moving point light). Coming up next: A proper scene graph organization and triangles. Should this be a thread in a WIP forum then?


#6

interesting subject :slight_smile:

i’d really love to program my own renderer, but i wouldn’t know where to start. i mean, did you use any books for reference? are there any good books out there at all that teach how you would write your own renderer?


#7

http://www.google.com/search?q=how+to+write+a+raytracer will give you a number of points to start from. In addition to that, a good textbook on computer graphics will be very helpful to give you some background knowledge. I own “Advanced Animation and Rendering Techniques” from Watt/Watt, but there are a number of other choices.


#8

Originally posted by stew
rendermaniac: Neat! Is there any language that hasn’t a raytracer been written in? I’ve seen raytracers in Perl, Haskell and even bash!

Haskell! Now there’s a language I never want to have to work in again… Two years of learning it at uni was quite enough for me (I wasn’t purely doing Haskell for 2 years… did do other stuff too, but it felt like it ;))

Anyone written a raytracer in assembly? (Or even directly in binary!)


#9

Originally posted by Hugh
Anyone written a raytracer in assembly? (Or even directly in binary!)

People did that, yes. I have seen a web page with an assembly raytracer for the C64, and I’d be surprised if there weren’t assembly language raytracers for other platforms as well.

OK…I couldn’t find a raytracer for the Palm Pilot. I guess I have to do that one myself.


#10

Andrew Glassner - Introduction to Raytracing and Realistic Raytracing by Peter Shirley are pretty good for information about raytracing in particular.

Principles of Digital Image Synthesis agains by Glassner is meant to cover a lot fo good stuff, but it aint cheap!

I am not so sure for REYES. I think the original paper describing the method is available.

Simon


#11

I don’t think the original REYES paper is available anywhere outside the ($) ACM Library.


#12

Originally posted by stew
I started writing my own raytracer, it just rendered its first diffuse sphere. It’s @#%} slow (Java), but it’s mine, all mine :wip: I’m going to use this to add some practice to all the theory I sucked in my head from various textbooks, web sites and papers.

:cry: :cry: :cry:

why oh why Java? If there’s one thing at which java is total CRAP it’s graphics. At least switch to C++! If you can write your own raytracer in java, c++ is no big deal.

Indeed I did a couple of exercises of a course I was following. It was cool, but I got a little crazy from all the math.


#13

Originally posted by stew

OK…I couldn’t find a raytracer for the Palm Pilot. I guess I have to do that one myself.

It’s not freely available, but one of the programmers of Cinema 4D ported the cinema raytracer to the palm. This was something like 3-4 years ago. It could only render a perfect sphere and was limited to black and white output (like the palm displays at the time).
FWIW,

Donovan Keith


#14

You can get a raytracer for PocketPC here http://www.yasrt.org/ (not quite Paml Pilot, but close). And Playstation 2 (well running Linux).

Simon


#15

do u have the name of the paper i have access to the acm library


#16

[edit]
Direct link didn’t work.
It’s called “The Reyes image rendering architecture”, from the proceedings of SIGGRAPH 1987.


#17

I’ve seen a raytracer in actionscript(flash).
It was… slooow :smiley:


#18

For more information on writing raytracers or other renderers or anything else to do with graphic programming, check out
Flipcode

It’s a pretty cool site.


#19

I just picked up Jensen’s book on Photon Mapping and Strothotte/Schlechtweg’s boock on NPR from the libarary. Don’t know yet if my mind is able to digest that with all the other things I’m working on right now, but who knows, maybe that’ll give me ideas for a few new shaders or some more renderer experiments.

What a nerd must I be when I read books like that for fun in my spare time?


#20

I’m currently working on a raytracer. It does polygons only and already has tons of features, but the great big thing still needs to be implemented: an exporter to get some nice scenes to render from some program (I’m planning on Blender). This is a pic I rendered with it:

The features so far:
-polygon rendering
-multiple coloured lights with shadows
-pointlights can be omnis, directs and spots
-optional attenuation and soft light-bundles
-textured object lights (Monte Carlo)
-smooth shading
-diffuse and specular lighting
-bump-maps using normal-mapping
-normal and glossy reflections (Monte Carlo)
-all material parameters optionally texture-controlled
-nearest neighbour texture filtering and bilineair texture filtering
-global illumination (Monte Carlo)
-skylight (Monte Carlo)
-different levels of adaptive anti-aliasing
-distance fog, either lineair or exponential
-accelerated rendering using bounding objects

You can check tons of pictures of all these features here:
http://home.hccnet.nl/w.vdongen/Raytracer/History.html.