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.

3 Dimensional Chat / DBPro Glow effects! - highlights like 'bright light haze' in darkness

Author
Message
Redmotion
22
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 18th Jul 2003 16:35
How do you get glowing effects in 3d? I can think of 2 ways:

1. Bitmaps placed in 2d with transparency/ghosting which appear when necessary and shrink and expand relative to the distance to dummy objects in 3d space. Drawbacks:
* complicated to code if no specific command to covert 3d position in space to 2d position on screen. Is there one or a combination of?
* is it slower? (2d+3d) - and might interfere with HUD display? Obscure readouts (although this quite easy to solve - although, the less work the better! )

2. Or 3d faces mapped with ghosted glow placed into the model that use SET CAMERA TO OBJECT ORIENTATION command but remain in their correct position. (does this command just rotate objects or move them also? - I'm at work and I can't check until Wednesday next week...)
drawback: glow on faces will either disappear inside other objects nearby (when they rotate too far) or remain even when 'source' is obscured.

Are there any other ways? Has anyone managed to do convincing lens flare and glow effects?
PROJECTS:
Cyberbowl (70% done)
Something a bit bigger(understatement of the year) st art/concept/design doc stage
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 18th Jul 2003 17:42
Here's an answer straight from Lee (in Newsletter Issue 6):

Quote: "Making an Object appear as a Light Source
"My question is, how do you make an object appear as a light source, for making a 3D Sun in a solar system for example. I wish the whole object to glow, and have not been able to create the desired effect using point lights."

Lee Bamber replies: "The trick here is the light is placed between the object and the camera allowing the glow effect to work. When we release DarkBASIC Professional Upgrade 5 you will also be able to apply an FX effect that simply glows the object in a more visually stunning manner! In the meantime here is some code for you:"

"


"Computers are useless they can only give you answers."
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Jul 2003 17:52
Well, firstly you can get the 2D screen position of an object by using OBJECT SCREEN X() and Y() - most people would have a dummy object that is hidden, and positioned at specied positions or on limb positions before grabbing the screen location. It would work with sprites for example, you could position a sprite at the right place.

The old rotating plain trick is traditional and still heavily used, in fact I can't think of a better way to handle flares etc. One thing you can do is disable the object zdepth, DISABLE OBJECT ZDEPTH Objectno will make the object appear in front of all the other objects, so it would stop the glow from disapearing inside polygons (which ruins a lot of the effect) - but you have to come up with some sort of check to see if you should show the glow.

An idea:

Say had a light and the light position was marked by a limb pivot point, allowing you to grab the exact light location by simply using the LIMB POSITION X() etc commands. Now if your light was textured with a nice bright whitish yellow, you could calculate the screen position of the light source and check the colour of the pixel. If the pixel is very bright, show the light, otherwise hide it. The traditional method would be to use a line of sight system which involves collision, and would need a pretty good system to allow that sort of accuracy.


Van-B

My cats breath smells of cat food.
Redmotion
22
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 23rd Jul 2003 13:35
Fantastic! Cheers guys!

PROJECTS:
Cyberbowl (70% done)
Something a bit bigger(understatement of the year) st art/concept/design doc stage

Login to post a reply

Server time is: 2025-05-11 15:00:06
Your offset time is: 2025-05-11 15:00:06