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

Need Help: blood particles in an unlit environment

8 posts in this topic

Well, I've an issue with lighting particles in a deferred shader. With lot of lights and alpha blended particles, (fake) lighting this particles in a proper way is difficult.

For light emitting particles (fire) or particles always close to light sources (smoke) it is manageable, but once I got particles in dark or light areas (blood, fog) I got a problem.

In dark areas the particles are just too bright, in lit areas they are too dark. Without alpha blending I could utilize the deferred lighting pipeline, but I want to use atleast soft particles, which needs alpha blending for proper integration. Any tips or tricks ? It must not be a perfect, realistic solution, a little fake would help too.
0

Share this post


Link to post
Share on other sites
Traditional forward lighting techniques?

e.g. Find the most influential light sources in the area surrounding the particle system (cpu side), consolidate them into a single area light source for use in the particle shader.
0

Share this post


Link to post
Share on other sites
Thx for the tip Hodgman, I've implemented several particle techniques:
- forward rendered unlit additive/alpha blended particles
- forward rendered fake lit (based on ambient and active light sources)/alpha blended particles
- standard deferred lighting pipeline

In my context (dark environment with several hundred point light sources, no globle light source), I'm not getting a very homogenous light setting, so none of the forward rendered approaches works very good in changing light settings. The particle system takes a fire'n'forget approach and the camera is the center of the particle and lighting system. I.e. I have 10 light sources on the right side , where on the left are none. The average fake light value would be too bright for particles on the left side.

The only really working way is the standard deferred lighting pipeline, making alpha blending/soft partilces almost impossible :(
0

Share this post


Link to post
Share on other sites
You already use the deferred-transparency via stippling trick for your water, right? That (or something closer to inferred rendering) might be of use here too. If you write the particle's alpha out to the G-buffer, you could still do soft-particles, and a 2x2 stipple pattern could give you 1 opaque layer + 3 layers of transparency. Might get a bit hairy with lots of overlapping particles though, unless you did the inferred 2-pass rending technique.
1

Share this post


Link to post
Share on other sites
You have a particle system, that renders batched particles. You draw them in one call I guess, and you need to lit every single one of them separately, based on their distance from the average lights sum in the current scene ?
Something like this (excuse my photoshop skills)
[attachment=6188:lit.jpg]
As opposed to this.
[attachment=6189:not_lit.jpg]

Can you store (on CPU side) an attribute in every particle vertex, how close it is from the average sum of scene lights, so you can adjust the brightness of this individual particle in the pixel shader...
Maybe you can skip the CPU side and pass to the particle vertex shader the average light position and (color, why not) and then for each processed particle vertex pass to the pixel shader it's distance from the average lighting.
1

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1321949017' post='4886477']
You already use the deferred-transparency via stippling trick for your water, right? That (or something closer to inferred rendering) might be of use here too. If you write the particle's alpha out to the G-buffer, you could still do soft-particles, and a 2x2 stipple pattern could give you 1 opaque layer + 3 layers of transparency. Might get a bit hairy with lots of overlapping particles though, unless you did the inferred 2-pass rending technique.
[/quote]
Sure, you're right. My current approach is only 1 layer of transparency, but I already thought about extending it to 3 layers. After getting rid of high-frequency normal mapped surfaces, inferred rendering could be interesting again, thought I a little bit afraid, that the spliiting/gathering could be a little bit too expensive.
Several options I need to analyse further, thx for pushing me in the right direction :D


[quote name='solenoidz' timestamp='1321954908' post='4886489']
You have a particle system, that renders batched particles. You draw them in one call I guess, and you need to lit every single one of them separately, based on their distance from the average lights sum in the current scene ?

Can you store (on CPU side) an attribute in every particle vertex, how close it is from the average sum of scene lights, so you can adjust the brightness of this individual particle in the pixel shader...
Maybe you can skip the CPU side and pass to the particle vertex shader the average light position and (color, why not) and then for each processed particle vertex pass to the pixel shader it's distance from the average lighting.
[/quote]
In my particle system the CPU is only involved during creation and destruction time of a particle. All the movement, color/size changing etc. is done on the GPU. The average light sum is in my context a really bad approximation and I want to avoid to touch each particle every x frames. Nevertheless, the idea might work in an other context :D
0

Share this post


Link to post
Share on other sites
what about this:

* overlaying a grid of diffuse light probes (using spherical harmonics or an approximation) in the area where your particles / fog will be
* then each frame, compute the diffuse light that reaches each light probe from all of the point lights
* when drawing your particles / fog, just sample from the nearest light probe (or interpolate between the nearest 8)

This would be fast because the number of light probes would be much smaller than the number of particles.
So the number of lighting calculations will be O(number of light probes * number of lights).
Sampling the lighting for each particles is a O(1) look-up.

You could probably even compute the light probes on the CPU...


1

Share this post


Link to post
Share on other sites
[quote name='coderchris' timestamp='1322075843' post='4886980']
what about this:

* overlaying a grid of diffuse light probes (using spherical harmonics or an approximation) in the area where your particles / fog will be
* then each frame, compute the diffuse light that reaches each light probe from all of the point lights
* when drawing your particles / fog, just sample from the nearest light probe (or interpolate between the nearest 8)

This would be fast because the number of light probes would be much smaller than the number of particles.
So the number of lighting calculations will be O(number of light probes * number of lights).
Sampling the lighting for each particles is a O(1) look-up.

You could probably even compute the light probes on the CPU...
[/quote]
It sounds like light propagation volumes (crytek). It need to be a 3d grid with "relative" high resolution, that is the number of light probes will climb up quite fast. An other problem would be 8 texture access for each particle, which is quite high. Nevertheless, I could imagine a very high quality from it, but it is just too expensive for my current goal. :)
0

Share this post


Link to post
Share on other sites
I also recommend light probes. Really, you don't need SH and you could just use the DC term of SH (which is ambient).

Diffuse lighting is low frequency so you don't need a high amount to get good looking results. You can store in a 3d cubemap and turn on filtering to get one texture access or per particle batch you can submit 8 as a constant uniform and do the interpolation yourself in the shader. It's not going to be very expensive.

-= Dave
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