• Advertisement
  • entries
    232
  • comments
    1463
  • views
    959929

Anisotropic lighting

Sign in to follow this  

552 views

A coworker (Inigo Quilez) suggested that i use anisotropic lighting to simulate metallic surfaces on the space station. To my surprise, it works pretty well! It is also much more efficient than Cook-Torrance lighting, as it only requires to compute N.L and N.H, and to perform a texture lookup with these two coordinates. The lookup texture includes a small "diffraction" effect, which make rainbow colors appear. It is too strong now ( it should be subtle ), but it really gives a nice touch to the station. When seen in real-time, the anisotropic lighting is very nice, making distortions similar to caustics ( but more coherent and only viewpoint dependant )..

I've also implemented per-texture ambient occlusion ( as opposed to per vertex, which was limited by the tesselation quality ), and used 3ds max's render to texture feature to generate the textures. The ASE importer tool now supports multiple sets of texture coordinates, as i needed two ( one for the diffuse coords, one for the ambient occlusion coords ). I guess this could be used for lightmapping, too. Unfortunately, with all the textures and effects going on, ambient occlusion ( even per texture ) is almost invisible.

Mandatory screens of the station with anisotropic lighting:







If somebody still says that the station looks like plastic, i'll make myself a monk and go loose myself in the desert.
Sign in to follow this  


13 Comments


Recommended Comments

It looks like pla--- oh, right [grin]


Choosing lighting models for metallic surfaces in space is a royal PITA because 99% of what our brain recognizes as "metallic" actually has to do with reflections of the environment. When the environment is devoid of things to reflect, the metallic effect is extremely hard to achieve.

One trick that I used to use in my raytracer days was to hack an environment map onto the surface. In Freon I tended to favor Torrance-Sparrow or Blinn depending on my mood, but the environment map trick always adds a lot of "metal look" to the surfaces. It's amazing how much effect the subtle reflection can have. The brain isn't used to looking at reflective surfaces in vacuum, so when the surface misses all the tiny little cues from the environment, it just doesn't "look" quite right.

A similar trick is used in X3, where metal surfaces are environment mapped in combination with a metallic shader to produce the reflective effects. I personally didn't do any graphics work on X3 so I don't know what lighting model was used to produce the metal shaders, but I do know that it was butchered quite heavily in order to favor good appearance over realistic physics. The shader programmer did a lot of tweaking, and surfaces just never really looked "metal" until that reflection was working.

Share this comment


Link to comment
Yeah i know, the cube reflections (and shadows) are still missing. Maybe it's a mistake to try to adjust the lighting before all the other effects are implemented, as i'll surely have to tweak everything again later.

The art in X3 is absolutely awesome (especially the ships). I must say, so far i spent more time looking at the ships and studying the lighting/texturing than playing the game :)

Share this comment


Link to comment
It looks nice, but:
1. Metal space stations aren't good because they will cook everyone inside (or, when on the other side of the planet, they will radiate all the heat away). Most likely, in the future, space stations will be made out of plastic like materials.
2. Don't you think it's better to focus on the gameplay and get somethign working, rather than continously working to improve the looks of a space station?
You are the only programmer working at this game, you don't have resources to waste. People mostly care about the gameplay, and the graphics fall usually on the 3rd place (gameplay, ease of use/stability and then graphics).

This is just an advice, of course, I hope you won't take it the wrong way.

Share this comment


Link to comment
I do not concentrate on the gameplay now, because i want to license the engine this year. So, i'm developping the 3D engine (the core component), but also networking, physics, and the GUI.

Of course i'm not stopping any work on the gameplay at all. It's just not top priority. My plan is to be able to visit all the galaxy, jump to other solar systems, fight, and maybe dock onto stations (in a very simplified version), all networked, by the end of the year. While finishing the game engine in the mean time.

In 2007, i will concentrate on the gameplay.

Share this comment


Link to comment
Guest Anonymous Poster

Posted

So what Raduprv means is that looking like plastic is A Good Thing :)

Seriously, I love the effect. When you tweak it, you can leave this rainbow thing still noticeable enough, and say that it's not really metal, but a combination of special metal alloys and polymers; so it distorts light in a slightly different (and interesting) way.

And I also agree with the remark about environment mapping; I'm developing an arcade 3D space shooter and I have to say that even without fancy shaders, environment mapping does a good job at making everything look very shiny :)

I'd also like to ask if this effect is going to be used a lot. You know, you spent so much time on it, I think most ships and constructions should use it.

Share this comment


Link to comment
So what Raduprv means is that looking like plastic is A Good Thing :)

Seriously, I love the effect. When you tweak it, you can leave this rainbow thing still noticeable enough, and say that it's not really metal, but a combination of special metal alloys and polymers; so it distorts light in a slightly different (and interesting) way.

And I also agree with the remark about environment mapping; I'm developing an arcade 3D space shooter and I have to say that even without fancy shaders, environment mapping does a good job at making everything look very shiny :)

I'd also like to ask if this effect is going to be used a lot. You know, you spent so much time on it, I think most ships and constructions should use it.

[EDIT] Please delete the above by AP, it was me -- sorry for the double post :P

Share this comment


Link to comment
it doesn't matter if the outside material is a metal. It will protect the station from physical damage, and below the metal surface you are free to isolate the thing as you want. If you have a perfectly isolated item (almost un-touched by temperature changes) it doesn't change temperature radically when you apply a layer of metal to it...

I must say, now the old pictures that should look nonplastic look like plastic to me. As long as my pc runs it i'm happy ^^.

Share this comment


Link to comment
Metal is not the best material, especially with the advancements of current materials.
There are plastic based materials that can withstand huge temperatures, be pretty flexible and strong at the same time, and block space radiation as well (better than metals).
I think the space stations in the future will have a metal skeleton but the outer layers made out of some layers of plastic and ceramics.

Share this comment


Link to comment
Erm. It's a game, looking cool should be more important (imo) than making perfect sense. People play to escape reality right?

Share this comment


Link to comment
I personally like it better the way it was before you added this metal-ish effect. Seemed more realistic, actually.

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Methinks the specularity is just high. That effect will look awesome with more subtle lighting. :)

Share this comment


Link to comment
A bit less specularity and a bit less of this color thingy effect and it will be great! Especially with some real world reflection going on!

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement