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.

Author
Message
Clacker
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 16th Mar 2003 12:57
what I have is a samll test map for my game that I made in a animation program. Now what i am wanting to do is have it so when a light shines on a object in this map it casts a shadow on the ground. This is proberly not posible seeing that it is all counted as the one object but i was just making sure. I know i can use cshop and all that but i am just seeing wether it is posible in dark basic.
John H
Retired Moderator
23
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 17th Mar 2003 00:09
http://www.darkbasic.net has a tutorial on shadows

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Clacker
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 17th Mar 2003 05:45
Thanks but these tutorials seam to be for shading matrixes. But mabye the same princibel will apply for models I am not a good programer so i cant see my self working it out so dose anyone have any other code snipets or stuff like that for applying shadows to objects.
John H
Retired Moderator
23
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 17th Mar 2003 22:34
Well, I dont really believe in giving code, but instead, I can tell you how to make fake shadows.

Load two of your object, and squish one down so its nice and flat. Position this squished object on the oposite side of where your sun is casting the shadow from the object, and at the right angle.

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
freak
23
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 18th Mar 2003 02:42
I don't think this is a very good solution
- it would be tooo slow (as much as polys as your player object, while it could be possible with less)
- it only works when the shadow has to be casted on a flat surface
- you can't make your shadow transparent (ghosting won't give good results I think)
- if your shadow falls (partially or not) on a vertical or non-horizontal surface, it won't be shown completely

lol I'm critisizing but it was a good try you did... I don't know a better way

or maybe I do

you could create a shadow mesh in real-time (isn't there a command to make polygons?)
you can calculate some points of the edge of your shadow by intersecting a line (connecting the sun and a point of your player object) with the ground
then you'll have less polys and it should be able to make a non-flat shadow

I don't know if this would be fast or not, but it seems to be quite complex... and the transparency problem isn't solved then

in most games, a shadow is just a round spot on the ground (e.g. GTA3), but other games (like RUNE) have very nice shadows (for example when you hold a torch, the shadow moves with the flickering of the fire, and it's a very detailed shadow)
Clacker
23
Years of Service
User Offline
Joined: 8th Nov 2002
Location:
Posted: 18th Mar 2003 03:16
Complex shadows on characters in games is done by raping a texture around the models or somthing like that then projecting it onto the floor.

Anyway i am looking more for the effect of cshop. I need to shadows for a map not a character. BSP tree lighing and stuff.
John H
Retired Moderator
23
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 18th Mar 2003 23:07
OK then, you could do it another way.

Make another (small) matrix, and texture it with the black image of your character. Then, have the matrix move with your character, then you can just append that matrix to the conture of the other matrix (raising and lowering points)

There are many ways to do this, you just need to pick one that suits you. This is a good way, just it is a little tough coding sometimes

RPGamer

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!

Login to post a reply

Server time is: 2026-06-11 17:31:21
Your offset time is: 2026-06-11 17:31:21