Sunday, April 1, 2012

Current Progress

SVN URL: http://subversion.assembla.com/svn/cis565-final-project/
(decided not to use git because rolling back changes is a pain)

I've been playing around with Paulo Falcao's raymarching experiment  and IQ's distance functions. The camera has been tweaked to be closer to the one from Norm's 460 slides. The original framework comes with simple phong shading by calculating a gradient vector on the ray-surface contact point and plugging it into the phong algorithm with the camera as the light. It looks good with one cube, but with an infinite field of cubes some odd artifacts come up:


I implemented a different method based on the number of steps taken by the ray. This produces slightly crisper results (and fake AO) but results in a halo around objects if the max number of steps is too low. Again, the light source is coming from the camera (since it's the original of all the rays). I hope to be able to set a light source in the future but the focus right now is geometry creation.


I've been trying to figure out how to create a box with a random height. Since glsl doesn't seem to have a rand() function, I've been looking at noise functions. Some of them result in interesting shapes, such as the fuzzy box. 



The next item to consider is how to create multiple boxes/rudimentary buildings with random heights. I had initially wanted to use IQ's repetition function (seen above), but I'm not sure if it is limited to only one exact shape (I think it boils down to whether the random float value will returns different values each time the primitive is rendered). This is what I will be working on the coming week. 

1 comment:

  1. I'm pretty sure you already found a noise function, but if not, this one is popular in the WebGL world because it is all procedural, i.e., it does not require any textures: https://github.com/ashima/webgl-noise.

    As far as source control is concerned, everyone has to use git for their project. I don't know a single professional developer who uses SVN out of choice. I want everyone using git because it is emerging as the source control of choice.

    ReplyDelete