GLSL point sprites with lights

Hi all,

I would like to know if it’s possible to apply lighting to point sprites rendered from a glsl shader?
I know it is possible to do it with a geometry shader using billboards but I wonder if I can do it using only vertex+pixel shader.

Something that would look like this:

vec4 texture = texture(sSpriteTex, pointUVs); fragColor = TDOutputSwizzle(texture * color);

Thank you very much!

Vincent
pointcloud_sprites_light.4.toe (14.4 KB)

Ya, you just feed whatever normal you want into the lighting functions and you’ll get a value for it. So if you want them to be lit as if it’s facing the camera, send the world normal that is facing the camera into it

Thank you!

Did this ever work? I’m trying to get lighting and shading on particles using the point sprite shader but the default point sprite shader seems to be a constant lighting type (ambient) and doesn’t do shadows.

Is there a way to achieve something look like this without instancing actual geometry onto the points?
particlelighting01
particlelighting02

Also interested in the answer to this.

Ah, nevermind, I think I just figured it out…

Add a Point SOP and set a static normal manually… or do some calculation for it with a custom Vertex shader.