Category Archives: project

Another long time…

Well this time it’s been more than a year since the last time I updated this site. I never did post the creative writing project I was working on, although I did get it working nicely, I just hit a bit of writers block. I tested the features of it that I wanted with random phrases and words, but wasn’t able to write enough content to justify posting anything.

Meanwhile, my ray tracer project has all features I initially planned. That is, it has all the code that the books website had plus anything that that code excluded as an exercise. The current master branch on github has all the features that the book discusses. The project’s Wiki has a page of thumbnail images it has rendered of all the build functions from the books website.

Giant version of Figure 24.6 from the book

Figure 24.6 from the book, rendered large, the phong highlights were the reason I decided to see what an area light version would look like

Raytraced Image with reflective materials and area lights

Area Light Version of the large 24.6 image

Note: This image should be linked directly to the github version of it, so it should be updated as I change things, Unfortunately the 6000×4000 size does not work well with wordpress, or most people’s screen size. To view the full images, because of the way github handles binary files, your browser will probably ask you to open or save the file, instead of simply displaying it. This is due to the way github handles the files, and I apologize for the inconvenience.  I will be updating these images soon, as they need to be rendered with more samples.  Also I hope to render a globally shaded version as well, but that may not happen soon.

I plan on adding several of the features the book describes in its exercises, as well as several features of my own.

I’m thinking I may post some of what I learned in doing this project here. To facilitate this I am planning to add some other features. I plan on using the project itself to render any figures that I need to help me describe what is happening.

To make that easier, I need a primitive for visualizing a vector, and some way to render text. The vector visualization should be easy, but the text is a different matter entirely, I see a few ways of doing it, but I don’t know which way I should do.

My two options are rendering the text on a texture and drawing a quad with that texture, or actually rendering text as 3D characters in 3D space, the first option is the easiest, the second is probably better in the long run, and I may do both. For now, I need to implement something to get working for my next post here.

Tiled map generation now working

Working on my RTS game, and I now have a working tile based map.  It has working random generation, and a working A* pathfinder. Also has a working minimap.

The previous images show the minimap and map view zoomed at two different sizes.

The following image shows the visualization of the A* algorithm in action. for debug purposes each iteration of the algorithm is slowed down and the open set and closed set visualized as red and cyan tiles. The current node is depicted as the white tile.  The red tile not attached to the blob is the goal node. The start node was the highest point inside the gray rock formation.

 The following is the final path from the above visualized run.

 The following is several paths generated on the same map.  The two in the middle around the center rock position are so different because the path-finder was set to require 3 tile clearance for the top path, and therefore could not go through the gap the other path did. 

Fluid-Based game progress

Well, I’ve been working on the idea of a Minecraft-like game (infinite procedurally generated world, with resource gathering and building) but instead of semi-fixed Voxel-based, I want to use fixed-size particles in full Smoothed Particle Hydrodynamics simulation, including heat transmission.  The idea is to create a world where you can shatter a chunk of the rock off with a tool to pick up, or create a heat source large enough to melt the rock, and gather the liquid.

This is obviously a very difficult proposition for many reasons, but mostly speed, as well as the problem of getting a good simulation of melting/freezing, the papers I’ve found that mention it don’t go into detail enough to implement. I’ve toyed with three versions of a simulator so far, but none of them are fast enough to do a full world with. And only one would support what I want to do right now, the slowest.

These are two screenshots of the original full simulation:

These shows two fluids, the pinker is denser and also more viscus and elastic. This simulation works nicely but is quite slow <250 particles runs at 4FPS as shown. It uses springs for the boundary conditions. The next two are another version of the same simulation.  It does not use full SPH and simply uses springs to prevent penetration:

This one has the same parameters except the boundary conditions are different, they are still springs, but there seems to be a bug in my implementation where there is a new boundary that keeps forcing the particles down. This however is much faster with nearly 500 particles running at 5FPS, about double the original, but it would require more work and code to get melting/freezing/solids and thus would slow down the code probably to the same as the original.

All those above used LWJGL for rendering.

This last one is done with JME3 to render and it’s built in JBullet library to do the physics, this has many drawbacks, density won’t cause a fluid to float on another, and melting/freezing and solids built of particles become problematic.

Because it uses JME3 the particles->FPS isn’t quite as obvious because it is showing ‘objects’ which is not the same thing.

This is one of the slowest projects I’m working on, because I keep putting it on the back-burner for other things that are more likely to be possible.  I’m thinking I should do it in C++ for speed, but I really prefer java.  I’ll probably keep working with the original, or second one, just to get a tech demo, albeit slow, that works.

Some noise tests

Not quite halfway done with that paper I mentioned earlier but decided a distraction was in order.

This is a project I’ve been toying with on and of for a long time.  I started toying with Perlin Noise because I hope to create a fully procedural game.  The noise would be useful for textures mainly but also landscapes and other various things.  So I made this program to play with how the noise behaves with different inputs. While doing so I found out  Simplex Noise is less expensive to compute so that is what this currently uses.

Feel free to play around with it, ask questions, I don’t care if you use it to make textures for yourself but I’d like recognition if you do. I’m going to open this to public comments so questions and comments can be asked and posted.

The in program help should be useful, but it doesn’t cover the gradient editor (far right in first screenshot). This is mainly because I got tired of writing help. If I get enough requests I’ll fix it.

My planned next evolution is to figure out how to make it generate tile-able noise as well as continuous noise.

This is a screenshot of all the pieces
This is a screenshot that has a more useful image, picture it as a height map of an environment where the blue would be water and white is top of mountains

These are other images produced by the program

This could be a heat map of some kind, or a region map possibly red being desert green could be forest, blue water, and yellow deserted islands
This is another like the above, but shows a more complicated landscape

You can download the stand alone .jar file here: NoiseTest.jar

Perhaps in a few days I’ll post some details on how this works, but it’s likely to take a while.