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 Professional Discussion / My point light (bare light-bulb) light shines on surrounding objects, but does not shine on the plain in the background. How can I make it shine on the plain in the back-ground?

Author
Message
Mark Garrett
Reviewed AGK on Steam
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 11th Dec 2015 18:31 Edited at: 12th Dec 2015 23:44



.
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 12th Dec 2015 11:08
Point 1 : the orbiting objects connected to the light ( the lights in general, actually ) must be above the plane ( the map ).
Point 2 : Light works by vertex lighting , a single polygon (4 vertices, one at each corner ) cannot get the effect properly. You must use a multi vertices object.

Try the example attached uses an .x object with many vertices as map

Cheers

Attachments

Login to view attachments
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 12th Dec 2015 16:27 Edited at: 12th Dec 2015 16:29
Well, this post has pretty much been answered. There is something I have been curious about for a long time. What benefit is there to using this code:



opposed to this code?:



The internal code for the DBPro functions Desktop Width() and Desktop Height() are identical to the first snippet.



SM_CXSCREEN and SM_CYSCREEN are defined as 0 and 1 respectively. Seems like it's just reinventing the wheel.
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 12th Dec 2015 19:27
The first snippet will work with any DBP version (updates) and Windows version
The second doesn't on any DBP update/Windows version.
Actually the second doesn't on my system - update 67 - Win 8.1
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 12th Dec 2015 19:46 Edited at: 12th Dec 2015 19:48
Thanks, Scorpyo. The second snippet works just the same on DBPro V7.4 with any compatible Windows version. May I ask, why are you using such on old version of DBPro?
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 12th Dec 2015 20:32
Well, I have long time personal projects going on ( I don't plan to release anything ever , It's just a hobby ) and I don't want to go through the hassle of readjusting the code that breaks after every upgrade.
Mark Garrett
Reviewed AGK on Steam
18
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 13th Dec 2015 01:05
Thankyou, but how would I texture the 'map' with this bitmap? I textured it, but the map turned totally black... (Final draft.bmp)
.

Attachments

Login to view attachments
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 13th Dec 2015 02:14
@Scorpyo Got Ya! Thanks for clearing that up for me.
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 14th Dec 2015 00:49
Here I made an example with a textured .x object map with your picture
I also textured the spheres grabbing color images from screen colors (backdrop). Better than using the color command itself that gets lost in many light situations.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-20 02:38:18
Your offset time is: 2024-04-20 02:38:18