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 / DBP Shadows wrong??

Author
Message
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 14th Mar 2003 20:30
Is it me or are the shadows in DBP completely wrong at times.

I have an object, with the only light source in the world being in front, and slightly above the object. Ambient light is set to zero and the default light, 0 is hidden.

What should happen therefore, is a shadow behind the object (ie. the opposite side of the object from the light source).

What actually happens is that the shadow appears ON THE SAME SIDE OF THE OBJECT as the light source - which is completely wrong surely! Shadows also appear even if there are no light sources other than ambient light.

I have tried many different settings but it always seems to be that the shadows are treated as if there is only one light source in the world at the 0,0,0 position.

Is it me, or is this another SERIOUSLY half-assed feature?
Current Project: Retro Compo. Entry.
Kanzure
22
Years of Service
User Offline
Joined: 19th Feb 2003
Location:
Posted: 14th Mar 2003 20:32
I believe theres no real shadows feature. That would take up huge ammounts of proccesing power.

~Morph
Owner of MultiCode.NET and Multi2k.NET.
Nothing is something, and something is then nothing. Life is an illusion.
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 14th Mar 2003 22:05
It can certainly be done though. I wouldn't mind if the shadows were cast using just one light source or all from one point - as long as I can set the light source which casts the shadow. This is certainly possible to do. Even if DBP had to precalculate the shadow that would be fine as well. But currently the feature is unusable.

Current Project: Retro Compo. Entry.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 15th Mar 2003 02:01
There is a Stencil Shadow Feature on the way ...

along with updated
Pixel/Vertex/Time/Light Shaders (upto version 2.2 & OpenGL)
Mesh LOD
Anti-Aliasing
Anistophic Filtering
Texel Manipulation/Shaders
Stencil Functions
Shader Memblocks (memory blocks which contrain shader data for manipulation in realtime)
Projected Textures

but its not likely to be ready for a while, probably atleast a month for most features (cause i've been waiting on the new TPF SDK) - so for now any real features you wanna use you'll have to code yourself - some clevel memblock manipulation can oftenly do alot of what you want.

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 15th Mar 2003 02:04
No worries folks,

shadows do work but the following must be noted:

- ONLY light 0 is considered when DBP works out how to project the shadows

- Light 0 must be set to a point light.

Do these two things and it works great

Lee also said that he will look into shadow alpha and shadow edge blur in future

Current Project: Retro Compo. Entry.
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 15th Mar 2003 02:07
Actually having seen many commercial engines and how badly they fair with shadows, DBPs admittedly slightly cheap hack does work pretty well, as long as you don't use a complicated object.

A useful feature here though is that shadows are still cast even if the object is hidden (using HIDE OBJECT), this means that you can place a simplified, hidden version of your model in the same place as the actual one that the user sees - and you get a good looking shadow effect without much speed or quality loss.

Current Project: Retro Compo. Entry.
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 15th Mar 2003 02:40
Anti-Aliasing
Anistophic Filtering
Texel Manipulation/Shaders


GOODNESS!!!


Toughest line of codecol$=asc(left(Pcol$)),1+str$(rev)+chr(80)+left(right(mid(name$),1),1)
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 15th Mar 2003 06:28
well there's so many techniques for producing shadows...
for DB i used the N64 Zelda technique, where the shadow is basically a plain attached to the boots and cirles and resizes based on the light's position - multiple lights could be faked with more than one, and density faked with a memblock resaving the lumination of the texture

worked oki, but the zbuffer in DB certainly isn't something of any greatness unfortunately.
i mean with my hacks are BSP what i did was used a texture projection routine to project a lightmap (pre-compiled) onto the texture of the world and then map.

just a matter of 2memblocks and an array, bing bang whollop you have some nice shadows.

for a more realistic person shadow it'd take 360 frames from all around the model from the side to side (precalc again) using that alpha map, then scale it based on the camera's position using the right frame for the lights position nicely faked - but works well

and its only like 1bit per pixel because its either black or white and let the engine determin how much is in ther based on the intensity and distance of the light.

i mean its more work than just
'set shading on [object]' but it is more satifying, will work with more graphics cards and i dunno i just like it cause i thought of it

but i mean there are many ways to cop out shadows and how detailed you want them depends on if you should

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 15th Mar 2003 12:59
I couldn't use a simple textured plain because some of my surfaces are not flat, ie. round, and then a plain shadow just looks cheap. Now I figured out how to work it, the shadows work well enough. My ship model is only 146 polys so shadows on it are very fast.

Current Project: Retro Compo. Entry.

Login to post a reply

Server time is: 2025-05-18 20:27:04
Your offset time is: 2025-05-18 20:27:04