PDA

View Full Version : Want to code a renderer



Mr. Tinker
04-20-2006, 04:22 AM
Can anyone give me advice on how to get started on a long term coding project? My goal is to code my own renderer, mainly using some form of raytracing, but I envision a few custom things that haven't been done in 3d rendering.

My only coding experience has been with some ASP in VB, but I understand the concepts of OO programming very well. I believe that most renderers are coded in C+ or something like that. Could anyone point me to a good programming book or two?

I did find this book (http://www.amazon.com/gp/product/1558605797/ref=wl_it_dp/104-6410312-0748755?%5Fencoding=UTF8&colid=3RX4MQ1M00D5Z&coliid=I39I9SR25W9WH0&v=glance&n=283155) which should run over some concepts of render programming:

Mr. Tinker
04-21-2006, 05:26 AM
Bump

So what language are renderers usually programmed in, and what's a good reference for that language?

uOpt
04-21-2006, 06:39 AM
For highest performance you absolutely need C++ or another language that can compile to machine code with low amounts of extra pointers, no runtime type checking and access to rare data file handling functions like mmap.

Don't believe any of the rubbish about Java performance, likewise for C#. There are a few more language which do the above such as C, Common Lisp, Modula-3 and Fortran but they are rarer choices.

C++ is a very baroque, I mean complex, language, you will find that you pull your hair out if you don't do it a minimum of 10-20 hours a week.

I find that the choice of books is very dependent on the personality of the reader, some people just get better along with some authors. Myself I find books written by Bjarne Stroustrup by far the best. Others say he is incomprehensible and focuses on useless details and loses the big picture.

Whatever book you choose as the main learning book, be sure to get a side order of "C++ tips" books, such as Marshall's C++ FAQs, Murray's "Effective C++" or similar.

Lastly, ignore Object Oriented programming zealots. Yes you can use it and it is nice but C++ does many other styles and religious following of OO paradigms leads to bad C++ code.

Oh and get a good, standard-conform, compiler and turn on all warnings.

Mr. Tinker
04-21-2006, 07:28 AM
Thanks again, uOpt.:toast:

uOpt
04-21-2006, 10:26 AM
Sure thing :)

I'm not sure that animation book will be too useful for a raytracing project, but I don't know much about 3D.

Most important thing is to make sure it's fun and not going over your frustration threshold, so that you keep going slow and steady instead of once a month. Kinda like a diet, and C++ is exactly as painful http://www.cons.org/smileys/nuts.gif.

Mr. Tinker
04-22-2006, 09:30 AM
I imagine I'll need a Trig, Calculus and linear algebra primer too.

I once read a sort of "path" meant as a guide for those interested in programming games. It suggested an order for games to program, starting with like, tetris, then mrs. pac-man, then mario bros, etc. on up. I wonder what a good path here would be. Well, maybe I'm asking the question in the wrong place.

It just seems like such a cool throwback to when animation studios created all their own proprietary software. I think animators really appreciated hard work back then and you had to be really dedicated and passionate about CG. I see that attitude waning these days. Now, artists want CG to be like programming a VCR.

uOpt
04-24-2006, 05:58 PM
I am not a game or even graphics programmer so take my advice with salt.

When picking what you do and learn first, there is only one all overriding factor: you need to have fun. To ever do satisfying work in that industry all that counts is your enthusiasm. You need the enthusiasm to overcome challenges. With pure college style learning you cannot compete.

I think the advice to start with 2D toy games is bogus. I don't see what you learn there, except you might have to do that to come up with a 3D engine all of your own - and that won't happen anyway.

What I would do if I was interested in game programming is take one of the OpenSource 3D engines and start using it, and start reading the sourcecode. All of them run on Windoze, Unix, Mac. Examples are CrystalSpace, Irrlight, the Quake engine and probably half a dozen I don't know about.

Mr. Tinker
04-25-2006, 03:54 AM
Well, I don't want to program a game. I gave that example to see if there is a similar track for those wanting to program a software based raytrace renderer, which is what I want to do.