• 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
solenoidz

Point light clipping

10 posts in this topic

Hello.
I'm building a simple indoor level that is lit using point lights. The renderer uses deferred lighting. I have problems with point light placed near walls and corners to that influence/illuminate the next room/wall. I need a point light placed in a room to only illumunate the room it belongs to.
How can I achieve such thing in a matter of speed and simplicity ? Do I need to send some kind of "influence box" corners to the pixel shader and clip lit pixels aganst it in the shader ?
Thank you in advance.
0

Share this post


Link to post
Share on other sites
Easy solution is not to place point lights close enough to bleed into other rooms. A few games have used that as their solution.

Or you can have the point lights be attached to each room model, and then draw each room as a separate model with only it's own lights.
1

Share this post


Link to post
Share on other sites
Thank you.
I'll try to stay away from additional meshes for now. I implemented simple axis aligned boxes that enclose light areas and it works almost fine, but since they are axis aligned, the rooms in the level should be also axis aligned if the need to be lit with such lights. Probably I should transform the boxes later on, and pass the matrix to the pixel shader to transform the world position of the pixel being lit to the space of that transformation matrix.
0

Share this post


Link to post
Share on other sites
I have a similar issue. It somewhat depends on your engine. None spherical bounding volumes for point lights bear the danger of clipping [i]wanted [/i]light bleeding,ie think of a door connecting the both rooms in your example. So, Daaarks sugguestions has the best price-value ratio.

My engine is capable of rendering lot of light visible sources (>100), in this case I use it to assign several point lights to a logical light source. I.e. instead of one strong point light for a torch, I use 1 main point light with limited radius to avoid most of the light bleeding and a few fill lights, with an offset reaching into the room to give it an ambient light distribution. The fill lights don't affect the specular component to prevent multiple hi-lights, only the diffuse.
0

Share this post


Link to post
Share on other sites
Thanks
I don't wanna use Daaark suggestion because my level geometry won't let me. I can't break the level to separate rooms, based on lamps they have placed into.
Right now I use lights clipped against axis aligned boxes, that are properties of the lights. When I need the light to bleed into another room from a door or something, I use cube shadowed light or spot light with shadows.That way light won't bleed from a closed door etc..
Ashaman73, as I understand it, you are modeling some kind of "area" light with small point lights. That is sure a good idea - my engine is also deferred light count isn't that crucial.
I'm thinking about these things. :

1.Use geometry to simulate "area" lights. For example, a box encloses the lights influence to the boundary of the room, and another small box reaches from the open door to illuminate the corridor. At the time of rendering, render those boxes that belong to the light in question.
In the pixel shader, sample the G-Buffers with the screen position of the pixel being processed. Use lights usual attenuation. Gotta try this one. It is pretty close to what @Ohforf sake suggested about crytek.

2.Use light attenuation maps/textures. Right now I use 1D attenuation map to make the lights attenuation flexible and to avoid complex and expensive function in the shader. What about 2D attenuation maps, or even 3D cube maps ? Light propagate only where the 2D map ( for example in X/Z plane) allows. Want the room light to also illuminate the corridor without illuminating the next room, just draw it [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

What do you think. Am I missing something that would render those methods unpractical ?
0

Share this post


Link to post
Share on other sites
[quote name='solenoidz' timestamp='1352874648' post='5000807']
What about 2D attenuation maps, or even 3D cube maps ?
[/quote]
Really close [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Attenuation describes the light intensity depending on the distance, you should keep this. But many games uses projective light maps, which are masking out the light, similar to shadow maps. The cheapest light projection is done for spotlights (a simple 2d alpha texture), but you could although use cube maps for omnilights or parabolid texture mapping. It is kind of shadow mapping with static shadows(shadow maps do a depth comparision, whereas a projective light map is just a alpha mask).
1

Share this post


Link to post
Share on other sites
Hmr, ok.. I support those kind of projective lights so it won't be a big deal to try out how it comes along.
But man, with all those dynamic and per pixel lightings and stuff, sometimes I'm missing the light maps from the past..and the nice and fast illumination they offer..
0

Share this post


Link to post
Share on other sites
[quote name='solenoidz' timestamp='1352883523' post='5000832']
But man, with all those dynamic and per pixel lightings and stuff, sometimes I'm missing the light maps from the past..and the nice and fast illumination they offer..
[/quote]
Lightmaps are still often used in current gen (e.g. UDK,Source), though the next generation of engines (and hopefully consoles) will start to support dynamic global illumination.
Lightmaps are almost the optimal solution if you have a small,static scenes, performance and qualtiy wise, but once you start to use dynamic scenes, lightmaps get really quickly clumpsy. As said, I've similar issues with my game and I'm still looking for some good (fake) solutions.
0

Share this post


Link to post
Share on other sites
Yeah, I've also heard games are still using lightmaps. Unfortunately lightmaps won't work well for me because
1. I have a WYSIWYG editor and they need slow preprocessing.
2.I need dynamics scenes with physics objects, including light properties animation( flicker, color cycle etc.) and dynamic shadows.
3.I use geometry instancing and in other words reuse mesh data and render an instance in several places. I'm not sure how a light map could be made to cope with a city in which any other building is a mesh reference or instance.
4. I need outdoor scenes with trees, sunlight and shadows. I'm not sure if a single lightmap could cope with a big scene and shadow and overall lighting quality.
5.Lighting quality is seems to be per-texel, not per pixel and I will probably need big lightmap textures and lots of vid RAM for big scenes.
0

Share this post


Link to post
Share on other sites
For future reference, this is the presentation I meant:
[url="http://advances.realtimerendering.com/s2010/Kaplanyan-CryEngine3(SIGGRAPH%202010%20Advanced%20RealTime%20Rendering%20Course).pdf"]http://advances.realtimerendering.com/s2010/Kaplanyan-CryEngine3(SIGGRAPH%202010%20Advanced%20RealTime%20Rendering%20Course).pdf[/url]

They call it "Clip Volumes" (see slides 68 - 74).

Edit: Fixed broken link. Edited by Ohforf sake
0

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