• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
lipsryme

Questions about advanced lighting techniques (IBL, SH)

2 posts in this topic

Hey guys,
The last couple of days I've been reading about Image based lighting and spherical harmonics and stuff like precomputed radiance transfer and trying to get a grip on how these techniques are used and implemented.

Now as I seem to get closer to understanding how all of this works there are a few questions popping up for me.
And I'd hoped you guys could help me with those...

So here I go:

1. If I understood correctly, both of these general ideas try to approximate indirect lighting from the environment.
But then when I read about spherical harmonic lighting, people still talk about using an environment map to precompute parts of the light equation and storing them via SH. Which is then what you'd call spherical harmonic lighting. But if you use an "image" to compute the incoming radiance, where on the other hand is the difference to "image-based lighting", or is it the same ? Or a combination of both ? Then there's also the talk about "prefiltering" an environment map(?)

2. When people talk about IBL, mostly they refer to indirect lighting using an environment probe. But this is where some confusion comes in.
Since the meaning of talking about IBL seems to differ quite a lot. There's distant IBL and local IBL. I understand that using a distant IBL would only make sense when rendering only the hemisphere (the sky) to simulate the sky lighting on the scenery. Another meaning of IBL is having "glossy reflections" or so, but as far as I can tell, isn't that just good old environment mapping ? Or is it special because of the "local" technique being used ? If not how does it differ ? And how does it work?

3. Now for something more practically, if I were to implement image-based lighting in my application, the first thing to do would be placing environment probes in the scene. Now those are rendering the final scene image of the surrounding area into 6 render targets as a precompute pass, correct ? That basically means that the reflections I'm getting for everything will be completely static or not ?
I've read somewhere that you could render a single probe on your player's position (in real-time?) for a solution on this problem.
But then where exactly would I place this ? On top of the player's head ?

4. This is a design question. In my deferred renderer I have a handful material types predefined, e.g. default, skin, sky,...
Would I just assume that everything is going to be reflective to some degree ? Or would I need to define a material for this ? If yes then I'd also need to have another variable telling the lighting shader how reflective this material has to be. Is there any good way around this ? As I've never seen any g-buffer layout having this kind of parameter packed somewhere.

5. Finally which technique of advanced lighting or indirect lighting approx. techniques would you recommend, to further read about and try to implement? Is PRT worth getting into ? I'm trying to implement dynamic daytime change later on. So something dynamic, at least for the sky would be quite nice. Edited by lipsryme
0

Share this post


Link to post
Share on other sites
1. SH can be used as a structure to store data that varies around a sphere, much like a cube map. It's basically a 'frequency space cube map'.
Because of the above, it's not explicitly tied to any kind of lighting algorithm (you can use cube maps for infinite different purposes). It turns out that SH sometimes happens to be a good tool to store light in an IBL system.

2. Yes, you can think of traditional 'environment mapping' as a way to produce Phong-specular lighting via IBL. IBL is any technique where your light is sourced from an image.

3. Yes, precomputed lighting will be static. For dynamic probes you'd usually use the centre of the object that you're collecting light for.

4. Your 'specular mask' (usually present in a GBuffer) is a reflectance coefficient.

5. At the moment, I'm excited by deferred irradiance volumes:
http://codeflow.org/entries/2012/aug/25/webgl-deferred-irradiance-volumes/
2

Share this post


Link to post
Share on other sites

[quote name='lipsryme' timestamp='1357075631' post='5016475']
1. If I understood correctly, both of these general ideas try to approximate indirect lighting from the environment.
But then when I read about spherical harmonic lighting, people still talk about using an environment map to precompute parts of the light equation and storing them via SH. Which is then what you'd call spherical harmonic lighting. But if you use an "image" to compute the incoming radiance, where on the other hand is the difference to "image-based lighting", or is it the same ? Or a combination of both ? Then there's also the talk about "prefiltering" an environment map(?)

[/quote]

Like Hodgman said, SH is a tool. it happens in this case to not only be efficient at storing the result but also being efficient at doing the convolution.

The filter you are talking about, is a necessary calculation to perform the average (weighted by lambert term) of light arriving at a point with a given surface normal.

for example a flat ground receives energy from the whole upper hemisphere, however the point that matters the most is the point on the hemisphere that is exactly on the top pole. But roughly, to light the ground you need to sum up all points of the hemisphere. This is the convolution that SH are capable of very quickly. There is a tool to do this convolution: AmdCubeMapGen, you will see it is extremely slow when performing on spatial space, but much faster in frequency space (in the version modified by Lagarde).

So, you can indeed to IBL with env maps or SH indifferently, however if you don't convolve you cannot do diffuse lighting, you can only do pure reflective lighting. (perfect speculars)

That is one huge disadvantage of precomputed method, you cannot have easily varying specular coefficients, basically in the literature we find mostly preparations for diffuse surfaces. (therefore the lambert term in the convolution)

 

[quote]
3. Now for something more practically, if I were to implement image-based lighting in my application, the first thing to do would be placing environment probes in the scene. Now those are rendering the final scene image of the surrounding area into 6 render targets as a precompute pass, correct ? That basically means that the reflections I'm getting for everything will be completely static or not ?

[/quote]

it is correct, but you can re-render that at any time, once per frame for example, or by tiles over a few frames...

[quote]
I've read somewhere that you could render a single probe on your player's position (in real-time?) for a solution on this problem.
But then where exactly would I place this ? On top of the player's head ?
[/quote]

At camera position is a common technique, but using that env map for objects, particularly the distant ones, gives very false results. however it has the advantage of requiring only one cube map, which allows dynamic re-rendering, but if every object needed their own (to be realist), it could only be static because there would be too many to re-render.

[quote]
5. Finally which technique of advanced lighting or indirect lighting approx. techniques would you recommend, to further read about and try to implement? Is PRT worth getting into ? I'm trying to implement dynamic daytime change later on. So something dynamic, at least for the sky would be quite nice.
[/quote]

Screen Space Local Reflections, Sparse Voxel Cone Tracing, Light Propagation Volumes, Radiance Hints, Imperfect Shadow Maps and many more

1

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0