Archive for August, 2006

Crytek claim Crysis is too powerful for consoles

According to Joystiq, the Xbox 360 and PS3 do not offer sufficient power for high quality Crysis action. Now, to my mind that’s just some sloppy engine optimisation. Both consoles are more powerful than an average home PC, so they are in effect saying that their game will only look good on a top end PC with the latest graphic card.

Who is this statement supposed to appeal to anyway? Is it to make PC gamers feel superior to consoles gamers, only for them to realise their PC won’t play it either, unless they shell out another £300 in upgrades?

Technorati Tags: , ,

links for 2006-08-29

Silo 2 WIP Thread

There is a thread on the Silo boards where plenty of folk are showing off their Silo 2 Beta results.

I have to say, this sculpt by Goldo_O is impressive.

Goldo

Technorati Tags: , , ,

Green tangent space normal maps

There was a post on the Polycount messageboards asking about green normal maps - most normal maps you see are blue/purple colour.

“Today my programmer told me that [green] was the correct normal map for direct x and that the blueish one that both photoshop and 3d studio max generate (that happens to be the only kind I ever see anywhere) are incorrect for the purposes of direct x in games. Is my programmer crazy or is it possible that max and photoshop do not produce normal maps ‘correctly’? Are there different kinds of normal maps?”

Many people responded, pointing out that there 3 types or normal maps - World, Object and Tangent. The most common kind for games are Tangent Space normal maps which are characteristically blue/purple. While all these responses were correct, I thought that they had missed the point of the question.

The relevant part of the question as far as I saw it was :

“Today my programmer told me that was the correct normal map for direct x…….Is my programmer crazy?”

No. The coder is correct. The keyword there is DirectX, and it’s all because of compression.

These days there are so many textures in a game that we need to use compression to get them to fit on the disc. DXT (DDS) is a very common compression format (it provides good mipmapping too). However, it were never designed with normal maps in mind and the compression you get with it is nasty, nasty, and thrice nasty to normal maps. A hack/trick is to move the red ‘X’ channel into the alpha channel, since the alpha channel gets compressed separately.

Why move the red channel? The reason red is moved and not green or blue is simple - it’s to do with the amount of data stored in each channel. Blue is the least useful colour in the normal map as the map is mostly blue anyway, so we move either green or red. But DXT compression of the 16bits in the image favours green - it uses 5 bits to store red, 5 bits to store blue and 6 bits to store green.

So, we move the red data into the 8bit alpha channel and it gets a whole 8bits all to itself, leaving the green with 6 bits and blue with 5 bits.

It’s worth noting that you could theoretically store another map in the old red channel - like a simple spec map or a gloss map. Also, since you can use simple maths to calculate the blue from the green and the red, you can drop the blue.

This gives you a good tradeoff with compression and detail, and makes the normal map look green instead of purple.

Technorati Tags: , ,

Setting up a quick portfolio site

It seems that every week there are dozens of new portfolio sites popping up - sometimes they look good, and sometimes they look bad. Storage space is often hard to find, some free hosts make it almost impossible to directly link to your images, and some people are still manually editing and upload HTML.

Why not use the easy route? Blog it. These days image sharing sites and blogging sites are closely linked, so we can use them to store and display all the content.

I’m going to show you how to quickly create a portfolio site that will look good, be simple to update, and display your art easily. It will use default settings for most things, but I’ll point you in the right direction for customisation. I said quickly, and I mean it - with a high speed internet connection you should have everything running in about 15 minutes.

The Blog

Firstly, we need a blog to hold all the content. There are dozens to choose from, but you’ll want one that lets you integrate other sites into it using an API. I’ll use Wordpress for this example, but you could equally use LiveJournal, Blogger, Moveable Type, Typepad or whatever.

So I went to http://www.wordpress.com and signed up for a blog. This took about 30 seconds - they emailed my password to me, and http://rickstirling.wordpress.com/ was up and running. Using Wordpress is a breeze - just click ‘Add new post’ and type away.

So, in 2 minutes I had a site with my own content on it - but it used the default Wordpress template so it looked like every other Wordpress site out there. My rsart.co.uk site is a Wordpress based site, but I used my own hosting and installed their blogging software myself. I really went to work on rsart, editing the stylesheet and layout templates to get something that worked for me, and you can do this on a Wordpress.com hosted account just as easily - but you have to pay for the privilege (about $15). But since this article is all about speed, for now we are simply going to pick a template design.

If you go to the Presentation tab on the Wordpress dashboard you can edit the CSS, or you can simply pick from one of the 40 or so themes that are just sitting there (with nice big preview images). I went for Benevolence - it was the first one on the list that I liked.

The images

Now we need an image host - and we might as well use Flickr as it has excellent ties with Wordpress. I already have a Flickr account, so I’ll not set up a new one, but I assure that it is simplicity itself. When you sign up you get a coded id, like n001828-a, but you can change this to something much easier to remember. I choose rickstirling for mine, and you can view my images at http://www.flickr.com/photos/rickstirling/

Once you account is setup you can upload you images. Flickr has a web based uploader, but you can also upload by email or by using a variety of applications - you can also send photos directly from your camera phone. I have a plugin for iPhoto that lets me upload directly to Flickr. Since I have a lot of images online, I’ll not upload a new one and instead I’ll use an existing image for my blog.

We need to configure Flickr to know where our blog is - fortunately this is easy. By going to http://www.flickr.com/blogs.gne you can add a blog to your Flickr profile. Choose the blog type (in this case it’s Wordpress), Then you fill in the API address - Flickr tells you what it is, in my case it will be http://rickstirling.wordpress.com/xmlrpc.php and then I give my blog login details. Press next and Flickr will try to verify this - 15 seconds later I’m good to go.

The setup is complete for the blog and image hosting.

Blogging the images

Now the final stage - getting an image onto your blog. This is the easiest part - simply upload your images to Flickr, navigate to the image that you want, and click the ‘Blog This’ button. This brings up a text editor, where you can give the image a different title and write a blog post about it. Press Post, and a few seconds later it’s done! Flickr has posted a blog post onto your site with the image.

You can see the images I posted from Flickr on my test Wordpress.com site http://rickstirling.wordpress.com/

Taking it further

This short article was just a quick run through, showing you how to build an image blog in minutes. Of course you’ll want to take this further, so I’ll leave you with some links.

Other Portfolio Thoughts

Technorati Tags: , , , , , , , ,

links for 2006-08-26

Maxscript and mirroring skin weights

I’ve spend the day skinning characters and banging my head against maxscript and the holes in it.

A while ago I wrote a working skin weights mirror script, where I select a vert, copy it, then select a vert to paste to and it correctly mirrors the bones and weights. However, this is a bit slow, so what I thought was I could select a bunch of verts, where the odd numbered selection was the ‘copy from’ vert, and the even numbers are the ‘paste to’. Then I could loop through the list, copying 1 to 2, 3 to 4, etc.

However, even though the listener can show me my selected vert array, I cannot seem to access this information.

Anyway, I’ve come up with a possible solution, which is a work in progress…I’ll explain it after ranting

Basically, what I want cannot be done - maxscript has holes. The solutions posted on the net, and the suggestions from others are the same as the one I have already - select a vert, then cycle through all the verts in the skin modifier to see if I have got them selected.

This method works for some scripts, but its an ugly hack, since in the maxscript listener it tells me what verts I have selected, so MAX KNOWS! It’s there, in text, on the screen. It’s taunting me.

It’s a brute force search, but this won’t work for my script.

The reason the loop won’t work is that I have to select the verts in order, and store them in array, so I pick the source vert then the target, then another source and another target etc. With this array I copy 1 to 2, 3 to 4, 5 to 6 etc. Using the looping method reorders all the verts.

Now, the vert ids are the same in the skin modifier as they are in the poly/mesh so I thought I’d use those vert selection methods, but guess what - when in skin you can’t use the poly/mesh vert identification methods any more.

Now, my solution to the problem.

I want to be able to mirror whilst the mesh is deforming, so that I can check the mirror has worked.

So, I have 2 buttons in my rollout - Create eMesh and Perform Copy. Create eMesh sticks an edit mesh modifer on the stack above my skin modifier, so I can see all the deformation. I can select my array of pairs of verts here, so thats part one.

I already have working copy and paste functions (with mirror) in my current script, they just take a vert id. The copy function queries the specified vert and extracts all the bone and weighting information. The paste function then applies this information to the specified vert.

So now, after I’ve selected all my weights, I press the ‘Perform Copy’. It stores my vert selection in an array, deletes the mesh modifier and goes back to the skin modifier. Then its just a simple loop - get the information from vert 1, calculate the mirrorbones, paste that to vert number 2. Then 3 to 4, 5 to 6 etc.

It works.

But it’d be a lot cleaner if there was just a skinop.getvertselection command.

Technorati Tags: , , , , , ,

links for 2006-08-23