Archive for the ‘Programming’ Category

Motion Blur

Monday, August 27th, 2007

I’ve finally got around to uploading the fixed motion blur in the GLSL demo, which can be found here. I’d fixed it a few days after my last post, but I’ve been neglecting this site a little bit lately. Today I modified it so that there is more blur on the outer edges of the screen, and less in the centre. This was to avoid what I like to call “Bourne Film Sickness”.

The reason that I’ve not posted in a while is that I’ve actually left University and got myself a job at a rather amazing games R&D company based in Cambridge. It’s brilliant, and I’m so glad that I did it. I was running out of money, fast, and this job opportunity was too amazing to be missed.

I’m still doing my Masters in my spare time, though. Rather than doing something graphical for my final thesis, I’ve decided to write a small scripting language. I’ve always wanted to write one, and I spend 8 hours a day doing graphics at work, so I figured that I might overdose. )

As I say, do check out the improved motion blur.

Edit: Gosh! My work has been referenced on the Blender Artists forums last month! Thanks guys! )

Edit, again: Some shots of the blur. I’ve just realised that it’s not framerate independent, so on slow cards you’ll get loads of blur, but on a GeForce 8800 you’ll get a nicer blur (because that’s what I’ve tweaked it to). Sorry about that.



Some excessive blurring to show it off. High forward velocity.


A gentle sideways movement.

The Cave Troll; Photorealism on the GPU; “Cali”

Friday, May 4th, 2007

I haven’t posted in a while, so my current work is shrouded in mystery.

First off, a quick update on last term: I’ve produced a procedural city/garden generator in Houdini, but I don’t have screenshots here. I will post some up the next time I’m at Uni. Also, there was the infamous GLSL demo, which I’m moderately pleased with and has inspired me with regards to my major project this year. More on that in a moment. If you have a GeForce 6800 or above, please do check that out! It’s quite basic compared to a lot of stuff out there right now, but I’m still pleased with it as I managed to cobble it together in five or six weeks.

Last term also saw the end of the Cave Troll. Now, while I’m pleased with a lot of the features that were incorporated into the project, it seems that fate conspired against us to ensure that everything that could go wrong went wrong. However, I was responsible for the lighting and Maya to RenderMan pipeline, and both of those things worked out a treat. You can see a copy of the presentation slides for details on how the median cut algorithm works, and also details on the RIB exporter. There is a dodgy video showing how the ambient light maps onto a sphere. I may write a new page on these tools soon.

The reason I’m so annoyed with the project is that the mocap data that we were so proud of was completely unusable. Malcolm, our only animator, used XSI to hand-animate the troll using the mocap video as a reference, but then we couldn’t get our animation from XSI to Maya. Given the remaining time, Malc had to learn Maya in two weeks and animate from scratch. He deserves a medal for that, to be honest.

The muscle system was developed by Johannes, but unfortunately he was stuck in Germany when it came to actually applying the muscles to the troll. I had to botch the job in the last week and wasn’t able to tweak it, so if you want a laugh watch the belly of the troll very carefully as he runs…

The main topic I wanted to cover in this entry is photorealistic rendering using a graphics card. As John Carmack said in his 2004 Quakecon speech, it won’t be long until we start seeing low budget visual effects studios switching to a more affordable and faster method for rendering C.G. scenes. With games companies producing stuff like Gears of War, that day is getting closer and closer. This is currently what I’m looking to investigate, and I’m planning to write a RenderMan compliant GPU-based renderer (codenamed “Calistos”, or just “Cali”) over the coming months.

However, there are a number of things that clearly make offline rendering superior to rendering on a GPU, and these need to be resolved somehow in order to produce better results. The first thing that I notice every time I look at games is the terrible, terrible aliasing. Frankly the antialiasing on current hardware is dire, and that really need to be improved. Even at 8x, it still looks pretty bad. I’m looking forward to the day when hardware has in-built 16x anti-aliasing at decent rates.

Another thing I don’t like is the texture filtering. It can be fine in a lot of cases, and mipmapping certainly helps to reduce aliasing on distant textures. However, the closer you get the more a texture looks bad, and the only way to solve this is to use a very high resolution texture. In an offline renderer you can have a texture any size you like, but on a GPU you’re limited to 128MB or less in most cases. For the cave troll, we had a 32-bit floating point displacement map that was 4096 pixels square and took up 100MB of disk space. That’s certainly not going to be viable on a GPU in any circumstances.

There are some things that the GPU does as well as offline rendering or better. For example its a hell of a lot faster to rasterise than to raytrace or even use a REYES algorithm. Fragment shaders are pretty damn good at doing most of the post-process effects that are used in offline rendering, and doing them better in a lot of cases. There are still times when precision becomes a problem, but unclamped floating point pixelbuffers make this a non-issue most of the time. Finally, with the advent of GLSL, Shader Model 3 and OpenGL 2.0, things are becoming a lot more flexible. I don’t know what the instruction limit is for shaders these days, and I make a point of not looking. However, I’ve written some pretty nasty shaders over the last few weeks and the card has just done its job with no complaints.

I shall report back in a few weeks with news on Cali’s development, and hopefully some screenshots.

Work Update; Final Project Idea #34807

Thursday, December 14th, 2006

Since I last posted I have been busy with my work at Bournemouth University. Until recently I didn’t have any set work to do, so I persued studies of my own and also some with my new colleagues João Montenegro and Johannes Saam. (On a side note, there are some photos further down the page.)

So far I have made a mostly-complete Maya to RenderMan converter which produces some cool output straight from Maya to RIB. Also João, Johannes and I have had many discussions on things like fast fluid systems and fast sub-surface scattering, though once I had my exporter to write I tended to only chip in my two-pence now and again. After we went over the theories they generally went off and actually did while I beavered away at the aforementioned exporter.

Some of the stuff that myself, João and Johannes have been working on:


There’s more stuff from João and Johannes.

These are some shots of the exporter’s capabilities:


Early days yet…

I know a Maya to RIB exporter doesn’t sound like much fun, but I can say that I know an awful lot more about RenderMan and Maya than I would have done if I hadn’t done it. I also know how much of a pain in the arse heirarchical subdivision meshes are. Ha.

I’ve also done a bit of Maya. I’m not great at it, and my first (and currently last) still work looks like this, but for a first attempt I don’t think it’s too bad. I’ve gone a bit nuts with the depth-of-field on it though. In addition, I’ve also had to create a very small animation. It’s not great, but please go easy on me: I’ve never done this before! )


Finally, I think I may have thought of a decent Master’s project. I was thinking about a graphical front-end to RenderMan, including an OpenGL pre-vis, shader editing, importing from both Maya and XSI, etc. OK, this isn’t groundbreaking stuff, but it does help me get a job in the following ways:

  • It demonstrates that I know RenderMan,
  • It shows that I know Maya and XSI,
  • It shows that I can make tools.

The ground-breaking rendering stuff I hope to do as part of my group project in any case. Or maybe just in my spare time. Who knows. I’m still not 100% set on the idea, but I am definitely more enthused about it than I am about any of my other ideas. Just… so much OpenGL… ugh…


Johannes (fore) and João (back).


Me (left) and João (right).


Gerard.


From left to right: Matt Osbond (right at the back), Ben, Gerard, Myself, João.


From left to right: Mya, Anil, Jed, unknown (back), Hasan (fore), unknown, Matt Osbond (back), Ben (fore).


Gollum guards our projector.

WiiAction

Wednesday, December 13th, 2006

I wanted to mention that a friend of mine, Daniel Wright, has written an API for using a Wii Remote - or Wiimote, or whatever - on the PC using a Bluetooth dongle. He has named it WiiAction, but I don’t know if there’s a website for it yet. I will hassle him for one. This library is, frankly, totally awesome. Here he is on video to tell us all about it:

Path Tracing; IBL

Friday, October 13th, 2006

After seeing a colleagues path tracer I decided last night to have a crack at it myself. Unfortunately I’ve (deliberately*) lost my copy of Max, so I couldn’t set up any decent shots with all the effects that I would like. Expect images of effects such as caustics later, but in the meantime here’s path tracing with IBL:

Click to view larger version
Click for larger version (720×576)

The JPEG compression has mucked about with that image a bit, annoyingly. More coming as soon as I find my copy of Max and also when stuff finishes rendering. Path tracing is soooooo sloooooooow.

* I hate Max. I never expected to ever need to use it again.

Reports Added; First Three Days at Bournemouth

Wednesday, October 11th, 2006

It’s been a very interesting week so far. I have spent the last three days pretty much living in the computer labs. It’s so great to be able to talk to people who are interested in the same areas that I am. I’ve got to know a few of my classmates, and it’s good fun to have lengthy discussions about how crap photon mapping is, and how awesome Film A was compared to Film B. The course is all very relaxed, and still retains a professional and encouraging atmosphere. Hooray for Bournemouth! The first week of term is currently a big success D

I have put up the reports for the Tong Ray-tracer and my final dissertation. It appears that more people look at this site than I thought, so I thought I’d put something up to keep people entertained… if you’re into that kind of thing.

Oh, and I’m really hating Visual Studio right now. It never does what I want, and what I want is generally very simple and I can’t see why there would be a problem. Currently it’s decided that it can’t find a library that I moved months ago (and have therefore updated the project settings to point to the new location), but it complains it can’t find the old one. I’ve searched the .vcproj and .sln for a mention of it and it’s not there. Microsoft: your IDE is definitely the best one ever made, but I’ll stick to gedit and a terminal thanks. They do what I say.

Eventually, anyway.

First Class

Saturday, July 22nd, 2006

I got my results yesterday! I’m very, very happy. I got a First class with Honours, but also I got one hundred percent in my raytracing module. Holy. Crap. I’ll have to update my C.V. and also write my personal statement for Bournemouth today.

The toolbox has grown a bit. It’s now able to do HTTP content serving: screenshots and videos are here. The video’s quite big so I apologise for that.

Fear my elite After Effects “mad-skills”.

Connections (Including Trains)

Tuesday, July 11th, 2006

I really ought to start naming my posts sensibly.

Anyway, I had a mooch around Bournemouth last Thursday. It was really, really good, and the beach was awesome. One problem is that the campus is quite far away, and the on-campus accomodation (”Student Village”!) would make me feel a little isolated. Lose/Lose on that one. But oh well! I could cycle to Uni…

I’ve just sent three reference forms to lecturers and I’m still stuck on my personal statement, but I’ll get round to formally applying later next week after I get my results*. I also met a guy called Gerard, a tall Irish chap who currently works at a visual effects studio already (though I probably shouldn’t say which one) but is still going to do Masters there anyway. Also, I met Ian Stephenson who wrote this book. He seems like a decent guy and it will be interesting to be taught by him next year (assuming I get the place). Teesside is still obviously a prime candidate for my application, but at the moment I’m still on a high from Bournemouth’s lovely scenery and friendly image, which Teesside certainly lacks.

I really hope this Masters thing pulls through. I’ve already declined a few interviews and even jobs at some games companies because of this. I think I must be insane. I’m also afraid that I’m burning social bridges, which I certainly don’t want to do. After all, I will need a job after this course!

* Results are due on the 19th! That’s Wednesday next week… Eek…

Anyway, enough of that. On to some actual programming:

So far my toolbox is coming along nicely. I have some interesting stuff going. All this is is a collection of disjointed utilities that I use in nearly every project. Currently this includes:

  • Debugging stuff (Overloaded assert(), logging, etc.)
  • Maths (Vectors, matrices, bounding volumes, oct-trees, rays, etc.)
  • Meta-format (This basically allows me to write data about data, or data about anything for that matter. Streams to and from binary or text quite happily. Probably the most awesome part of the toolbox.)
  • Directory functions (Such as recursion, creation and deletion.)
  • CRC generation (of anything.)
  • File streaming (binary and text from GZ compressed files, Zipfiles and normal files.)
  • SO loading (.dll for Windows, .so for Linux and .dylib for MacOS. This this also awesome.)
  • Text stream parsing, tokenising and lexing system. (Funky stuff. Makes complex text file reading a doddle.)
  • Model format stuff. (Meshes, vertex buffers, index buffers, face formats, etc.)

It runs on Windows, Linux and Mac so far. Also, I have a virtual file system which transparently reads from disk or zip entries. Also it automatically adjusts for 64-bit paths (I have a system32 and system64 directory for different binaries. This system adjusts the /system/ to the relevant path.)

Getting there. Can anyone suggest any other features they find they use a lot in their projects?

Backwards

Thursday, March 16th, 2006

I have now completed the practical element of my project. It demonstrates diffuse inter-reflections to simulate real-time global illumination. It works, but has a few problems - some expected, some not. The last shot, by the way, is comparative to a very low resolution photon map. Awesome.

One thing that is totally screwing me over is that my model converter is a pile of crap when it comes to normals. I will post a screenshot later of why. Also, the framerate on the cornell scene is absolutely dire, but given the quality it’s understandable. I mean, it’s global illumination on a GeForce 6600.

The new server is running well, but because it’s configured slightly differently I’m running into interesting problems. For example, I can no longer browse file listings which is bad because nobody can see my work unless I post a link to it (

I’m working on getting it fixed soon.

Collaborative

Monday, November 14th, 2005

Life’s becoming rather busy lately. A typical week is busy enough, yet I strangely manage to find time to do the things I like to do. This week is pretty busy as well, as I have a few additions to the schedule. I should say “replacements” actually, because I am fully booked every week-day, so I’ve had to move a few things. This week will be rather interesting, the reasons for which are listed below.

Today I have a meeting with my final year project supervisor (in which I have to convince him that the new project idea is the best idea since someone thought, “hey, I could sell this bread sliced!”). I have to go to work where I have to spend a few hours actually getting something to compile, which is driving me crazy. Also, the director is leaving for Australia today and won’t be back until after the deadline, so that’s pretty screwed up. Finally, I’ve got to get this iMac fixed.

Tomorrow I’ve got 4 hours of University to do, a meeting with the GSS and then I have to tidy the house. Oh, and write a report for my FYP. I wanted to go to Poker Night, which is being hosted by Alistair Parr, but I had to decline. The tidying is in preparation for Wednesday, in which my dad arrives for lunch. After he’s gone, I’m going to a North East Games Industry Think & Drink session to meet some of the developers in the North East, which I have no doubt will include Onisoft whom I’ve always wanted to meet. Unfortunately, it totally overruns the GSS department leads meeting and being “Technical Director”*, it’s pretty important that I be there, but my place is being filled by lead programmer Ashely Canning and a fellow 3rd year of mine, Richard Bangs.

Finally, on Thursday, there’s a games industry conference which I’m going to be attending. I know little about this at the moment other than the fact that it’s on and that I said that I’d go.

The rest of the week is reasonably calm. I have loads of work to do, of course, but that’s nothing new. But anyway, enough of my plans for the week…

Tong is progressing … well … not as fast as I’d like. Some people reading this probably had aspirations as to my homicide while reading that probably, but hear me out. The latest shots reveal some interesting artefacts. How to get rid of these white dots is eluding me right now. All I know is that somehow the pixels at those locations think they’re being lit by the bright white spotlight that’s behind the window. Obviously they should not only be facing away from this light, but also they are occluded by other geometry. Most confuzzling.

In regards to the (much more important) final year project, I have put many hours of thought into it. I have decided to drop the scripting language: it just wasn’t fun or interesting. Actually, that’s not true: It is fun and interesting and I still want to implement one at some point, but considering I’m doing nothing but raytracing so far it seemed more sensible to do something more relevant. When I go to see my supervisor in 25 minutes a decision will be made as to which one I’m going to be doing.

  • View Peter J. B. Lewis's profile on LinkedIn
  • Journal Categories

  • Meta