woensdag 30 mei 2012

Car reflections

Hello everyone!

Past few months we started developing yet another racing game.. But this time we decided to use Unity as our main development tool, instead of Adobe Director. Unity gives us a lot of possibilities considering performance, 'next gen' graphics and effects for example. Today I want to show you guys one of the graphical effects we are currently working on, the car shader. As you might know, car paint is a reflective material, as shown below.

 
To achieve this effect in our game we need some sort of simulated reflection. This effect is done by using a so called 'Cubemap'. The cubemap contains reflection information/color for the car shader to render. The reflection color is 'Added' to the diffuse color of the model.


The cubemaps can be pre-rendered or rendered during runtime. A cubemap is made using 6 images rendered in 6 different directions from a certain point in 3D space. True realtime cubemap reflection looks very good, much better than pre-rendered in my opinion. But it is also quite 'expensive' for the computer to calculate obviously. For this game we are going to render the reflections for the player car 'real time', since it is a big subject on the screen. The other computer controlled cars will use pre-rendered cube maps.

I also added a 'damage colormap' and a 'damage normalmap' to the shader to simulate car damage.


Greetings,
Joep




Geen opmerkingen:

Een reactie plaatsen