PDA

View Full Version : Ever wrote your own renderer?


stew
11-13-2003, 09:52 AM
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.

DaKrunch
11-13-2003, 11:13 AM
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!

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

lots to work yet!
:wip:

pgregory
11-13-2003, 10:24 PM
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

rendermaniac
11-14-2003, 09:37 AM
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

stew
11-15-2003, 11:37 AM
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?

M-J
11-15-2003, 03:21 PM
interesting subject :-)

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?

stew
11-15-2003, 03:55 PM
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.

Hugh
11-15-2003, 11:56 PM
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!)

stew
11-16-2003, 01:34 AM
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.

rendermaniac
11-16-2003, 01:35 PM
Andrew Glassner - Introduction to Raytracing (http://www.amazon.com/exec/obidos/ASIN/0122861604/rendermania-20/103-7694005-5397460) and Realistic Raytracing by Peter Shirley (http://www.amazon.com/exec/obidos/ASIN/1568811101/rendermania-20/103-7694005-5397460) are pretty good for information about raytracing in particular.

Principles of Digital Image Synthesis (http://www.amazon.com/exec/obidos/ASIN/1558602763/rendermania-20/103-7694005-5397460) 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

stew
11-16-2003, 04:32 PM
I don't think the original REYES paper is available anywhere outside the ($) ACM Library.

Garma
11-17-2003, 11:10 PM
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.

Donovan Keith
12-04-2003, 11:09 PM
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

rendermaniac
12-05-2003, 10:44 PM
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

MadMax334
12-15-2003, 07:37 PM
do u have the name of the paper i have access to the acm library

stew
12-15-2003, 08:32 PM
[edit]
Direct link didn't work.
It's called "The Reyes image rendering architecture", from the proceedings of SIGGRAPH 1987.

zworp
01-07-2004, 05:48 PM
I've seen a raytracer in actionscript(flash).
It was.... slooow :D

Ahura
01-12-2004, 02:25 PM
For more information on writing raytracers or other renderers or anything else to do with graphic programming, check out
Flipcode (http://www.flipcode.com)

It's a pretty cool site.

stew
01-21-2004, 05:45 PM
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?

Oogst
01-26-2004, 12:48 PM
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:

http://home.hccnet.nl/w.vdongen/Raytracer/RaytracerRender033_fixed-smooth-shading.png

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.

Banty
01-29-2004, 02:08 PM
Hi, this is my first post :)
I'm programming a raytracer with GI, the features are:
1) Intersect: triangles (accelerated by an octree), spheres, cylinders, cones, planes, boxes.
2) Shader: BlingPhong, CookTorrance, Lambert.
3) Light: Point Light, Directional Light, Spot Light, Hemisphere Light, Linear Light, Area Light.
3) GI: Pathtracing, Photon Mapping with Final Gathering, Occlusion Ambient, HDRI Lighting (to improve).
4) Material: Texture Mapping, Bump Mapping.

And here a screenshot of the cornellbox:
http://www.geocities.com/frabante/sfondo.jpg

Oogst
01-29-2004, 05:33 PM
Banty, I see no pic, just a cross. Terrible lot of features in your raytracer, you did that all by yourself?

Hugh
01-29-2004, 05:37 PM
Originally posted by Banty
BlingPhong

Is that a particularly shiny type of Phong shading? ;)

This page (http://www.geocities.com/frabante/) is the page with the details on. It's all in Italian, but there are some pretty pictures on there...

There is also some interesting stuff on this page (http://www.geocities.com/frabante/ray_mc/ray_mc.html) about the theory behind it all...

Banty
01-29-2004, 05:37 PM
Mmm, from my browser I can see the pic, maybe it's a problem of geocities, which is not the best hoster.
Yes I do all by myself, but it's very slow because I've no time to optimize code.

Banty
01-29-2004, 05:38 PM
Mmm, from my browser I can see the pic, maybe it's a problem of geocities, which is not the best hoster. For the pic try:
http://www.geocities.com/frabante/sfondo.jpg
Yes I do all by myself, but it's very slow because I've no time to optimize code.

Banty
01-29-2004, 05:40 PM
Is that a particularly shiny type of Phong shading?
BlinnPhong removes artifacts of Phong, using low coefficient of shiness, also BlinnPhong calculates specular coefficient in this way: specular=(N.H) where N is the normal and H is the half vector (View Vector+Reflect Light Vector).

Hugh
01-29-2004, 05:50 PM
Originally posted by Banty
Is that a particularly shiny type of Phong shading?
BlinnPhong removes artifacts of Phong

I was just joking - I was picking on the fact that it says "BlingPhong" in your first post instead of "BlinnPhong"

Banty
01-29-2004, 06:03 PM
I was just joking - I was picking on the fact that it says "BlingPhong" in your first post instead of "BlinnPhong"
D'oh!
I didn't see the 'G' in Bling. :)
Hugh do you see the pic that I've posted?

CGTalk Moderation
01-16-2006, 05:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.