Archive for September, 2007

God Rays

Friday, September 21st, 2007

More CloudWright : it’s just about ready to be released, though in what form is to be decided. These shots show “god-rays” – light from the sun poking through gaps in the clouds. I’ve implemented save/load and you can also export to a cubemap view ATI’s cubemap tool. The clouds shown render at interactive rates on two year-old

hardware which helps a lot with adjusting for the perfect look – you just can’t do this kind of interactivity if you have to wait two minutes for a render.

 

CW10.jpgCW20.jpg CW12.jpg CW13.jpg CW21.jpg


CloudWright

Wednesday, September 19th, 2007

I’ve long had an interest in rendering realistic clouds for games. The usual approach – taking photos of the sky and stitching them together into a dome or cubemap – produces convincing skies but has a number of disadvantages. If you want to use high dynamic range, you either need to take a full HDR picture of your sky, or to fake it convincingly. It’s static, lacking the infinite variety of real skies.

CloudWright is a program written with Simul that generates skies. It outputs cubemaps that you can use in-game. It can cover pretty much any kind of “fluffy” cloud with full physics-based lighting – cumulus, stratus, cumulonimbus. The lighting is based on date, latitude and time-of-day information.

Here is some early preview output from CloudWright:

CW2.jpgCW8.jpgCW5.jpgCW4.jpgCW7.jpg

 

The Simul framework helped a lot with this – I could easily build objects with saveable properties, so I didn’t have to worry about file formats – the framework does all the work. In this case, CloudWright just remembers what your data was when you last ran it. Later on I’ll put in a save/load setup and more bells and whistles.


DLL’s, entry points and global variables in C++

Tuesday, September 18th, 2007

I recently converted one of my libraries from a statically-linked lib to a DLL. But I found some problems – global variables declared in the DLL were not being initialized – and they ended up with null virtual-function pointers. The reason – I had checked “no entry point”. This seemed sensible as the DLL is a resource, and doesn’t do anything explicit on loading.

But apparently this means it will just leave your globals (actually static class members in my case) completely uninitialized. Neither Microsoft’s documentation, nor googling enlightened me much after discovering this behaviour.


Reflection in C++

Monday, September 17th, 2007

In building simul I’ve found it necessary to implement reflection in C++. Reflection is where you can dynamically get information about a class, even use its functions and members, at runtime rather than compile time.

(more…)


Starting up

Monday, September 17th, 2007

This is a blog about simul, a framework for software. I guess most blogs are about the author recording his/her thoughts or opinions when he/she feels like it. While I might do this as well, what I mainly want to do here is provide an outlet for simul, so I can explain what it is and get feedback from the software community.