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 / Shadows ugly graphic effect

Author
Message
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 17th Nov 2013 12:48 Edited at: 17th Nov 2013 12:51
Hi all!
I feeling bad graphic effect while the light and shadows changing their position!

Please watch the vid:

http://www.youtube.com/watch?v=nF0jnx9ajRE&feature=youtu.be

You can notice the bad graphic effect on the grey building and the trees surfaces too.

Is there some way to avoid that ugly & weird graphic effect?
Thanks!
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 17th Nov 2013 17:49
I can't test this at the mo but would setting Normalization On help?

"Get in the Van!" - Van B
Broken_Code
14
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 17th Nov 2013 17:50
How are you making the shadows?
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 17th Nov 2013 19:51 Edited at: 17th Nov 2013 19:53
Here my outside main loop code to set the light and shadows!
I tried to use "set normalization on" command but nothing changing! :\

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Nov 2013 21:14
I would use 1 for the 'use shader' part of set shadow shading on, as that will do proper GPU shadows. Your version uses 0 which means the CPU is doing all the hard work, and in my experience does not work very well at all.

Boo!
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Nov 2013 21:58
The problem in the screenshot looks like Z-fighting (or similar) to me - it happens when the renderer isn't sure whether an object is lit or in its own shadow. It's purelt an arithmetic precision issue. The shader should have an adjustable constant to minimise that effect.

For example, the stencil shadow shader that comes with DBPro has the following lines:



You can adjust the "0.1"s up or down a bit to see what effect it has. However, I gather you are not using a shader if I've understood correctly - but I guess a similar issue arises except you have no control over that I guess. I have a feeling that built-in shader shadows are broken in U77 (or is that just with fog?).



Powered by Free Banners
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 17th Nov 2013 23:53 Edited at: 18th Nov 2013 01:32
So, I am using :

set shadow shading on a,-1,100,1

Where the last number (1) mean shader ON! I am using GPU shader!

@Green Gandalf where I need to use your code?





EDIT:
@Green Gandalf ok mate I modified the stencilshadow.fx file, the part you show in your post and I notice a BIG improvement!
Here the changes!:



Thank you Green Gandalf and thx to you all guys!
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Nov 2013 18:08
Quote: "However, I gather you are not using a shader if I've understood correctly"


Quote: "I am using GPU shader!"


So you are. I didn't notice that the last bit of each line had been commented out.

Quote: "ok mate I modified the stencilshadow.fx file, the part you show in your post and I notice a BIG improvement!"


Glad it worked despite my clumsy comments.



Powered by Free Banners
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 28th Nov 2013 12:17
Really thank you Green Gandalf! Your help it's always a prime help!
And your alien icon with his flashing eyes is like a drug for me!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Nov 2013 22:19
Yeah, sorry about the confusion about the GPU shader flag, like Green Gandalf I completely missed the fact you had rem'd out the end of each line, even though it's quite obvious in the code!

Boo!
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 28th Nov 2013 22:25
Quote: "even though it's quite obvious in the code!"


Embarrassingly true.



Powered by Free Banners
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 29th Nov 2013 09:17 Edited at: 29th Nov 2013 09:18
Guys, the fault is mine about GPU shader flag.
In first (after years of DBPro forum) I can not color the code (like in my IDE) and I should to delete my remarks too when I put here my pieces of code!..

Login to post a reply

Server time is: 2025-05-17 13:34:01
Your offset time is: 2025-05-17 13:34:01