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 / Loading textures automatically in Agk

Author
Message
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 2nd Jan 2019 11:50
Hi there.
I have to say, I write this from my little experience with AGK. Someone correct me if I'm wrong

The way agk works, loading 3D objects and then having to texturize them manually,which sometimes could be tedious, what many programmers use to do, is to create the whole level in a 3D program without textures and then manually assign the textures in AppGameKit . Other programmers choose to texturize the entire level in their favorite 3D program.

When we load an entire level in AppGameKit and then we check the number of meshes, we will expect to find as many meshes as objects have the scene that we have created.
We work in our 3D programm.
Imagine a room with four walls, floor, ceiling, a window and a door...that is eight objects.Now imagine that we apply a texture for the walls another for the ceiling one for the floor, and two more for the window and the door.
That will be five textures in the scene since the four walls share texture .Now we export to .x and load the level in AppGameKit .Even though we expect the level to have eight meshes, when AppGameKit loads the object, it will keep all meshes with the same texture in a group as janbo commented here . https://forum.thegamecreators.com/thread/221104
we will find in the object as many meshes as different textures are used in the scene.
The same happens if we export a scene with three objects..two of them with texture and one without . The object in AppGameKit will have just two meshes.
If the mesh is not created when loading the object in AppGameKit, we will not be able to change the texture of some parts of the scene with different texture simply because we see that one texture gives it a better look than another.

What I have create here in this snippet, is a couple of functions to load our objects in Agk with just one command "function " with all textures.

I'm not a grumpy grandpa

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 2nd Jan 2019 12:42
Nice work as usual, looking forward to experiment with this later on.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Jan 2019 13:27
Very Handy Chafari
fubar
puzzler2018
User Banned
Posted: 2nd Jan 2019 17:28 Edited at: 2nd Jan 2019 17:28
Spot on - yes we can have from 1 to 254 (the 255th one is used by AppGameKit for processing purposes) different textures on any one mesh by specifying what mesh index to use and apply to

Great job and excellent find...
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 2nd Jan 2019 18:58
Thank you guys for your comments.
I'm not a grumpy grandpa

Login to post a reply

Server time is: 2024-04-26 20:05:06
Your offset time is: 2024-04-26 20:05:06