We’ve Moved!

11 12 2010

Hey guys – This is just a quick announcement to let you know we’ve moved to our own servers. The new location:

http://blog.sixtimesnothing.com

Thanks!





Displacement mapping with Unity’s built-in terrain

10 11 2010

 

Going a step further than normal maps, here is an implementation of relaxed cone step mapping (ala GPU Gems 3) with Unity’s built-in terrain. It adds agreat amount of detail at a relatively low cost.

Screenshot from Dawn of the Tyrant (In-development)

 

To use it, unzip the 2 files (shader and C# script) into your assets folder, save, and then restart Unity (so that the terrain shader replaces the built-in). Drag the C# script onto your terrain object and fill in the parameters.

It requires that you input normal, parallax, and texture for each of a maximum 4 textures that line up respectively with the texture list of your terrain object. It also needs the tile size of each texture and a parallax depth that determines the amount of offset (0.1 is a good start).

The shader itself is open to further optimization. It currently tests against all 4 textures which will likely hurt your framerate. It will be dramatically faster if you cut the shader code to accommodate only 1 or 2 terrain parallax textures that need the parallax effect and leave the others to normal mapping.

The parallax format is relaxed cone. Use xnormal to convert heightmaps to relaxed cone step maps.

Future planned improvements are height based blending (the screenshot below shows why this would improve the unnatural fading between textures),  instruction optimization to allow for more steps, and proper silhouettes.

Enjoy!

Download Here

Screenshot from Dawn of the Tyrant (In-development)





Bump mapping for built-in Unity terrain

10 10 2010

This is a feature that a lot of Unity users gripe about, so I thought I would post our solution for it. In the .zip file (download below) you’ll find a shader replacement and a C# script for sending the bump maps to the shader.

To use it simply attach the C# script to your terrain object and add the shader replacement in your assets folder. You will probably need to restart Unity after this so that the shader replaces the built-in.

The script allows 4 bump map slots. These slots correspond respectively to up to 4 terrain textures. For each of these bump maps you also need to specify the tile size which should match the same as the terrain texture. You will also notice seperate specular levels for each texture.

It is fully integrated with Unity 3.0′s surface shaders so it reacts correctly with all lights, shadows, etc. It also exposes a means of sending textures and values to the built-in shaders, so let us know what you guys end up doing with this.

Note: The bump maps won’t affect the base map, so you’ll need to set the base map distance high.

Download here

Enjoy!





Terrain Toolkit released… finally!

24 02 2010

’nuff said really. ;)

Download the Terrain Toolkit here: http://unity3d.com/support/resources/unity-extensions/terrain-toolkit

Read about the release here: http://blogs.unity3d.com/2010/02/23/summer-of-code-terrain-toolkit-released

Check out the API demo with downloadable source code here: http://www.sixtimesnothing.com/terraintoolkit/APIExample.html

Online documentation can be found here: http://www.sixtimesnothing.com/terraintoolkit/

Any comments or questions? Contact me here through my blog or discuss the toolkit on the Unity Forums.





Terrain Toolkit: GameDev.Net Interview

5 11 2009

GameDev.Net have published an interview about the Unity Summer of Code Terrain Toolkit project where I discuss some of the aspects of the project as well as my experiences in developing it and being part of the Summer of Code programme.

Thanks to Oli Wilkinson at GameDev.Net for the opportunity to do this interview.

Read the article here:
http://www.gamedev.net/reference/business/features/spotlightSoc2/

You can also discuss the article and the project in the GameDev.Net forums here:
http://www.gamedev.net/community/forums/topic.asp?topic_id=552354

I will endeavor to answer any questions asked. :)

I am hoping that the release of the Terrain Toolkit will follow closely behind.





Unity 3D: Desaturate image effect (Pro only)

27 10 2009

Here’s a simple modified version of the greyscale image effect that allows you to change the level of desaturation. Positive values desaturate the image, up to 1.0 which is totally greyscale. Negative values down to -1.0 increase the level of saturation. Note that values above 1.0 or below -1.0 create strange results.

It uses a texture ramp and the same per-channel ramp offset controls as the colour correction image effect.

As this is an image effect it requires Unity Pro.

Enjoy. :)

Download Unity Package





Terrain Toolkit: Project Status

21 10 2009

I know I haven’t posted much on this project recently – but things are definitely still moving ahead. I have received feedback and comments from the Summer of Code reviewers at Unity – and I’m currently working through the implementation of some of their ideas and amendments. Their feedback has been really useful and the toolkit is definitely benefitting from the added improvements. Most notable will be the addition of ‘presets’ for some of the filters, which should make the toolkit a lot quicker and easier to get up and running.

So hold on, the release shouldn’t be too far away now. :)








Follow

Get every new post delivered to your Inbox.