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 / [SOLVED] Bug with firtree.x in the 3D asset pack

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Aug 2018 11:42
In the model-viewer it doesn't apply any textures to the model nomater what you do
it says it has 2 animations it doesn't
if you load the model in AppGameKit it will apply a texture providing you use loadobject and then set the diffuse map
but as soon as you try the normal map with the command SetObjectNormalMap AppGameKit reports an error about
uvVarying undefined and says the error it at the same line as the sync() command. I haven't changed the shaders
so it is on default and other models will set normal maps without problems so I imagine the issue is the way the
model was textured
fubar

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

Go to answer

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 27th Aug 2018 18:33
Sounds like the model and no normals. Is it lighting properly? I.e. is their dark and lights surfaces depending on where the light is?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Aug 2018 02:10
Quote: "Sounds like the model and no normals. Is it lighting properly?"

Its a dark texture but I believe the lighting is working just missing a normal texture from the model
fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 28th Aug 2018 09:22
Are you assigning a normal map texture to the correct texture slot??
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Aug 2018 10:33
This post has been marked by the post author as the answer.
I use the SetObjectNormalMap ( objID, imageID ) command and im not using any shaders only the built in ones
so im guessing they haven't set up a normal texture for the model properly perhaps a bad export
fubar
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 28th Aug 2018 22:39
This particular model is made up of three meshes inside the .x file. The trunk, the branches and something called a "firespot". The firespot has no normals but the rest of the model does. This causes confusion when agk tries to render it with a normal map as it cant apply a normal map to a model mesh which has no normals.

This particular .x file is saved as an ascii .x file - this means you can open it as text and see all the parts of the model. You can literally browse through the vertices and texture coordinates and normals. It also means you can go into it and simply remove the firespot parts (the frame, vertices, mesh, uvs and animation) then save it.

This then allows you to set a normal map to the object in AppGameKit and it then doesnt generate an error in agk when attempting to add a normal map and it renders it.

I assume the firespot was originally meant for where a fire would start or something else? Its just a single triangle in the model that appears to not really be used. Its that annoying little bit that causes the issue.


Also - as the file shows...technically there are some animations as you can see the keyframes but they dont do much
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Aug 2018 23:51 Edited at: 29th Aug 2018 03:31
Thanks @Bengismo
It also had the problem with instance object
Quote: "It also means you can go into it and simply remove the firespot parts (the frame, vertices, mesh, uvs and animation) then save it."

that fixes it and was easy to do. I didn't think to check the .x file usually theyre binary
fubar

Login to post a reply

Server time is: 2024-11-23 15:07:55
Your offset time is: 2024-11-23 15:07:55