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 / Texture 1 object with multiple images

Author
Message
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 13th Aug 2021 00:58 Edited at: 13th Aug 2021 15:59
Hi,

I'm trying to texture my soccer field with multiple images. I get the field, goal nets and the ad boards textured, but the ad boards and goal nets image is pasting over the field. Here is my code and screen shot. Image shows the field textured underneath and then textured over. The ad boards and goal nets are from one image. What is wrong if anything? Can you use an image meant for 2 things? It is only detected as one mesh. I will be changing the ad boards images, because I won't be able to use them even though I paid for them. I just wanted to see how to get the image that had two things in it meant for two different parts of the object would work


[img]null[/img]
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.

Attachments

Login to view attachments
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 13th Aug 2021 17:55
AGK's Object Loader is frustratingly basic... especially if you're coming from Dark BASIC Professional.
As I recall, when you load an object it will treat it as a Single Mesh, Static Object.

What's more is it will ALWAYS load as FVF338 (Position, Normal, UVSet0)
It won't even load the Vertex Diffuse Colour., not until you change the Mesh Format.
Animation is also handled as a separate (and in an archaic DAE Format)... honestly I think 3D Support was more or less an after thought., with the bare minimum of DBP Features being ported over.

In any case., a good practice to get into is to create a blank object with the correct FVF Format (which yeah it still uses identical to DBP / DirectX 9 despite being OpenGL)., then load individual Mesh as attached Object Mesh; then you can individually access and change things.

If you want to use a "Single Mesh" then just rearrange the UV Map., to use a Single Texture.

What the last number of the "SetObjectMeshImage" is., is essentially the Texture Stage used in Shaders... like DBP these come with pre-defined roles., but you can change these within a Shader.
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 14th Aug 2021 01:00
Quote: "In any case., a good practice to get into is to create a blank object with the correct FVF Format (which yeah it still uses identical to DBP / DirectX 9 despite being OpenGL)., then load individual Mesh as attached Object Mesh; then you can individually access and change things."


Are you suggesting to use the LoadObjectWithChildren? or Create ObjectPlane?
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 15th Aug 2021 00:10
Have you tried changing ObjMeshNum? Add a print of GetObjectNumMeshes(1) to your loop and see how many meshes there are.

Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 15th Aug 2021 03:57
Quote: "Have you tried changing ObjMeshNum? Add a print of GetObjectNumMeshes(1) to your loop and see how many meshes there are."



No, never crossed my mind to do that. I will try it in the morning though and post back
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 15th Aug 2021 17:55
@jd_zoo

I tried changing ObjectMeshNum to equal 3 just to see what would happen. It failed.

Then I ran the GetObjectNumMeshes command and printed to screen and it says it has only 1
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Aug 2021 18:09
Try saving your model as a .x
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 15th Aug 2021 23:15
Quote: "Try saving your model as a .x"


Can you do that in agk by just loading current format and saving as x code such as:



Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Aug 2021 08:45
No. You need to do it in a 3D proggy
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 16th Aug 2021 10:59
Only modeling software I have found so far that supports .x format import or export or both is Wings3d. I'll give it a go after work today
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Aug 2021 18:50
You could also export 3 seperate objects
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 16th Aug 2021 20:54 Edited at: 16th Aug 2021 21:00
proof that blink has forgotten more than i'll ever know
Quote: "The app will create individual models, or clones of models, based on their group name and create a table that records their position and various other properties."
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 16th Aug 2021 21:11
You don't need .x ... sack it, grab blender 2.79 and export fbx, if you want your child objects to show as children in AppGameKit you have to parent them to a bone not a mesh, LoadObjectWithChildren seems to treat the armature as the main object and meshes as child objects, I got the Mixamo sword and shield animation set working just fine on my custom mesh with shield and sword attachments, when you export the object select the group then shift click the armature to make it the active object and set "FBX scale" in export options to stop the massive scale problem

it took me a while to figure this out, only about 5 years, the key here is blender 2.79, anything above that and fbx exports do not work, static objects are fine but AppGameKit says no to animated objects exported with any later version

Who would of thought planned obsolescence was built into software dev tools to!!!

The object loading system needs a massive overhaul or AppGameKit will become defunct very soon, GLTF is taking off and quickly becoming a standard .... But ... this is TGC .... We know what to expect ... nothing, until "DarkAgk 3 Max Studio Pro" hits the kickstarter ... why update it when we can reinvent it and make all our users buy it again!

Open Source plugins
Cl - DnD Plugin
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 17th Aug 2021 00:07 Edited at: 17th Aug 2021 00:14
Quote: "proof that blink has forgotten more than i'll ever know
Quote: "The app will create individual models, or clones of models, based on their group name and create a table that records their position and various other properties.""



Quote: "You don't need .x ... sack it, grab blender 2.79 and export fbx, if you want your child objects to show as children in AppGameKit you have to parent them to a bone not a mesh, LoadObjectWithChildren seems to treat the armature as the main object and meshes as child objects, I got the Mixamo sword and shield animation set working just fine on my custom mesh with shield and sword attachments, when you export the object select the group then shift click the armature to make it the active object and set "FBX scale" in export options to stop the massive scale problem

it took me a while to figure this out, only about 5 years, the key here is blender 2.79, anything above that and fbx exports do not work, static objects are fine but AppGameKit says no to animated objects exported with any later version

Who would of thought planned obsolescence was built into software dev tools to!!!

The object loading system needs a massive overhaul or AppGameKit will become defunct very soon, GLTF is taking off and quickly becoming a standard .... But ... this is TGC .... We know what to expect ... nothing, until "DarkAgk 3 Max Studio Pro" hits the kickstarter ... why update it when we can reinvent it and make all our users buy it again!"


I'm trying both of the above things and converting to .x format way. I will figure this out yet LOL

I have wondered for awhile, does it matter what bit version I use of blender 32/64 bit? Can people on 32 bit systems play my game once it is done if I have objects created with the 64 bit version? I know that 32 bit software will run on 64 bit, but wondered about objects thing. Should I use 32 bit blender or does it matter since it is just objects and not the whole software?
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 17th Aug 2021 18:24
If, when you create your 3D object, you map textures to it from a single image, you only need load that single image for the object in AGK2.

For example here is a cube that has a different image for each face. I made in AC3D, unwrapped it, and assigned different areas of the image to each face. The image is similar to a texture atlas.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 17th Aug 2021 18:24 Edited at: 17th Aug 2021 18:25
Slow forum today, I hit the post button twice.
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 18th Aug 2021 02:27
Quote: "If, when you create your 3D object, you map textures to it from a single image, you only need load that single image for the object in AGK2."


My issue is that my soccer field is made up of 8 objects in a scene. I have verious file formats of it I can use. When I load ones compatible with AppGameKit Classic it sees it as one object not 8. It only takes 2 images to texture all 8. One for the field and 1 for the goal nets and adboards. The goal nets and adboard image has both the goal net texture and adboards in the one image. No matter how I manipulate the textures it shows up looking like the image in my first post. So, I'm already doing as you are suggesting. I have one image loading that has both nets and aboards in it. It isn't working right
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 18th Aug 2021 15:18 Edited at: 18th Aug 2021 15:22
I just found out the the object doesn't have any bones with the following code. So does that mean I have to attach it to a bone? Like with this command?

FixObjectToBone

Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 730 GT 2GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 18th Aug 2021 18:40 Edited at: 18th Aug 2021 18:45
Quote: "I have wondered for awhile, does it matter what bit version I use of blender 32/64 bit? "


No, that only applies to binary executables, media files are xBit independent.

Quote: "I just found out the the object doesn't have any bones with the following code."


ok i see what your trying to do, its a static object with no animations right, but uses multiple textures??

if that is the case the answer is simple, just export each object on its own depending on what texture it uses and load them into agk stacked (one on top of the other)

in blender hit shift+c to center the cursor, right click each model part and set origin>>3d cursor and group them into texture sets when you export, AppGameKit will use this origin point and place it at 0,0,0, pick one object (probably the pitch) and fix the rest of the bits to it with FixObjectToObject, now you only need to move the pitch and everything follows ....

or, the slightly more complex way but also the recommended way, for each object create another UVMap, unwrap and bake to a single texture

The How:
Bookmark this guy, he knows his stuff in blender and I learned bucket loads from him

Open Source plugins
Cl - DnD Plugin
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 19th Aug 2021 01:02
@PartTimeCoder

Quote: "ok i see what your trying to do, its a static object with no animations right, but uses multiple textures??"


Yes, you are right

Thanks for the info and video. I'm currently trying to follow the video, but not easy for me. He is using blender 2.80 and I'm using 2.79. He has his UI set up the way he wants it and since it is different than the default I have started from doesn't make it easy to find things. I'm dealing with it though slowly, but surely LOL. I'll post back when I succeed or fail lol. I hope this works.
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 19th Aug 2021 16:01
NoNoNo.... do your work in the latest version of blender because you get the nice UI and new tools, then export as any format you like, open 2.79 and import, then re-export with advised settings ...

Soz, I should have mentioned that.
Open Source plugins
Cl - DnD Plugin
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 19th Aug 2021 17:58
Ok so I will download and install 2.93 also.

Quote: "open 2.79 and import, then re-export with advised settings ..."


Export out with the settings you or he said? I know you mentioned how to do the process briefly. Sorry I'm simple minded, but learn fairly well if explained easy lol
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 19th Aug 2021 18:58
The videos are just blender, the guy is not a game dev he is an artist so I would think he knows very little about export settings for a game engine as most of them differ, follow his advice for the texturing only.

Right, I got a bit of a brain fog going on here as I am juggling 20 things at once (Life Huh!), but in hindsight if the model is not animated than you do not need blender 2.79 as that only applies to animated objects that load with LoadObjectWithChildren, for non animated objects the default FBX export from blender 2.9xx is just fine and load them with LoadObject, the "jump through loops" method only applies to animated objects.

Quote: "but learn fairly well if explained easy lol"


The texturing part is pretty easy to be honest but its to involved to type out in a forum without visual aids, l am more of a visual learner if I see it done I get it, but honestly Grants videos are a fantastic resource, check the playlists, make a coffee and soak up some info for a couple of hours, once you seen it done a couple of times you should get it.

Quote: "Sorry I'm simple minded"


I don't believe that for a second!
Open Source plugins
Cl - DnD Plugin
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 19th Aug 2021 19:44
I can learn from videos pretty well if the videos are explained out good. I hate it when people say something and click a bunch of times and you don't know what they are doing unless you slow mo the video to see the clicks. Lol thank you
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 19th Aug 2021 23:19 Edited at: 19th Aug 2021 23:19
Yea some people, although I appreciate the effort of making and uploading the video some peeps just are not cut out for the tutorial business, "a beginner tutorial with some prior knowledge expected" is an oxymoronic way of thinking, observational learning still needs some foundation, Hey, learn to code with XYZ then they open some random console and type commands, push this, pull that then start tapping keys saying this is hello world and push this pull that ..... seriously like WT....

Not that I would be any better at it, tis why I don't bother.

Theodore Roosevelt wrote: " The only man who never makes a mistake is the man who never does anything."


^^ Sometimes its good just to play around inside a software, make mistakes, delete it all and start again, rinse and repeat, its not a very productive strategy but its great way to learn what not to do and sometimes serendipity will strike.

Anyway, goodluck, let us know how you get on.
Open Source plugins
Cl - DnD Plugin
Unseen Ghost
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 20th Aug 2021 00:32 Edited at: 20th Aug 2021 01:01
I noticed that blender 2.93.3 has a parent feature. Do you think I should set the field as parent in blender? Would it help or not? Or should I just stick to original plan? I also just noticed my 2 goal nets before I do anything, as far as UVmaps they have a base and lightmap, all other children objects have just a UVmap

I attached an image to show where I happen to see it. I rightclicked on the field and saw it.
Gigabyte Board/ AMD 3.3 Ghtz Quad core/8GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex

No one cares how much you know until they know how much you care.

Attachments

Login to view attachments
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 20th Aug 2021 03:26
Quote: "I noticed that blender 2.93.3 has a parent feature. Do you think I should set the field as parent in blender? Would it help or not? Or should I just stick to original plan?"


To be honest I don't really know, I only ever use that parenting with animated objects, for static objects I just select all and CTRL+J to join them into a single object but you don't even need to do that for an export its more of a workspace management thing for me to tidy up the scene tree, you can generate the UVMap and bake the diffuse with them joined or not it really does not matter.

Quote: "I also just noticed my 2 goal nets before I do anything, as far as UVmaps they have a base and lightmap, all other children objects have just a UVmap"


You pretty much do the same thing but bake only the normal but the are a few factors to consider, I would need to see the project file for that one, are the normal already loaded in the shader? do they use the same map?

Personally speaking I would sack the old normal and light map and generate new ones from the final scene, place some lights and a cam and bake an AO map and diffuse with full lights and stuff then merge the AO with a RGB Ramp and rebake (more advanced stuff here)

I'll mock something up in the morning.



Open Source plugins
Cl - DnD Plugin

Login to post a reply

Server time is: 2024-11-21 17:07:04
Your offset time is: 2024-11-21 17:07:04