SLD and special effects

Does anybody know how to create special effects like lightning or smoke
using SDL ?
I want do this but I don’t know how.

You can see my rpg game which is actually in development www.zoltharia.com.

Thanx
Zolthar

It’s really not an SDL-specific question.

I’ve done a few ‘special effects’ using SDL. In one app, I used
PNGs (with alpha, of course) of little blurry balls, and made them into
a fireworks-like effect.

In Tux Paint, there are ‘effect brushes’ you can use (under the “Magic” tool),
like “Chalk-drawing” and “Blur”.

You just code it. :^) SDL doesn’t really have much to do with it.

Good luck!

-bill!On Mon, Nov 17, 2003 at 05:55:12PM +0100, Zolthar wrote:

Does anybody know how to create special effects like lightning or smoke
using SDL ?
I want do this but I don’t know how.

Uzytkownik “Bill Kendrick” napisal w wiadomosci
news:20031117112609.A14881 at sonic.net

Does anybody know how to create special effects like lightning or smoke
using SDL ?
I want do this but I don’t know how.

It’s really not an SDL-specific question.

I’ve done a few ‘special effects’ using SDL. In one app, I used
PNGs (with alpha, of course) of little blurry balls, and made them into
a fireworks-like effect.

In Tux Paint, there are ‘effect brushes’ you can use (under the "Magic"
tool),
like “Chalk-drawing” and “Blur”.

You just code it. :^) SDL doesn’t really have much to do with it.

Yeah but I think that using images is not good idea because this solution
takes ram and if you have much effects this takes much ram.
If we could generate effects it would be great.

Greetings> On Mon, Nov 17, 2003 at 05:55:12PM +0100, Zolthar wrote:

[…fx rendering…]

Yeah but I think that using images is not good idea because this
solution takes ram and if you have much effects this takes much
ram. If we could generate effects it would be great.

Well, the problem is that software rendering is pretty hard to do
quickly in a portable way. You’ll have to hack specific code for
every pixel format you want to support. You also have to support a
few different ways of doing the actual rendering, since most video
subsystems have some very severe bottlenecks when it comes to s/w
rendering.

Sometimes, rendering directly to the screen is the fastest way, but
never do that with read-modify-write effects - reading VRAM with
the CPU is usually slower than reading data from the hard drive!

On some rendering targets (like OpenGL or glSDL), you can’t access the
display buffers directly at all, so the only viable option is to do
the effects via procedural textures/surfaces. That is, render the
effect into an off-screen buffer, and then blit that to the screen,
using h/w acceleration if possible. If you’re lucky, you can even get
busmaster DMA transfers that way, which avoids the CPU touching VRAM.

If you need to do read-write-modify effects, and you can’t get the
rendering backend to perform the final operation (some targets
support only opaque and colorkey blits), you’re usually better off
doing all rendering into a system memory off-screen buffer first, so
you have a copy of the screen on the right side of the bottleneck. In
some cases, it might make sense to simulate read-modify-write by
reanding from the system memory buffer, doing the processing and
writing directly to VRAM. That’s especially useful if the special FX
are “on top” (ie is applied as the final step) and are updated with a
higher frame rate than the rest of the graphics; you eliminate the
need for restoring the plain graphics before applying the FX.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Wednesday 19 November 2003 10.00, Zolthar wrote:

Uzytkownik “Bill Kendrick” napisal w wiadomosci
news:20031117112609.A14881 at sonic.net

Does anybody know how to create special effects like lightning or smoke
using SDL ?
I want do this but I don’t know how.

It’s really not an SDL-specific question.

I’ve done a few ‘special effects’ using SDL. In one app, I used
PNGs (with alpha, of course) of little blurry balls, and made them into
a fireworks-like effect.

In Tux Paint, there are ‘effect brushes’ you can use (under the "Magic"
tool),
like “Chalk-drawing” and “Blur”.

You just code it. :^) SDL doesn’t really have much to do with it.

Yeah but I think that using images is not good idea because this solution
takes ram and if you have much effects this takes much ram.
If we could generate effects it would be great.

Using images takes up RAM, using the CPU takes up the CPU, using the
graphics hardware takes up the graphics hardware. No matter how you do
it takes up programmer time. You have to consider the total balance of
costs rather than focusing on a single cost.

In the fire works example he used a some fairly small images, a little
bit of CPU time, and some graphics hardware time to generate a nice
effect. It seems nearly optimal to me because I know that doing it that
way balances the load on RAM, the CPU, the graphic hardware, and the
programmer.

Greetings

The story of the blind men and the elephant applies directly to
designing computer software. Focusing on a single factor will lead you
to make serious errors in judgment.

	Bob PendletonOn Wed, 2003-11-19 at 03:00, Zolthar wrote:

On Mon, Nov 17, 2003 at 05:55:12PM +0100, Zolthar wrote:


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

±--------------------------------------+