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.

AppGameKit Classic Chat / What is the default SunDirection?

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Dec 2018 06:10
We can change the sun direction via the setsundirection() command, but I am curious, what is the default?

Thanks!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2018 06:49 Edited at: 17th Dec 2018 06:49
I imagine it is (0, -1, 0)
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Dec 2018 07:29
Hmm, I don' think that is the default. The lights and shadows change with that.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Dec 2018 10:49 Edited at: 17th Dec 2018 10:50
Testing it it looks like (-1, -1, -1)

Attachments

Login to view attachments
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Dec 2018 16:23
Thanks, blink0K!
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 17th Dec 2018 18:51
There really should be get commands for each of these set commands...
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 17th Dec 2018 18:57 Edited at: 17th Dec 2018 19:22
I think it is:
SunDirection(-0.3714, -0.7428, 0.5571)

Just extracted some default values from the source code
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Dec 2018 22:08
Thanks, Janbo.

I assume this matches the lightVarying variable in the vertex shader?
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 18th Dec 2018 17:03 Edited at: 18th Dec 2018 17:04
lightVarying should be the vec3 which indicates the RGB color value of the Vertex lights.
For pixel lighting use the GetPSLighting command.

The Sun Light uniforms are agk_DLightDir and agk_DLightColor but you can't access them as they are inserted at runtime, so it will crash if you try to declare these uniforms but it'll also crash if you try to use but don't declare them, obviously.
So best bet is to create them yourself but then you need to make custom light calculations and then fit everything to AGK's other shading.
I faced this problem in my shader pack too.

What are you trying ?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Dec 2018 19:12 Edited at: 18th Dec 2018 19:14
*edit*
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 18th Dec 2018 20:55 Edited at: 18th Dec 2018 21:04
Janbo,

I have a few problems.

1) The "light" is too dark on surfaces facing away from the light source(for instance a cliff). So my normal map is having zero impact, and the scene looks way too flat. I want to set a minimum light value. I guess, I could use a clamp value on the light function. But then this would impact the shadows.

2) My normalmap/parallax code needs a LightPOS vector and so far I have just been using my own value, but it hasn't been lining up with the AppGameKit shadows.

3) I want to create my own shadows because AGKs are unpredictable and subpar. I am using your older project to help me with this.

Good Lighting:


Terrible Lighting

Attachments

Login to view attachments
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 19th Dec 2018 11:20 Edited at: 19th Dec 2018 11:21
@Golelorn:
1. I guess thats what ambient color is for
2. What do you mean with lining up ?
If you calculate the faloff like agk does and position your lights the same it should work.
3. Sure, I'm happy you like it, but where is the problem ?
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 19th Dec 2018 18:31
1) I'll have to play with the ambient color some more. But, my first time, I wasn't successful. I just made things really, really bright or dark. I'll play with it some more, though.

2) This may have been a problem I made up in my head(overthinking/didn't understand). If that makes sense.

3) Using AppGameKit shadows during sunset and sunrise the shadows stretch across the entire landscape. And if I am in a "valley" the shadows bug out. Keep in mind I am using mode 2, since mode 3 uses up 4 texture slots.

Thanks!

Login to post a reply

Server time is: 2024-04-25 06:49:28
Your offset time is: 2024-04-25 06:49:28