• 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

Light Index Buffer

3 posts in this topic

This idea has been rolling around in my head for a while now, and I wanted to get some serious discussion about it. I'm fairly certain its already been at least demo'd by somebody (Simpsons did it) but here it is anyway. I've thought of various additions to the method, but I'll describe the most crude. The idea is based on the concept that very few pixels on screen are affected by a large number of unique point lights; most are only affected by 2 or 3.

Using a standard 32 bit float4 buffer, I could do an initial draw pass rendering only light volumes. I can have up to 255 lights per channel in this buffer, representing a volume within the view frustum, say, the [nearplane .256] range. Based on the principle that most of the screen will have 4 or less lights per pixel, I can do a single pass here. This provides me with a map of which lights will affect which fragments.

I can then do a standard forward lighting pass. Directional lights can be drawn at this stage, and point lights can be determined from the buffer. Using the values within the light index buffer, I can do a set of texture lookups to determine the position, colour and radius of each light, which would require two texture lookups per light (in its simplest form there are 7 elements, 3 position, 3 colour, and 1 radius)

This crude version of the system has a few obvious problems which would need to be solved before it could be used. It does not actually attempt to detect if there are more than the expected 4 lights affecting each fragment of the light index buffer. If this is the case, there will be ugly artifacts. I'm not certain how I would detect the edge cases, which would require further passes to render.

The number of texture samplings could paralyse the geometry pass, although it would be fairly cheap point sampling.

However it also has an obvious advantage: many point lights for translucent geometry, a single draw pass, and far less graphics memory being required.

Are there any issues I have not considered here?

Share this post

Link to post
Share on other sites
Here're my two cents to the discussion [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img]

1. Even if the technique works fine, it seems somewhat limited. I see one issue in , more or less, mutal exclusive requirements. You would only benefit from such a complex approach when using lot of lights, on the other hand, using more lights will increase the probabilty of using more than 4 lights per pixel.

2. When you want to support, lets say, 4 lights, you need 4 channels. But when rendering a surface, you don't know which channel has been used already. Either you predefine certain light to certain channels (more restrictions, more artifacts) or you need to read-back the buffer (buffer swapping whenever rendering a new light).

3. Artifacts will most probably occurre on pixel level (no surface/model context), that is, moving the camera could lead to nasty noisy artifacts.

The similarity to deferred lighting is great, but with high potential of artifacts and some really strong restrictions. At first it sounds good, but the danger of artifacts, which will destroy the visual illusion, is quite high. Thought the real killer argument could be 2..

Nevertheless, this is a nice research topic, maybe you can pull off some clever tricks to get it running. Good luck [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]

Share this post

Link to post
Share on other sites
I've known species for a while. I told him i was working on a deferred shading renderer and he said: "even i can write a deferred shader." not to say that you are writing a conventional deferred shader, as you explain. but my only two cents on the matter is to "try it."

Grab a copy of render monkey and plumb out your design. I'm not sure how the restriction of 4 got introduced, I think it was probably during the ambiguous moment where you make light contributions indexable per pixel, up to 256 indexes. when really you are limited to your rgb color packing capabilities into your render targets. which is probably 4.

all of this complication definitely seems like more of burden when you start to run asset conversion tools on your production content and realize you need hundreds of shader variations to make pix happy and so on. simplicity is definitely very favorable. i suggest a very traditional deferred shader.

A specific annoyance is that we have a terrain shader which lets you index up to 4 materials from a pallet and blend them into a result. It has terrible artifacts along the edges where pixels use slightly (or wildly) different material blend orders on the seam.

Share this post

Link to post
Share on other sites
My light indexed renderer work like this:
-during occlusion culling (software) I generate a low-res zbuffer
-I cull all lightsources against this zbuffer
-I draw all visible lightsources (based on the bounding sphere) as a bitmask into a low-res texture (I call it "tiled light index texture")
-in the forward pass:
for(int a=0;a<32;a++)
light = LightArray[a];

the ugly:
-limited to 32lights for now, my light mask index had 32bit (I could also extend it to 64 or 128 if I'd use int4 as texture format)
the good:
- due to the culling (also for occlusion), I can quite a lot reduce the lights that need shadowmap generation
- due to tiled handling of the indices, all shading is coherent for the HW, just like it is naturally working, no diverging branching, e.g. if a lightsource has shadows or falloff or...
-for non transparent objects, I could actually create an optimized tiled light index texture that just includes lights that actually touch the surface, but for that purpose I'd have to generate a more accurate zbuffer, and as I was working on a mobile device, I did not really have the spare cpu cycles.

(ok, two lies, 1. my light count was limited to 12 for performance reasons, 2. the final system wasn't using this tech, as the scene was usually anyway covered by 1-5 big lights that were more effectively handled by a specialized shader for every combination, it was faster. all tiny lights were added deferred, not having proper specular etc. but they were too tiny to notice anyway).

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