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 / Fog overrides set global shadow color

Author
Message
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 3rd Sep 2011 00:43 Edited at: 5th Sep 2011 08:05
Please read this whole page ( only 1 so far ) before asking any questions. Some have a bad habbit of asking questions that have already been answered. Thank you.

Am I seeing this as a bug in DBP ?

I turn fog off, and the set global shadow color works fine. But the moment I turn on fog, it overrides the color of set global shadow color. I need BOTH the fog and set global shadow color. But is it a bug that Fog will override set global shadow color ? Will it ever get fixed ?

I have been searching all day for this answer. And no one has an answer without them saying "There is a shader somewhere you have to use". This should not be the answer if you have actual specific commands that can do this. You should be able to run the FOG and the set global shadow color at the same time without one effecting the other.

So will this bug get fixed ? Is there something else I am missing I should know about ?

Sorry for my brash comments here, it just doesn't make sense to me and the answers that people are getting to this question are not logical, but random guessing because no one has a true answer without saying, there is a shader somewhere....

Here is an example of what I mean :


Now this is with the set global shadow color set to red. BUT, when I turn fog on and its a different color, the set global shadow color gets overridden with the Fog color instead.

Here is an example with the Fog Color overriding it :



The reason I want the fog is because of the effect it does at far out ranges. I don't want it effecting the shadows up close. I tried setting fog range < near range > , < far range > but that doesn't change anything related to the shadows.

EDIT : I forgot to also mention its overriding this command : SET SHADOW SHADING ON Object Number, Mesh Number, Shadow Range, Use Shader. And in all fairness, I did try to use the default "load effect "FX\stencilshadow.fx",1,1" and it still gets overriden.

"Son, I crap bigger then you !"

Attachments

Login to view attachments
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 3rd Sep 2011 02:09
Try this:

set global shadow color 20, 20, 20, 100

Set the colour as red,green,blue,alpha.

Health, Ammo, and bacon and eggs!
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 3rd Sep 2011 02:12 Edited at: 3rd Sep 2011 02:14
Thanks for the response.
Hey Van B. Yes I have set that. And the Fog Still overrides it.

set global shadows on : set global shadow shades 1 : set global shadow color 0,0,0,64
set shadow light 0,500,40,510,100 : set shadow position 0,500,40,510

set normalization on
set shadow shading on 1
set shadow shading on 2
set object light 3, 1

I have attached my source code to this post if that helps.

"Son, I crap bigger then you !"

Attachments

Login to view attachments
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 3rd Sep 2011 14:43
Ahh, sorry, was late when I posted that. Not sure what the problem is :/ - setting the shadow colour used to work.

Health, Ammo, and bacon and eggs!
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 3rd Sep 2011 17:39 Edited at: 5th Sep 2011 08:08
Ahh. Hmm.. well I posted my code, could you take a look and see if I am just a dummy and put something in the wrong order ? Basically could you double check my work. Might be something as simple as that. At least I hope its my error. If its a bug in the program, then would you know of when this could get fixed ?

Either way, I appreciate the help Van B, or to anyone else who would know a way to solve this, in case its not a bug.

"Son, I crap bigger then you !"
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Sep 2011 02:53
It probably is a bug. Here's what the Help files say about the gamefx commands:

Quote: "This group of commands is an extension of the Basic3D command set, and includes previously undocumented commands used for the creation of more advanced techniques. Some of these techniques are experimental and as such are not as well-rounded as the more traditional commands found in Basic3D."


Do you need those commands for the effect you want? There was a recent fix to the main Basic3D commands concerning fog and shadows. Perhaps those are what you need?
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 6th Sep 2011 04:09
Please, I would love to see what you have. So since this is a bug, your saying there is a work around that doesn't involve a plugin or shader FX file ?

"Life is like a box of chocolates.. eat it before it melts."
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Sep 2011 14:05
Quote: "Please, I would love to see what you have. So since this is a bug, your saying there is a work around that doesn't involve a plugin or shader FX file ?"


I've just done some testing and it seems that some recent updates have completely messed up the shadow shading commands. I thought the fog+shadow colour bug had been fixed but it seems that someone sitting in my chair posted a bug report about this in connection with U77RC6.

The latest release candidate (RC7) has made matters worse by completely breaking the shadow shading command when the shader option is used.

At the moment I can't see a workaround (without using a shader) - unless fog and shadows worked together in an earlier update. There are rather a lot of updates to test unfortunately.

Sorry my earlier suggestion was misleading.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Sep 2011 14:11
It was a while ago that I used the global shadow colour and it worked, maybe just when the gamefx stuff got 'documented' (unofficially).

I had this problem when I wanted to use fog as a highlighter for some dice - like click on a dice, then it glows red with fog, but I couldn't get it to work with shadows. It's a shame, because the red fog highlight on those red Vegas dice looked really cool. Maybe if the shadow is a shader, like if it's supplied with DBPro, you could hack it to use a set colour, rather than the fog colour variable. I will investigate tonight, but I've got a feeling I tried this before and didn't get very far.

Health, Ammo, and bacon and eggs!
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 6th Sep 2011 15:56 Edited at: 6th Sep 2011 15:56
I appreciate the effort guys. I really do. I am just not good with shaders. I been trying to get a grip or handle on this. But my brain is just not wrapping around it for some reason. I know I eventually WILL have to learn it. But its frustrating to be forced to learn it.

I am patient though. I can wait for the next update if it can get fixed. So I will put a halt on my program for a while and just wait this out to see what comes of the next update.

Again, thanks for the help guys. It means a lot.

"Life is like a box of chocolates.. eat it before it melts."
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 6th Sep 2011 16:35 Edited at: 6th Sep 2011 16:37
Ready made shaders aren't hard to use. There are a lot on the site. I saw a fog one last week somewhere. Well actually it was a haze sort of effect. Anyway it was like yours. I think I was searching for landscapes at the time.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Sep 2011 17:54 Edited at: 6th Sep 2011 18:11
Here's a simple demo of fog and shadows posted by Mr Bigger some time back. According to his comment it should work with upgrade U7.5 so it might be worth trying that version in the meantime.



Edit Just tested your demo using U75 and it seems to work:

Attachments

Login to view attachments
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 6th Sep 2011 18:37 Edited at: 7th Sep 2011 04:39
DUDE !!!! OMG.. Thats AWESOME !!! Oh heck, I am sooooo downgrading a bit.. hahahaha

THANK YOU THANK YOU THANK YOU !!!!

EDIT : Checked this out with version 7.61 and it works. 7.5 did not work for me. But at least 7.61 did. Here is a picture so you can see the version.



I moved from 7.7 back to 7.61. So until the bug gets fixed, if you want my code to work properly, you have to use the version I am using to compile it.

To get the latest code, please go here...

http://forum.thegamecreators.com/?m=forum_view&t=188775&b=1&p=0

"Life is like a box of chocolates.. eat it before it melts."

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-26 12:05:06
Your offset time is: 2024-04-26 12:05:06