I've decided I should make this a permanent and publicly searchable page on my blog (I keep losing links), so here's a place where I'll compile shader and material reference (code, scans, samples, best practice documents, reference images, etc) for myself and for other people working on such things. This will likely be primarily focussed on physically based rendering topics, but there may be other stuff here as well.
Showing posts with label light. Show all posts
Showing posts with label light. Show all posts
Friday, January 16, 2015
Thursday, October 2, 2014
Lit Particle Shaders Demo
I've been working on some custom shaders for Shuriken particle effects in Unity. The main idea is to fill gaps that currently exist in the available alpha blended material.
Crucially, the default alpha blended material does not receive light from the scene -- not ambient or direct illumination. I originally wanted to also support point lights, but with the current limits on what data you can know about particle positions and normals, it ends up being a fairly complicated and performance-prohibitive feature.
That's why my shader supports lighting from directional sources and ambient sources. I did manage to get vertical hemispherical lighting working, so particles can receive disparate lighting from the top and bottom (either directional on top or on bottom).
There's also not good default way of modelling emissivity in particles. You have to either have two particle systems with two different materials one alpha and the other additive, or take what you can fudge from the alpha blended. I found myself always making "glow" particle effects to play alongside other effects, so I just wrote a shader that supports that kind of effect by using multiple passes and materials. Unfortunately, Shuriken can only pass one float4 value through the vertex color input of a CG program, so the "color" values in the Shuriken system only refer to the glow color and the general alpha of the particle. The "background" color of the particle can only be adjusted per-material. This turns out to not be much of a problem in practice, though, and it's an unambiguous step up from the default workaround for this effect.
Anyway, I hope to make it available for purchace on the asset store shortly.
That's why my shader supports lighting from directional sources and ambient sources. I did manage to get vertical hemispherical lighting working, so particles can receive disparate lighting from the top and bottom (either directional on top or on bottom).
There's also not good default way of modelling emissivity in particles. You have to either have two particle systems with two different materials one alpha and the other additive, or take what you can fudge from the alpha blended. I found myself always making "glow" particle effects to play alongside other effects, so I just wrote a shader that supports that kind of effect by using multiple passes and materials. Unfortunately, Shuriken can only pass one float4 value through the vertex color input of a CG program, so the "color" values in the Shuriken system only refer to the glow color and the general alpha of the particle. The "background" color of the particle can only be adjusted per-material. This turns out to not be much of a problem in practice, though, and it's an unambiguous step up from the default workaround for this effect.
Anyway, I hope to make it available for purchace on the asset store shortly.
Labels:
CG,
light,
particle systems,
shader,
Technical Art,
Unity,
video,
videogames,
youtube
Wednesday, July 30, 2014
Pontificating on a Different Kind of Particle...
I have a tendency to write overly-long youtube comments. This one was on a video of someone showing off a high powered laser popping balloons...
Subscribe to:
Comments (Atom)