As you may know already, last year I extracted the perspective shaders from the FNaF 1 Android remaster and released them for everyone to use. The FNaF wiki needed rips of the new music tracks in the remasters, and since nobody else did it I decided to do it myself, and I ended up finding the shaders on accident.
Ever since then, I've been snooping around the files of this port and the source code of CTF 2.5's Android exporter and I found some interesting information that not many people seem to know, so I thought I'd share everything I've found so far.
Android perspective object
Before you start asking, I will release it to the public very soon.
The Android perspective object which I showed 2 days ago was actually extracted from this port. I decompiled the classes.dex file in the APK and found it lying around in the Extensions package.
The decompilation was kinda broken and the function which did the rendering of the effect wasn't decompiled properly, so I spent a whole day cleaning it up and fixing stuff, and even optimized it a bit.
This object doesn't really do anything special: it just takes a part of the screen and then renders it again using the perspective shaders.
I only built one game with it and it worked first try. I'll admit I was surprised that I didn't need to fix anything else or do any dirty hacks to get it working.
However, I noticed that this object is different from the one that's publicly available right now. Seems like it's an updated version.
There are some new A/C/E (actions/conditions/expressions) and some new features. For example, apparently you're able to apply the perspective effect to specific objects instead of the whole screen.
Here's a list of the new A/C/E that I've found:
actPausePerspective (Same as making perspective invisible. I don't get the point of this one)
actResumePerspective (Makes perspective visible and tells perspective to apply the effect to the screen instead of an object)
actUseObject (Tells perspective to use an object to apply the effect to instead of the screen)
actAddObject (This and the next ones seem to mess with a list which is never used. Not entirely sure what they do)
actAddCoordinates
actRemoveSlot
actResetObject
actDoTransform
actApplyTo
expGetTPosX
expGetTPosY
expGetTWidth
expGetTHeight
expGetTScaleX
expGetTScaleY
cndDoneTransformation
Now you may be thinking "hold on, aren't the ports being made with Fusion 3? How did you get a Fusion 3 extension working on CTF 2.5?"
The truth is, the ports are NOT being made with Fusion 3.
The mobile ports are 100% CTF 2.5, and the console ports use CTF 2.5 with parts of Fusion 3 which allow it to run on consoles. That's it.
I already knew about the mobile ports being CTF 2.5 ever since I extracted the perspective shaders. The structure of the APK is pretty much the same of that of a CTF 2.5 game.

This is the res/raw folder which contains all of the game's data. This is where I got the perspective shaders from. The structure, the file names, it's all the same. But there's more.

The classes.dex file contains all of the CTF 2.5 code and extensions. This is where I got the perspective object from. You don't even need to look at the actual code to see that it's the exact same thing. I checked a few files anyways just to be sure. No difference.
As for the console ports-

Of course when I found out about this I wanted to get shaders working on CTF 2.5. I tried to make an extension that could do it but I never got it to work. Later on I found out-
The CTF 2.5 Android and iOS exporters already support shaders.
There's no way to get them working without hacking it in, but it's there, and it's ready to be used. Mostly.
Functions and variables referring to shaders were added silently sometime between build 291.6 and build 292.22.
The perspective object uses these functions so they were probably created for the ports and slipped into the public exporters on accident.


renderPerspective and renderSinewave are completely unused, not even the perspective object uses them, and they probably don't even work.
This means that using shaders is entirely possible on Android and iOS now, we just need a proper extension for it. Hell, maybe Clickteam themselves will add this to the engine if they're not too busy stealing people's wallets.
There's obviously the problem of having to convert shaders to GLSL, but that's really easy if you know what you're doing.
Judging from the code, you can use shaders on objects and the whole screen. Using shaders on layers isn't possible without some extra modifications.
I tried to update the shader extension I was making to use these functions but I couldn't get it to work. Now that I have the perspective object source code though, I could probably do it, buuuut I deleted all of the files so I would have to redo the whole thing and I don't have the time or patience for that right now. So I'll just leave that for someone else.










11 comments