Skip to main content
gamedev.net
🔒 Locked

Glow effect

Started by Qpeg Feb 20, 2003 at 4:26 PM 5 replies 350+ views
Original Post
Qpeg
Qpeg
For my current project I would like to implement a rendered glow effect for my sprites. By glow effect, I mean the effect you usually see in particle-engines where several sprites rendered over eachother make them look like they have merged together in some way. Am I right by guessing that the glow is a result of adding together the rgb values that are at the same position, but limiting them to a value of 255? Is there a renderstate that enables this effect in D3D, and what is its name? The effect you have under heroes in warcraft3, is this just a glowed sprite, or is it a whole other effect? Best regards, Perry Two atoms walk into a bar, the first one says: "Oh no, I have lost an electron!". The other one asks: "Are you shure?", and the first one replies: "I''m positive!"
Real programmers don't comment their code, it was hard to write, it should be hard to understand
malpass
malpass
ye, iv posted a topic on this too, i want to no how to do glowing effects, i c them in most games even simple, simple ones. Some people say its a particle engine but why would people go through all that trouble for small demo-like games, there must be a simpler way
Trienco
Trienco
youre not doing much yourself for that effect. set the right blend modes and your (for example) particles will automatically "add their rgb values" in the areas where they overlap.
f@dzhttp://festini.device-zero.de
S1CA
S1CA
"Is there a renderstate that enables this effect in D3D, and what is its name?"

The name of the technique is additive blending

It''s enabled the same way as alpha blending except with the blend factor render states set to D3DBLAH_ONE for SRC and D3DBLAH_ONE for the DEST (where "BLAH","SRC" and "DEST" are the proper state names that I forget at the moment )


--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
Qpeg
Qpeg
S1CA - thanks, this is just what I''m looking for. I''ll have another go at the docs, but if you or anyone else knows the exact renderstate, please enlighten us

Two atoms walk into a bar, the first one says: "Oh no, I have lost an electron!". The other one asks: "Are you shure?", and the first one replies: "I''m positive!"
Real programmers don't comment their code, it was hard to write, it should be hard to understand
flaXen
flaXen
Like Simon said, renderstates D3DRS_SRCBLEND and D3DRS_DESTBLEND should be set to D3DBLEND_ONE for an additive effect. Keep in mind that if you use an additive effect, be careful not to use really bright textures or they''ll quickly go nuke-bright.

D3DSetRS(D3DRS_SRCBLEND, D3DBLEND_ONE);
D3DSetRS(D3DRS_DESTBLEND, D3DBLEND_ONE);
Qpeg
Qpeg
Sweet!

Two atoms walk into a bar, the first one says: "Oh no, I have lost an electron!". The other one asks: "Are you shure?", and the first one replies: "I''m positive!"
Real programmers don't comment their code, it was hard to write, it should be hard to understand

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.