Wednesday, March 23, 2011

Computer Graphics: Raytracing and Programming 3D Renders

I've noticed that a number of top universities are offering courses where students are taught subjects relating to Computer Graphics for their CS majors. Sadly this is something not offered by my university and something I would really like to get into sometime in the next couple of years.

A couple of the projects I've found from some universities are great, although I'm mostly interested in two things:

  • Raytracing:
    • I want to write a Raytracer within the next two years. What do I need to know? I'm not a fantastic programmer yet (Java, C and Prolog are my main languages as of today) but I'm slowly learning every day. Also, my Math background isn't all that great, so any pointers on books to read or advice on writing such a program would be fantastic. I tend to pick these things up pretty quickly so feel free to chuck references at me.
  • Programming 3D Rendered Models
    • I've looked at a couple of projects where students have developed models and used them in games. I've made a couple of 2D games with raster images but have never worked with 3D models. What would I need to learn in regards to programming these models? If it helps I used to be okay with 3D Studio Max and Cinema4D (although every single course seems to use Maya), but haven't touched it in about four years.

Sorry for posting such vague and, let's be honest, stupid questions. It's just something I've wanted to do for a while and something that'd be good as a large project for me to develop in my own time.

Related Questions

From stackoverflow
  • The briefest useful answer I can give is that most of the important algorithms can be found in Real-Time Rendering by Tomas Akenine-Möller, Eric Haines, and Naty Hoffman, and the bibliography at the end has references to the necessary maths. Their website has a recommended reading list as well.

    The most useful math book I've read on the subject is Eric Lengyel's Mathematics for 3D Game Programming and Computer Graphics. The maths you need most are geometry (obviously) and linear algebra (for dealing with all the matrices).

  • The 2000 ICFP Programming Contest asked participants to build a ray tracer in three days. They have a good specification for a simple ray tracer, and you can get code for the winning entries and some other entries as well. There were entries in a large number of different programming languages. This might be a nice way for you to get started.

    EnderMB : That looks fantastic! I'll have great fun going over some of those programs. Thank you!
  • I took such a class last year, and I believe that the class was wonderful for forcing students to learn the math behind the computer graphics - not just the commands for making a computer do what you want.

    My professor has a site located here and it has his lecture notes and problem sets that you can take a look through.

    Our final project was indeed a raytracer, but once you know the mathematics behind it, coding (an inefficient one) is trivial.

  • The book "Computer Graphics: Principles and Practice" (known in the Computer Graphics circles as the "Foley-VanDam") is the basic for most computer graphics courses, and it covers the topic of implementing a ray-tracer in much detail. It is quite dated, but it's still the best, afaik, and the basic principles remain the same.

    I also second the recommendation for Eric Lengyel's Mathematics for 3D Game Programming and Computer Graphics. It's not as thorough, but it's a wonderful review of the math basics you need for 3D programming, it has very useful summaries at the end of each chapter, and it's written in an approachable, not too scary way.

    In addition, you'll probably want some OpenGL or DirectX basics. It's easier to start working with a 3D API, then learn the underlying maths than the opposite (in my opinion), but both options are possible. Just look for OpenGL on SO and you should find a couple of good references as well.

    Crashworks : I didn't care much for Foley-VanDamm; it's dated enough that many of the techniques just aren't relevant any more (it hardly mentions fixed-function shaders) and the style is so terse that it's hard to take the math into code.
    Kena : I agree, it's pretty terse. But compared to most "Weee, Computer Graphics is fun fun fun, look what I can do with those nice pixels" textbooks, it gives solid mathematical foundations. But then I'm a math geek.
  • For a mathematical introduction into these topics, see

    http://graphics.idav.ucdavis.edu/education/GraphicsNotes/homepage.html

  • I can recommend pbrt, it's a book and a physically-based renderer used to teach computer science graduates. The description of the maths used is nice and clear, and since it is written in the 'literate programming' you can see the appropriate code (in C++) too.

0 comments:

Post a Comment