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 textured objects...

Author
Message
MucMac
9
Years of Service
User Offline
Joined: 13th Sep 2015
Location: Munich, Germany
Posted: 26th Dec 2015 11:33
Hi,

i have several objects from my old game (B3D-Format), already textured (multilayer) and uv-scaled.
When i load a pretextured object with the LoadObject-Command, the loaded mesh is without textures.
Any idea why?
--
Mac
Lead Programmer (Tier 1) - MacOSX
AJCodes
9
Years of Service
User Offline
Joined: 6th Jan 2015
Location:
Posted: 26th Dec 2015 15:05
That's the way it works.

LoadObject.
LoadImage.
SetObjectImage(object, image, index).
Assign a shader to the object that knows what to do with all the images assigned.
Born. Currently living.
MucMac
9
Years of Service
User Offline
Joined: 13th Sep 2015
Location: Munich, Germany
Posted: 26th Dec 2015 16:02
Thats bad. I have several meshes with multiple textures applied (all with special UV correction).
Its an aweful job to reassign all the textures by hand when you can edit it with a mouse click in an 3d-editor.
When i load an object it should be automatically textured (if already textured in a 3d-editor). Just the way Blitz3D does that. Time for another update
--
Mac
Lead Programmer (Tier 1) - MacOSX
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 26th Dec 2015 18:47
I think it's time you actually update your old media. It's bad practice to have multiple textures for a single object like that. I'd take your model, give it proper UV coordinates and than copy paste the sections of the textures into the new UV map.

You will save on memory too, always a plus.
AJCodes
9
Years of Service
User Offline
Joined: 6th Jan 2015
Location:
Posted: 26th Dec 2015 23:51
From a gaming perspective, it's generally better to have one large texture per object, especially if you plan to have lots of them...minimizes the crap heading to the video card.

If you're trying to do really high-resolution work for custom video, it's pretty much the same but you'll break your "object" into multiple objects each with their own texture...which AppGameKit now supports.

Check out child objects...that may be what you're looking for -

LoadObjectWithChildren, SetObjectMeshImage.
Born. Currently living.
MucMac
9
Years of Service
User Offline
Joined: 13th Sep 2015
Location: Munich, Germany
Posted: 28th Dec 2015 12:16 Edited at: 28th Dec 2015 12:17
I have 2 textures, each of them with a different uv-scale. the first texture is less repetetive and looks blurry when you come close to it. from the distance its looks pretty good.
and here comes the second texture into the game:
it has a small uv scale (0.02 or else), which looks pretty sharp at short distances. from far distances the very repetetive pattern dissolves in the mipmapping.
in the end the texture looks always great, from far to close.

and i dont want to change all my media by hand, thats a huge amount of (unneccessary) work. i already have a game published on appstore (ParaglidingXC) using this technique (want to port it to agk though).

why does the assimp lib does not load the textures automatically? anyone knows why?
--
Mac
Lead Programmer (Tier 1, AGK2) - MacOSX - want to go 3D with agk2!
MarcoBruti
13
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 1st Jan 2016 13:23
Happy new year.
I am going to create walls for my FPS game using createObjectBox() command. At present I am using this function to create a larger texture with small images repeated sizeX*sizeY times, in order to texture the walls:

The images I am using are small (32x32 or 64x64) but the composite texture is big and I suspect that this approach is very memory consuming and performance affecting,
I cannot use milkshape3D, blender or other programs to create a scaled texture. In fact, I have not got an obj file, but an in-memory object created using a buit-in AppGameKit command.
Moreover, I have tried the tool tile texture mapper of Milkshape3D with cubic mapping, exported an obj and applied the texture, but no correct tiling is produced.
I have understood that by using a shader, we could do everything, but it is currently too time consuming to learn how to write a shader.
One way to optimize things, is to reuse the textures for different walls that have the same size, but this does not solve the issue at the roots.
Have you got any suggestion for me?

Login to post a reply

Server time is: 2024-11-25 13:36:12
Your offset time is: 2024-11-25 13:36:12