2D Lighting + Particle Effects

I’d like to make a 2D platformer with lighting effects. I’m thinking headlights that tilt with the vehicle as it goes up and down slopes. So I would need spotlights and onmi-directional lights.

I’ve never used SDL, but from looking at the wiki it seems that there is no blending? What would the easiest way to get lighting effects be?

I’d also be interested in trying some (2D only) particle effects. Should I use a different library for rendering, and use the SDL for the rest of the game?

Thanks in advance!

Hello there,

SDL2 supports the blend modes shown at https://wiki.libsdl.org/SDL_BlendMode?highlight=(\bCategoryEnum\b)|(SDLEnumTemplate) (SDL_BlendMode enum). Note that under the related functions header, you’ll find that SDL2’s renderer, surface & texture types can utilize these blending modes.

If the blending types offered by SDL_BlendMode are not enough, the only other option I am aware of is to use SDL2 with the OpenGL API directly.

Cheers,
Jeffrey CarpenterOn 2014/03/ 10, at 15:41, Ebonair wrote:

I’d like to make a 2D platformer with lighting effects. I’m thinking headlights that tilt with the vehicle as it goes up and down slopes. So I would need spotlights and onmi-directional lights.

I’ve never used SDL, but from looking at the wiki it seems that there is no blending? What would the easiest way to get lighting effects be?

I’d also be interested in trying some (2D only) particle effects. Should I use a different library for rendering, and use the SDL for the rest of the game?

Thanks in advance!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Most decent lighting effects (and especially 2D lighting) use shaders.
You’re in for a lot of learning if your first project with SDL uses 2D
lighting. “Start small” would be my suggestion.

Jonny D

Doing lighting by hand is rather tedious; perhaps take a look at the great
work in sdl-gpu:
https://code.google.com/p/sdl-gpu/source/browse/#svn%2Ftrunk%2Fdemos~
Doug.

On Tue, Mar 11, 2014 at 4:41 AM, Ebonair wrote:

I’d like to make a 2D platformer with lighting effects. I’m thinking
headlights that tilt with the vehicle as it goes up and down slopes. So I
would need spotlights and onmi-directional lights.

I’ve never used SDL, but from looking at the wiki it seems that there is
no blending? What would the easiest way to get lighting effects be?

I’d also be interested in trying some (2D only) particle effects. Should I
use a different library for rendering, and use the SDL for the rest of the
game?

Thanks in advance!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

There was a tweet earlier today with a couple of nice links (even nicer if
you use one of the same languages):

Jonny D

I can’t tell anyone to only use their own work because we all do just that.
None of us make their own language, then compiler, drivers, then driver
libs, and then write a game without the use of math invented by other
people. That’s nutz!
I think we need to find a balance where we utilize what we like and created
what we don’t. Some will say that makes little sense, but then again, real
coders didn’t become so by just accepting the ways other people do things
lol. I think for me, the best thing is to make several textures with
transparency and a 3d surface. I think this is the most effective way to
make games for many reasons. If I use a 3d context to burn the textures
onto the surface from a camera z position I can then use opengl to light
this surface. I’mma start a thread asking about that. Right now!On Tue, Mar 11, 2014 at 8:22 PM, Jonathan Dearborn wrote:

There was a tweet earlier today with a couple of nice links (even nicer if
you use one of the same languages):
https://twitter.com/worrydream/statuses/443523090509611008

Jonny D


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org