Razor Code
Rambling about code since quite recently

Topics

User Functions





    Don't have an account yet? Sign up as a New User
    Lost your password?

Events

There are no upcoming events

Older Stories

Sunday 14-Sep

  • ACM ICPC 2008 (0)

  • Monday 11-Aug

  • NZ Programming Comp (0)

  • Sunday 27-Jul

  • Blast from the past (0)

  • Monday 21-Jul

  • Timetable generator again (0)

  • Tuesday 08-Jul

  • Hosting (2)

  • Saturday 05-Apr

  • Sparse Volume (0)

  • Friday 28-Mar

  • Carmack (0)

  • Tuesday 04-Mar

  • Back to Uni (0)
  • Dell Kill Switch Direct (0)

  • Monday 18-Feb

  • Lappy (0)

  •  VolRend    
     Author: 
     Dated:  Tuesday, November 13 2007 @ 12:46 AM NZDT
     Viewed:  1,056 times  
    Programming

    ---This message removed because I have a job now.---

    But this post is about the voxel renderer I've been writing in-between looking for a job. It's the same basic algorithm as the one I wrote, um, probably a couple of years back now. In case you don't go back that far, that means it's fully 3d with 6 degrees of freedom and interpolation, at the cost of being extremely memory hungry. These days, however, I know when to apply a bit of maths and get something that's pretty close to correct (as opposed to twiddling numbers until it looks alright). I also got it performing a bit better and figured out how to calculate normals. It's only about 350 lines of code, excluding the bits of Rendjin I used (it's so handy).

    The picture is of accurate mode at 512x512 res, rendering a 256^3 voxel grid (though oddly enough that doesn't seem to make that much difference) containing 256 spheres. The colour is the normal vector. 5.5fps on a 2.8ghz pentium D, entirely in software.

    I like the way the spheres sort of merge together, it's quite interesting. Normally the interpolation gives you flat surfaces, so you could be forgiven for thinking they were standard polygons. But when the spheres intersect things are a bit less predictable, and the interpolation actually gives you curved surfaces. The edges (if you will) of a voxel will always be straight lines, but given 4 straight lines (for example) it's not always possible to construct a flat surface, so you get a curved one. Hard to explain, but it's pretty cool.




    Trackback

    Trackback URL for this entry: http://razorcode.net/trackback.php/VolRend

    No trackback comments for this entry.
    VolRend | 2 comments | Create New Account
    The following comments are owned by whomever posted them. This site is not responsible for what they say.
    VolRend
    Authored by: Anonymous on Thursday, November 15 2007 @ 01:09 PM NZDT
    Yeah... we read your posts. Have you programmed C++ under Linux?
    VolRend
    Authored by: Razor on Thursday, November 15 2007 @ 03:08 PM NZDT
    C++ is my language of choice, but I'm afraid I haven't seriously used any flavour of Linux. I'd be happy to learn if that's practical.