   Modern Lighting Techniques
  Hello.Currently I'm working on a graphic engine. I'm need to know which lighting techniques are used by modern games.My goal is to handle unlimited number of lights with per-pixel lighting quality. Do somebody know which techniqe could be the best for that? Of course I'm think about run-time mode.Edit: I'm using Direct3D with Effect frameworkThanks   
Despite Direct3D being your target platform, I think you'll get a wider discussion from the GP&T forum. Moved.Answering your question is at best difficult - all games tend to have different restrictions and requirements. Even then in my recent research it seems that a lot of games will use base models but they'll be tweaked so they look right - thus the end result might not be a standard lighting model...<shameless-plug>My recent IOTD shows a number of lighting models than can easily be done in real-time using Direct3D.</shameless-plug>Also, going for unlimited lights with per-pixel quality might be overkill. There are some very clever optimizations that reduce the lighting quality with distance/contribution that can be essential to getting good performance.A bit more information about what you plan on using your graphics engine for might be useful..hthJack   ;  Most next-gen games use per-pixel Blinn-style lighting for their objects and levels. Anisotropic lighting is sometimes used for fur and metal objects and water sometimes even use a Fresnel equation.I believe that developer.nvidia.com has a sample about implementing different lighting models on the GPU.Some lighting models can be quite expensive and therefore, optimizations have to be implemented for them to be applicable at realtime framerates.   ;  You have right jollyjeffers. It is my mistake. I choosed wrong category.Currently wy use standard-like lighting based on dot product. Quality is good if it is a per-pixel technique.All process is unoptimized. Now rendering loop with light take a long time, because one rendering pass is equal to one light (high blending usage).I thinking about introducing HDR, but with current system performance will be killed.So, one thing I can do is to change lighting technique. I think about material which solve 4 lights with maximum quality. To achieve unlimited light effect I want to use ambient cube.Now I know. Doing a full detail lighting in real-time is imposoble to do (then it is not a real-time).I'm worried about performance of this technique. I think, ambient cube allow nice decreation lighting quality by removing maximal full detailed lights count.Did anyone use ambient cubes?   ;  Maybe you should look into deferred shading, it's a technique for rendering multiple lights in one pass.There's a tutorial on this site: www.ultimategameprogramming.comHope I've been able to help,Jeroen   ;  Well, godmodder. I don't know that page. I will check.Thanks for URL :)   ;  If your interested in culling lights and shadow casters, I think Eric Lengyel has a presentation he presented at GDC on light (and shadow) culling. Might be worth checking that out if you want the ability to handle a whole bunch of lights.Hope this helps :-)Here's the link, btw: http://www.terathon.com/   ;  "My goal is to handle unlimited number of lights with per-pixel lighting quality."Thats the goal of a lot of poeple, but so far vey difficult to acheive by brute force. While there are theories of how to get there, like deferred shading, I dont think any solution is really optimal. Deferred shading has its own level of restrictions..I'd say you need to implement a solution that uses some kind of scene and light management. Because in the real world, you dont really need an unlimited amount of lights all shining on ONE object. What you want is an unlimited amount of lights in your entire level, which is a very different thing, and one far easier to accomplish.For instance, each vertex could have a light limit (say 8) but then each vertex can affected by any 8 lights out of an unlimited (well obviously its goign to be limted in some ways, like the array length) number. Since the majority of your lights wil be static, you can do some preprocessing where you find only the nearet 8 lgihts to each vertex, then store the light IDs in your vertex information, like  in some texture coordinates. So in your vertex shader you can have an aray of constant float4s, where each array number is a light, and since each vertex then knows what light IDs to use, you are all set. Since writing to a vertex buffer is fast, you can also update this data in realtime for individual models, to get dynamic lights if needed.-------------------------------------------------------------------As far as your actual lighting model, you ought to implement a number of models, depending on the surface interactions required, some objects dont need specular reflections for instance, and some things really demand some kind of sub-surface scattering(like skin), and so on.   ;  Sorry! I forgot about this topic :/So, I understand. I can't handle unlimited amount of lights. I need a cheat :)I think good way is to handle for example 4 lights with full details. Others should be placed on ambient cube. Model will be mapped using ambient cube and it simulate interaction with other lights.I think it is good idea.   