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 / [BUG] Shadows broken in new AGK version?

Author
Message
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 24th Oct 2017 23:29 Edited at: 15th Dec 2017 18:00
*) EDIT: This has been solved -see last post.
Off topic: Would be nice if we could change or at least add to the topic title something like [SOLVED] or [WORKAROUND FOUND]..

Hi,

I've stumbled onto something puzzeling.. Before I could have 2 animated characters displaying shadows without any issues in Win 10 x64. See pics below:

(code+media can be downloaded here: http://www.mediafire.com/file/55whby55hsv1dj1/CharacterController_Ragdoll3.rar )


Now, in AppGameKit-V2017.09.25-Windows, it somehow messes up the shadows of the 2 animated characters see below:


Anybody has an idea what's going on? Is this a new bug caused by the latest changes? Can anybody confirm it's the same for them?

[EDIT]
To make it more clear: as soon as I add the 2nd animated character's shadows, then the shadows of both animated characters get mixed up and they are no longer stuck to the individual characters and do no move along with them. So when I move the player it's shadow doesn't follow him around but remains in the same area and looks distorted, mixed up with the other characters shadow..
BTW: I've now tested under Android too and it's the same there.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 26th Oct 2017 14:41 Edited at: 26th Oct 2017 17:54
Ok.. Found out I had to go back 2 versions(V2017.08.16) for it to work properly again...

So definitely a bug I'd say. Especially as fails on both Windows 10 *and* Android 7.01.



(BTW: Would be nice if we could also edit the subject title of threads for the question mark can now be removed.)
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 26th Oct 2017 22:31
Thanks, fixed for the next version. It was caused by the second animated object having more bones than the first. You could work around it by loading the object with the most bones first, then the other animated objects.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 27th Oct 2017 17:22
@Paul Johnston:
That's very good to hear. Many thanks for checking this.
I'll try the work around for now.
pavel_sv_1982
11
Years of Service
User Offline
Joined: 9th Apr 2013
Location: Russia
Posted: 28th Nov 2017 12:05
@Rick Nasher:
how did you multiply the texture on the floor?
I watched your code sample. I understood how to do the shadows.
But it's unclear why you have the texture multiplied completely, but I only have 2 strips to the right and forward. and that's all.
thanks in advance.

Attachments

Login to view attachments
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 3rd Dec 2017 19:12 Edited at: 3rd Dec 2017 22:10
Try to resize your texture as a square texture (it seems rectangular no ?) (power of 2 as janbo said further
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 3rd Dec 2017 21:11
@pavelman
How about SetImageWrapU(ImageID,1) ?
And check if the image is a power of 2 so it works on all platforms.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 4th Dec 2017 19:35 Edited at: 4th Dec 2017 20:06
@Pavelman:

Quote: "how did you multiply the texture on the floor?
I watched your code sample. I understood how to do the shadows.
But it's unclear why you have the texture multiplied completely, but I only have 2 strips to the right and forward. and that's all.
thanks in advance."


Well, I can't take all the credit as not all of that code is 'mine'. I actually took the charactercontroller code from here https://forum.thegamecreators.com/thread/216683 , fiddled a little bit with it and added some stuff as a quick test to see how animation, shadows and physics would go together performance wise.
It was doing quite nicely as you can see.

I needed the floor to be larger and scaled it up a bit. When I did, I stumbled upon the floor tile stuff being a bit odd, getting stretched weirdly, so I 'fixed' it, can't remember how really though, is already a little while back and am quite busy doing something without textures and I tend to forget quickly when not using things for a while.

Original code:


My scaled up code:


Check:
Quote: "
SetImageWrapU

Description:
Sets the UV wrap mode of the image when the U coordinate goes outside the range 0-1. The default is mode 0 which clamps the pixel value to the last valid pixel, mode 1 repeats the texture starting from the opposite side.

To use UV values outside 0-1 successfully on all platforms the image in question must be a power of 2 in width and height, and not be part of an atlas texture. This applies to both clamp and repeat.
"


And:

Quote: "
SetObjectUVScale

Description:
Modifies all meshes in the object to use the specified UV scale, see SetObjectMeshUVScale for more information.
"
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 4th Dec 2017 20:17 Edited at: 4th Dec 2017 20:30
@janbo

BTW: love your environment mapping video


Was already wondering how to do mirrors in AppGameKit, for in Blitz3d it was quite clear how to do reflective surfaces, mirrors and cube/sphere mapping.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 14th Dec 2017 18:25 Edited at: 14th Dec 2017 18:30
Bug fixed in the version latest version 2017.12.12 :

Quote: "•Fixed animated objects causing incorrect shadows if an object with more bones was loaded after an object with less bones"


Many thanks Paul Johnston & AppGameKit team!

Login to post a reply

Server time is: 2024-04-27 05:14:52
Your offset time is: 2024-04-27 05:14:52