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 Studio Chat / [SOLVED] How do you display Vertex Colors in AGK?

Author
Message
Loktofeit
AGK Developer
13
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 3rd Aug 2022 13:57
Googling, I found a video that said to use LoadObjectwithChildren() but it still isn't displaying them.

Is there a certain command or setting for it? Also, for displaying vertex colors, are there certain 3d formats that play nicer with AppGameKit than others?
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.

The author of this post has marked a post as an answer.

Go to answer

blink0k
Moderator
9
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Aug 2022 14:43
search
Loktofeit
AGK Developer
13
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 3rd Aug 2022 15:52 Edited at: 3rd Aug 2022 16:28
I did. I googled "Appgamekit vertex colors", and I searched these forums. On these forums there is only one post in the past 15 years that came up when I searched for "vertex colors".
Now, if there is a better search term I should use, please let me know.


Did not expect a response like that from you, blink0k.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
smerf
17
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 3rd Aug 2022 19:25 Edited at: 3rd Aug 2022 19:27
Vertext color Show up automatically on all objects loaded into agk that have been properly vertex painted. There is no additional code to make them work. Try exporting you model different make sure that vertex colors are selected on export and ur not using a weight

Loktofeit
AGK Developer
13
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 3rd Aug 2022 21:44
Ok, will try going thru Blender and then exporting them, as that's a pretty standard tool. Has me thinking maybe it's my apps. ty, smerf
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Loktofeit
AGK Developer
13
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 3rd Aug 2022 22:51
I open the attached file in INIVIS AC3D, MeshLab, Windows 3DViewer, and Blender. The vertex colors are there. In both AppGameKit Studio and AppGameKit Classic, there's no color.
Is it something I am doing wrong with the code or the files? I'm lost and I'm hitting a wall. Thank you in advance, for any help you can throw my way.


LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.

Attachments

Login to view attachments
blink0k
Moderator
9
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Loktofeit
AGK Developer
13
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 4th Aug 2022 03:27
Yes, that post says which formats have them. Thank you for the link, but knowing what formats support it isn't the problem I have.
As I posted above, I know which formats have them. I verified in multiple programs that the vertex colors are present in the files.

They are not displaying in AppGameKit Studio or Classic.

I submitted some code and a file where I am having the problem. Were you able to get the colors to show in AppGameKit with that code and file? If not, am I missing something in the code? Is there an issue with my file?

To reiterate -
I know which formats support it.
I know AppGameKit doesn't read it from OBJ.
I have verified the colors are present in the files I am using.

I submitted some code and a file where I am encountering this problem.
What am I doing wrong that the colors are not showing up in my program?
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
blink0k
Moderator
9
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 4th Aug 2022 03:36 Edited at: 4th Aug 2022 03:43
As he says in the post;
.x files support vertex colours
.x files can also be exported as text so you can check and see if the vertex colours are being exported
He also says that exporting vertex colours requires some additional settings
Loktofeit
AGK Developer
13
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 4th Aug 2022 04:03

I guess I have to go find apps that import/export X files then.
Blender doesn't seem to. Have a recommendation?

LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
Virtual Nomad
Moderator
16
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Aug 2022 04:33
i dont know the 2nd thing about this stuff but it seems blender 2.79 can export as .x (that would be the 1st thing i know ).
theblackbones
3
Years of Service
User Offline
Joined: 31st Jan 2019
Location: France
Posted: 4th Aug 2022 13:18
This post has been marked by the post author as the answer.
Hello Loktofeit
Smerf is right.
The vertices of your mesh are not correctly painted.
Under Blender, they are white.
You have to use 'vertex paint' tool.
I painted QUICKLY with blender. ( and destroyed some vertices, sorry )
theblackbones
3
Years of Service
User Offline
Joined: 31st Jan 2019
Location: France
Posted: 4th Aug 2022 13:19
The file ...
Loktofeit
AGK Developer
13
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 4th Aug 2022 17:05
"The vertices of your mesh are not correctly painted." That's what I needed to know. Went back and checked it. The problem turned out to be how the material info was saved in the file.

You rock. Thanks!
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.
smerf
17
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 6th Aug 2022 20:20
.x files are the most supported format on agk. I use them for everything., I also still use blender 7.9. U have to install the .x plugin it does not natively have the ability. There are zero problems with .x files I have thoroughly tested them. Vertex colors, animations texture data all intact, names of animations ect. But to save you months of headaches do not use cycles , use blender render it's setup properly for games

Login to post a reply

Server time is: 2022-08-09 09:39:09
Your offset time is: 2022-08-09 09:39:09