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 / Glass affect

Author
Message
TibFarmer
22
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 26th May 2003 20:49
How do i make a glass affect on objects like transparent?
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 26th May 2003 20:59
try this:
GHOST OBJECT ON objectnr

it's the only possibility to make something transparent in DBC

you can try different object colors until it gives a good result

[href]www.bernardfrancois.com[/href]
Dr DooMer
22
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 26th May 2003 21:57
Ghosting uses positive alphablending for it's translucency.

That means, no matter what colour your ghosted object is, it will always appear brighter than everything behind it. It also means that a white object will be completely opaque, black will be completely see-through and different greys will have different levels of translucency. For example, 25% grey will appear 25% see-through.

For a good, clean glass texture, I'd advise quite a dark grey, or perhaps a dark blue.

"I am a living, thinking entity who was created in the sea of information."
Algae Man
22
Years of Service
User Offline
Joined: 11th Nov 2002
Location: Canada
Posted: 29th May 2003 03:11 Edited at: 29th May 2003 03:12
Use dark ghosting. To me, it looks more like glass because instead of adding the colour values, it subtracts them. To use dark ghosting, set the darkghosting flag to one in the command "Ghost object on"

Example:

Ghost object on (object number),1

Hope this helps.

optical r
22
Years of Service
User Offline
Joined: 23rd Oct 2002
Location: Prime
Posted: 29th May 2003 13:04
No, i know a good method...

Load 2 of the same objects (the objects to look like glass, of course), eg.



so now you have 2 of the same objects loaded into memory. Scale both object making the SECOND (for simplicity's sake) slightly larger (about 5-10 units larger), so



Then, texture the SECOND object using this image:



Ghost the SECOND object and position BOTH objects in the SAME place. Then add the following code to make the glass look 'real' IN THE MAIN LOOP of your program:



If it works (it will then it should look like this

freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 29th May 2003 14:35
about 5-10 units larger
you mean 5-10 pct, not units... not?

I cant see the pictures you added... I'd really like to see them I have no time now so if I can see it gives a nice result I might use that technique too

[href]www.bernardfrancois.com[/href]

Login to post a reply

Server time is: 2025-05-18 05:50:13
Your offset time is: 2025-05-18 05:50:13