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 / Interesting Advanced Lighting Shadow Issue

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 25th May 2012 15:57 Edited at: 25th May 2012 15:58
Hi all,

There's a strange happening going on with my shadows using Evolved Software's advanced lighting system. Inside the shadows, there seems to be this grid of squares of light that flash on and off, even when there is no camera movement. The oddest part is that this grid seems to move WITH the player, but the main light source in the game is static... Here's a video of it happening so you can see what I mean. Anyone know what might be causing that or how to fix it?




basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 25th May 2012 17:18
I know what's causing that, the project looks so amazing that advanced lighting want to shine through every square and window.

how do you create your graphics

MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th May 2012 03:14
basjak - I think you mean environment

yeah my question exactly...

CumQuaT - Just out of curiosity, have you got any objects centred at the players position?

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 26th May 2012 04:31
@Basjack - lol that makes us feel good!

@MrValentine - Nothing at all. Just a camera


MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th May 2012 05:02
have you tried using another lighting shader? should try comparing so alienate other remedies... or whatever you know what I mean

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 26th May 2012 07:40
Not a bad idea... Might give that a go.

In the meantime, any other ideas are still welcome!


Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 26th May 2012 12:49 Edited at: 26th May 2012 12:50
You had solid shadow squares in the light too. That's interesting. Have you tried pasting your shadow camera image to the screen to see if you can see those blemishes in it? Then you can start to narrow down whether it's the shadow depth texture, how it's read, or something else.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 26th May 2012 13:02 Edited at: 26th May 2012 13:03
It looks like there is a layer with the shadow, and a layer with a mask that alphas the shadow. The mask layer appears to have alpha defects. That's what it looks like, but isn't necessarily what is happening. The defects could be coming from something transparent in the way of the camera, like clouds for example.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 26th May 2012 15:56
I'm actually trying to work out HOW to view the individual camera outputs to analyze the shadows... I've tried setting the current camera and also setting the camera to an image and displaying it on the screen, but can't seem to get the output. Any suggestions?


Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 26th May 2012 16:00
Is it a standard image or a cube map? I'm not sure which advanced lighting approach you're using. I'm not sure how you'd go about pasting a cube map image to the screen. If you can render it to an image, perhaps you can save it as a DDS image (not sure if DBP will allow that, but worth a try), then perhaps open it in an external program.

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 26th May 2012 16:06
It's up in the original post. I'm using the Evolved Software Advanced Lighting system. I'm not actually sure if it uses a cubemap system....... I might look into it further... It's really quite a strange issue...


Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 26th May 2012 18:02
What I think you should do is check if there are clouds in the way of the light, and lower the light.

revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 27th May 2012 03:51
Quote: "The oddest part is that this grid seems to move WITH the player, but the main light source in the game is static..."
That is because AL's directional light is repositioned relative to you as you move around, which tells me that the problem is with the directional light itself (but not exactly sure what).

Quote: "I'm not actually sure if it uses a cubemap system"
Nope, in AL only point lights use cubemaps to render the shadowmaps.

If I had to guess I'd say MrValentine is onto something, the only times I've seen AL act in this way is when there are objects being rendered by the directional light camera which arent supposed to be.

Try using paste image AdvancedLightingImage(6),0,0, using a shadowmap resolution which is smaller than your screen's resolution (so you can see the whole image). The result should look rather strange, but you should be able to see the offending objects if that is indeed the source of the problem.

I could also see problems arising if your buildings were taller than the directional light's range, does the problem persist when those buildings are 1/10th the size?
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th May 2012 07:07
Hi revenant. Back to save me again?

The problem even happens when the buildings aren't THERE! But then again the town walls might be too high, as you said.

I put up the image of AdvancedLightingImage(6) like you said, and it looks like the squares are coming from something above the buildings.

Like Pincho said, it could be clouds, but this happens even when I turn the clouds and sky off...


revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 27th May 2012 08:11 Edited at: 27th May 2012 08:18
If those squares are objects, then it also appears that they have a shader using a shadowmap depth technique or I would expect them to be other colors.

Do any of the objects in your scene have their Z-Depth/Read disabled? If you do, then they may be underground objects which are still rendering on top of the scene. They appear to be pains (planes lol), you could search your source for any reference to the word and hopefully track down the problem.

You say the problem happens when the buildings aren't present so that rules them out, but you must ask yourself: What IS there when the buildings aren't.. this is only a guess but do you have any other systems running like particles/grass etc? Also keep in mind that any objects which you haven't applied a camera mask too can potentially be rendered to the shadow cameras.

Really the best I can suggest is to try not setting up the advanced lighting system at all, and see if you can spot any offending objects when you don't have the added complication. (That is of course, working under the assumption that those are objects that i'm looking at in the render)
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th May 2012 10:49
Yes! Revenant! You got it!

There were some objects that had not been added to the advanced lighting.

Odd thing was though that they WEREN'T in the way of the light O_o

In the video, can you see the green squares that identify doorways? It was those objects.

So strange! But problem is solved! Thank you so much for the help everyone!


Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 27th May 2012 23:43
This is a little random and off topic, but... Your town scene reminds me of an old NES game called Dungeon Magic. Great game. Yours looks cool also. Very nice. Glad you got your error fixed.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th May 2012 05:26
Yes! Dungeon Magic was epic! Malevolence is actually aiming to recreate that very genre of game!


Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 28th May 2012 05:59
Yeah. I looked at your WIP thread for Malevolence. I was looking at your game way back in it's earliest stages! Nice to see it still in motion. Good job!

And, finally, I find someone else who also has played Dungeon Magic!

-Amo.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th May 2012 08:54
I actually knew it as Light Bringer! I had the Japanese version that a friend brought back for me from Japan


baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th May 2012 17:36
I see you've solved the issue and it wasn't caused by the player being a disco ball as I first thought. Well done

Looking forward to playing this

CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 29th May 2012 03:11
Player as a disco ball! Why didn't I think of that???

heehee, thanks!


Login to post a reply

Server time is: 2026-07-08 05:38:17
Your offset time is: 2026-07-08 05:38:17