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.

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 3rd Feb 2019 20:26
ive tried using the built in shadow commands using the tutorial provided and it failed to produce any shadows on my model. i also tried using a shader i found. it produced some dark artifacts in random location but not even close to useable. is there a way i can perhaps draw a dark spot on my models texture based on a xyz source or something. im completely lost. proper lighting and shadowing kept me from ever producing a game and dark basic as well. does anyone know of a shader that exists on this free that works in agk?
A child's dream never dies.





Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 3rd Feb 2019 20:49 Edited at: 3rd Feb 2019 20:50
Does your model have its own shader? If so, be sure to include these:



I think these needs to be on all models casting and receiving shadows. Don't forget the ground needs this, as well.

Have you set your object to cast and receive shadows, as well as the ground? I can't remember if those are both default to on.

You may also need to adjust the shadowrange via setshadowrange.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Feb 2019 20:53 Edited at: 3rd Feb 2019 21:28
use this for the objects you want to cast shadow
SetObjectCastShadow ( objID, 1 )
use this command for objects you want to receive shadow
SetObjectReceiveShadow ( objID, 1 )

and if you are using this command set texStage to 0, not 1 as 1 will give it full brightness by default
SetObjectImage( objID, imageID, texStage )


here is an example of a block rotating around with a plane object for grass

fubar
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 4th Feb 2019 01:59
i was able to get it to work seems it only works from the sun light source only able to be directed and not positioned. i need only a point light to cast shadows. sun shadows can be faked in a texture bake easy enough if they dont move but my game has a light that moves with the player underground. so sun shadows do very little good.
A child's dream never dies.





fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Feb 2019 02:06
SetSunDirection( vx, vy, vz ) positions the sun


Green Gandalf has a thread about using many point lights using a shader

https://forum.thegamecreators.com/thread/223707
fubar
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 4th Feb 2019 21:30
looks like his demo shows how ti use specular and normal mapping with point lights not shadows.
A child's dream never dies.





fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Feb 2019 21:52
Please download and try it, it produces shadows for me
fubar
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Feb 2019 16:07
Quote: "Please download and try it, it produces shadows for me "


Thanks for the vote of confidence, but I don’t think it does. It’s probably just an unintentional illusion .

This could well be my next AppGameKit shader project - when I return from holiday .
Green Gandalf of the TGC forums aka Scorpius of the Malevolence:Sword of Ahkranox forums.
Shader developer for Evochron Legacy produced by StarWraith 3D Games.

Login to post a reply

Server time is: 2024-03-28 14:34:41
Your offset time is: 2024-03-28 14:34:41