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 / Is it possibble to turn of sun effect on specific objects?

Author
Message
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 27th May 2019 21:07
Searched thru the commands but cant find a command to turn of the effect of the sun on specific objects?

Its something i nead on indoor walls etc so only outdoor walls are affected in my mapper.

I use the default sun command in agk.



Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th May 2019 21:33
Setting the texture to level 0 means it will be effected by light
Setting the texture to level 1 means it wont be effected by light or shadows but it does upset the colours a little

not sure if that's what you need
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 27th May 2019 22:04
No i only nead to turn of the sun shader on some objects..

I use point lights and sun lights but want to turn sun of on indoor walls.




Noticed it now when i started to plan a test game with the current state of the mapper.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th May 2019 23:56
SetObjectLightmode(id, 0)
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 28th May 2019 05:30
Isn't there a way to setup layers? Similar to 2D, but 3D layers.
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 28th May 2019 13:50
Unfortunately SetSunActive(0) affects the whole scene (everything drawn in Render3D()) ....and using SetObjectLightMode(ob,0) turns off the sun and the point lights too but you probably want to keep the point lights in your interior scene.

A couple of options I can think of quickly:

1) Use a custom shader on your interior walls that is only lit by the point lights. you would have to pass the point lights to the shader but this way you could use way more than the built in 8 if you wanted to. Alternatively you could make the exterior shader custom and apply a sun value and direction but turn off AGK's sun when rendering the whole scene. That way...your sun will only be applicable where you want it to be.

2) You could do 2 render passes - Turn the sun on and render outside areas then turn sun off (SetSunActive(0)) and render the interior spaces.

Personally, id go down the shader route and then you can even have spot lights or specular if wanted too.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 28th May 2019 20:46
I might nead to do custom shaders but wanted to use standard agk commands to make it fully working with all agk version in case i would sell it as a tool and source code later on.
Thanks for all answers.

Have to do some final touches for alpha 0.007 so i can make a test game to find wath more i nead in the editor.

Login to post a reply

Server time is: 2024-11-22 21:26:48
Your offset time is: 2024-11-22 21:26:48