Saturday, September 13, 2008

Environment Mapping


I've added new environment mapping code which is both faster and provides more accurate results than the old code.

All of the available rendering styles are available in this demo, which allows you to choose a) model, b) texture, and c) render mode.

Tuesday, September 9, 2008

Small steps

The bad news: I don't have too much to show for my last few days of work. The good news: I've been spending my time cleaning up all of my current code to get it ready for an alpha release.

I'm finding that's it's a great learning experience to go back over all of my code and look at it from an 'outside perspective'. It's forced me to clean up a lot of ugly code, prune everything down to only what is truly needed, and document things in much more detail than I normally would.

I've also spent a bit of time adding content to my Google Code page (link on the right ->) and I plan to continue to add more over the next few weeks.

Saturday, September 6, 2008

3DS importer


After working around a few server issues I've finished writing the 3ds file importer. It's currently able to load in mesh data and texture mapping information. I'd like to eventually update the importer to also deal with things like smoothing groups and materials.

I have a simple example available of the loader in action here. The model is just a sample 3ds file that I found at this site.

I have also created a Google Code page for this project. There isn't much content on it yet, but it will be added to over time. I'm planning on posting an alpha release of the code in the near future.

Thursday, September 4, 2008

Back in business

It's been far too long since I've made any progress on this project, due to lots of things happening in 'real life'. The good news is that I sat down last night and pounded out a .3ds file importer. There are still a few bugs to iron out, but I should have a working demo up in a day or two.

This site was extremely helpful in figuring out how the files are laid out.

Sunday, April 27, 2008

Phong Shading

Silverback3D now officially has Phong shading (example here). The code actually isn't very different than the Gouraud shading code, since it is still interpolating values over the surface of polygons.

I might write up a more detailed post on this later, but for those of you who don't know: while Gouruad shading interpolates color across a polygon, Phong shading interpolates normals across a polygon and then calculates the color of each pixel individually. While this takes more processing power, it allows for much more advanced rendering. As you can see above, the Phong shading (right side) creates much more defined and realistic specular reflections than the Gouraud (left).

In addition to creating better looking specular highlights, Phong shading can be used for much more diverse things, like this simple toon shader that I threw together.

If you're interested in learning more, Wikipedia has a page on Phong shading with some good information.

Saturday, April 26, 2008

Texture Mapping


I've actually had texture mapping working for a while now, but a few weeks ago I decided to go back and re-work all of my base rendering code before working on any more advanced functionality.

This is the current state of the renderer. I was able to add another 1-2 FPS by streamlining my drawing loop counters.

And now the reason for this post: texture mapping. I think it's looking pretty good so far, but there's still some features I'd like to add. Performance doesn't seem to be doing too badly, but I'd like to tweak it to get an extra few FPS if at all possible.

Friday, April 25, 2008

Firefox vs. Internet Explorer


I did some unofficial tests today and it looks like there's a significant performance difference between the two browsers. I get an average of about 25 FPS in Firefox, while Internet Explorer manges to squeeze out about 38 FPS.

In the past I had always advised people to stay away from Internet Explorer in favor of Firefox...but this might start changing my mind.

I did a quick search to see if I could find why this difference exists, but couldn't find anything right away. I'll post again if I ever find out more information on this.

I'm also interested to know how Safari plays into all of this.

Thursday, April 24, 2008

Specular Reflections - Part II

It didn't take me nearly as long as I thought it would to get everything sorted out.

Specular reflections seem to be working just fine now, check them out in the latest demo.

On a different note, I'm realizing that this blog will quickly get dull if it's all text. I'm going to start putting more effort into using more pictures. Starting tomorrow.

Specular Reflections - Part I

One of the last features I wanted to implement for my Gouruad-shaded renderer was specular reflections. I spent a bit of time working on this last night and ran into a few problems, mainly with some things that I had set up in the past that should have been set up better. I'm hoping to get these sorted out tonight after work, and then finish up this functionality.

You can see the current progress here, this example has ONLY specular reflections, there is no diffuse lighting present.

If you're a graphics geek like me, this is a good example to see the true nature of specular reflections with Gouraud shading. Although all of the computations are technically "correct", the way that the polygons are drawn combined with the lack of geometry makes it look less like a shiny surface and more like flashes across the model's surface.

Some more information on Gouraud shading, as well as another visual example of specular highlights, can be see on the Wikipedia page.

And for those of you who want something more...stay tuned for Phong shading :)

Tuesday, April 22, 2008

Performance updates

I haven't had much time lately to start working on any new features, but I've been slowly working on optimizing the main rendering code for performance.

I've done all of my testing so far with the classic 'Silverback' model, which weighs in at around 1500 polygons. I would assume most practical applications of this engine won't be using models of this complexity, but I'd rather push the limits from the beginning instead of running into problems later on.

My goal is to eventually be getting around 30 FPS on any computer for basic Gouraud shading. You can test out Silverback3D's current performance here.

What frame rates are you getting? (I apologize for how hard it is to read the FPS, I'll fix that soon...)

EDIT: I've updated and replaced the above example. Frame rate should be much easier to read now.

Monday, April 21, 2008

Welcome

...to my new blog!

I'll kick things off with the announcement of an official name for this project: Silverback3D. I figured that this had finally evolved into an actual, cohesive project out of the various experiments that it began with. I'm very happy not only with the progress that I've made so far, but also with the things that I have learned about 3D graphics along the way.

Please keep checking back, and I will do my best to keep this blog updated with news, examples, and eventually code for the public to use.