Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / nice transparency effect

Author
Message
Silverman
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 13th Nov 2011 12:58
Hi,
I do not know if anyone has made ​​this in DBC, so I share my code.


have fun!

DirectX 9.0c (February 2010)/ DBClassic v1.13
Fluffy Rabbit
User Banned
Posted: 16th Nov 2011 02:53
Would you care to explain what this does so as to spark interest in the community?
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Nov 2011 06:05
This allows for all kinds of interesting layering effects including lightmapping. In the example Silverman posted you can see that the red maintains it's color while being transparent unlike the pinkish color it becomes when it'solely ghosted.

There's all sorts of uses for this. In more robust engines, this kind of layering is done behind the scenes and then rendered all at once. Since you can't quite do that in DBC, you can cheat and achieve the effects using this method.

Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 20th Nov 2011 01:56
@Latch- That sounds amazing.

Is there anything one should keep in mind with regards to textures? Would it be possible to use some sort of alpha map?
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Nov 2011 03:06
Quote: "Is there anything one should keep in mind with regards to textures? "

Yes. When an object is dark ghosted (inverse alpha), the closer to black the color, the less transparent it is. The closer to white, the more transparent. Regular ghosting is the opposite. So when the two are combined as overlayed objects, the dark ghosted object can act as a filter to allow or disallow transparent areas of the regular ghosted object to show through.

Quote: "Would it be possible to use some sort of alpha map? "

Yes. You'd texture the dark ghosted object so that it can be used to affect alpha. The textured dark ghosted object in effect would be the alpha map to a regular ghosted object.

Using lighting and fade object, you can control the depth of the transparency and overall brightness of the object(s). So, it is possible to completely control alpha in 3d for DBC.

Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 26th Nov 2011 22:01
Quote: "
the dark ghosted object can act as a filter to allow or disallow transparent areas of the regular ghosted object to show through.

The textured dark ghosted object in effect would be the alpha map to a regular ghosted object."


Thanks.

Login to post a reply

Server time is: 2024-04-23 19:58:58
Your offset time is: 2024-04-23 19:58:58