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 / Broken commands

Author
Message
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 2nd Oct 2020 09:06
Did I miss something, or does SetObjectMeshCastShadow not work? And is SetObjectMeshReceiveShadow not a command at all??
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Oct 2020 10:57
Those commands don't exists. Try SetObjectCastShadow() SetObjectReceiveShadow()
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 2nd Oct 2020 14:47
Well it works in classic, or at least the cast shadow one does.

Go try it.
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 2nd Oct 2020 14:48
Well.....it doesn't work, that's the point - but its recognised as a command and has the syntax requirements in.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Oct 2020 21:10
Yes. I see that now. It is not mentioned in the documentation. Maybe it's something they intend to implement but haven't fully done that yet
adambiser
AGK Developer
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 9th Oct 2020 06:53
SetObjectMeshCastShadow is an AppGameKit Studio only command.
The command does nothing in AppGameKit Classic, but is there so that AppGameKit Classic and AppGameKit Studio can both compile the same code.

Source: Wrapper.cpp
Search for "SetObjectMeshCastShadow"
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 18th Oct 2020 16:56
Also, setting a mesh invisible leaves it still casting a shadow.

Though I don't expect this or anything else in classic to get fixed now......which would be fine, is Studio actually was compatible with shaders that worked in Classic.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Oct 2020 20:04
Quote: "Also, setting a mesh invisible leaves it still casting a shadow."


I noticed this as well but it's really handy if you have a complex mesh for the object and a simple mesh for the shadow.
For example a vehicle would be a complex mesh and then you would have a simple plane to cast the shadow (which would be invisible)
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 18th Oct 2020 20:33
That's why it's kinda crucial that the shadow command works.

I got round ot with multiple renders, but if its functional in Studio then its bound to be a super quick fix.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Oct 2020 22:59
You can turn shadows off using SetObjectCastShadow(obj, 0)
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 19th Oct 2020 01:28
Well obviously....but I want to be able to control shadows per mesh, it's kinda integral to what I have set up.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Oct 2020 02:26
So you just want to be able to control shadows by mesh rather than turning shadows off when an object is not visible
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 19th Oct 2020 15:48
No, I want different meshes visible at different times, which works for what I am doing, but without having to turn off shadows for the entire object.

Like I said, I got round it but it would he great if these commands worked properly. At the moment you can make a single mesh invisible, but it still renders shadows unless you turn them off for the entire object, where it should only render shadows for visible meshes.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Oct 2020 20:50
If shadows turned off when and object was not visible. How would you optimize the polygons used to draw shadows?
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 19th Oct 2020 21:35
I dont follow. What do you mean how would you optimise the polygons for the shadows? You've lost me.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Oct 2020 22:19
If i have a vehicle that is say 2k polygons. It basically has a foot print that is a rectangle. Rather that using the 2k model to cast a shadow i can use a 2 poly plane to cast a shadow. Very similar to LOD optimization.
You can see this is real time using GetShadowPolygonsDrawn()
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 24th Oct 2020 21:25
Found another thing - if you turn collision off for an object, then turn collision back on for individual meshes, it doesn't work - it appears the object setting for collision overrides anything for meshes. Not sure if by design or not.

This isn't the same setup as shadows.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 25th Oct 2020 06:24
not sure if this is the issue
but if your talking physics collisions object settings do override them and the physics collision needs to be setup again
it probably isnt the issue but i wonder if setting the collision again after turning it back on helps regardless what type
of collision system you use

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 26th Oct 2020 11:46
Thanks Fubarpk,

It's not physics objects or collisions, just regular old collisions. So if you have an object with two meshes, and turn object collision off, than turn back on collision for one of the meshes.....it wont work. Turning collission back on for the object does then make it work again. So you can switch off an individual mesh I guess, but that's just more of a pain to track when your object gets to double digit meshes.

Another odd thing.....setting alpha masking on doesnt appear work when using a custom shader, which means that for shadows anything with a custom shader doesnt seem to allow for this?

Login to post a reply

Server time is: 2024-04-25 07:56:24
Your offset time is: 2024-04-25 07:56:24