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.

Dark GDK / dbSetShadowShadingOn: My shadows become solid!

Author
Message
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 3rd Mar 2007 17:32 Edited at: 3rd Mar 2007 17:33
Hi,

I'm using DGDK (100207), the shadows work fine at some places of my scenary and they become solid at other places:



The only difference between the locations where they appear right and wrong respectively, is the object's numbers, I can't think of much more. But the object casting the shadow is the same in both cases.

Besides, I don't know how to make the shadows solid purposely. I do not use fog, I have particles, ghosted objects, cloned objects, sprites...Could it be that I'm using a reserved object number or something like that?

Although the DGDK's shadows are familiar to me with their DBPro 5.7 behaviour, I have managed to show them right for Saturn and its rings (above), but now I have this extra issue.

Does anyone has a clue or has seen this before?
Thanks in advance.

Attachments

Login to view attachments
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 3rd Mar 2007 18:49
Only object number I am aware of that causes problems is 0.
Don't start your object collection at 0, that one seems to be reserved.
Leave it an empty object and start your actual objects at 1.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 3rd Mar 2007 20:41
Yes, that's right. My lowest object Id is 1 (but I have some objects with high Id>100,000).
I guess it could be some interaction with other command...Perhaps an issue of the engine itself? But I don't know how to reproduce or workaround this, since I don't know the reason.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 5th Mar 2007 12:25
I know the stencil shadows make at least two rendering passes, one for calculating the shadow voulme, and another for applying the stencil buffer.

It looks like the 'Set shadow shading on" only makes one-pass, so the shadow voulme can be seen, and no stencil buffer is applied.

However, they work fine at some places of the scenery, that's odd.

Also, I forgot to put some emoticons showing how I feel
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 12th Mar 2007 12:32 Edited at: 21st Mar 2007 13:04
Ok, this is what I did:

- Comment large blocks of code, until the solid shadows disappeared

- Shorten the commented blocks of code until the problematic code was isolated

- I finally found the single line that was causing the problem, and believe it or not it was:

dbHideObject(ObjNum);

So I changed it for :

dbPositionObject(ObjNum, 100000, 100000, 100000);

And the shadows work fine!

Now this has been totally empirical, I cannot imagine any relationship between dbSetShadowShadingOn and dbHideObject. This reveals some weakness of the shadow system, which, in fact, is no new at all.

Besides, this cannot be reproduced alone in a example code, or at least I haven't been able.
Uh, I lost more than two weeks hunting down this issue. A total undesirable luxury.

[EDIT] One additional comment: I've tested this with an ATI Radeon 9700pro, and with a NVIDIA Geforce 8800gts, and the behaviour was the same, so this is not a hardware/drivers issue.

Login to post a reply

Server time is: 2024-11-19 12:42:39
Your offset time is: 2024-11-19 12:42:39