Page 1 of 2

Mesh changing at a distance

Posted: Mon Apr 08, 2013 3:56 pm
by BotHunter
Hello all! I have this problem in which if you get far enough away from one of the meshes I put it, It changes to a different mesh. the wierd thing is this will still happen if the real mesh is something not in BF! Any Ideas?
Thanks! :)

Re: Mesh changing at a distance

Posted: Mon Apr 08, 2013 4:30 pm
by Swaffy
I think I know what you're talking about. I think it's the SimpleMesh, an object that has a very low poly count and is used for far-away rendering. At first, the 3D object might look like a shadow mesh.

For example, "Shad_MP67_m1" or "Shade_MP67_m1" could be the simpleMesh.

Re: Mesh changing at a distance

Posted: Mon Apr 08, 2013 6:16 pm
by Apache Thunder
You might have accidentally included a second LOD mesh while exporting the mesh file. Import it into gmax/3dS max making sure to uncheck the import main lod only option so that it imports all other lods that may be present and check to see if there is any LOD02 meshes and so on. Your object won't switch to another mesh unless it's coded to use a lod object that does so. But the second lod on the main mesh it self may end up operating without the help of coding and thus might be what is causing your issue. Delete the LOD02 meshes and so on if you find any or if you find one that is significantly different then the other LOD meshes.

Re: Mesh changing at a distance

Posted: Tue Apr 09, 2013 6:12 pm
by BotHunter
I'm using tha BF109 Lod selector. could that be a problem?

Re: Mesh changing at a distance

Posted: Tue Apr 09, 2013 7:03 pm
by freddy
BotHunter wrote:I'm using tha BF109 Lod selector. could that be a problem?
Propably, the BF109 is the only plane in bf42 that has no objectTemplate.cullRadiusScale 5 not saying that is the problem, but if you based the code on the BF109 you might want to check it out

Re: Mesh changing at a distance

Posted: Tue Apr 09, 2013 7:26 pm
by Senshi
cullradius is irrelevant for LODs. cullradius describes the distance after which objects get entirely culled out (no longer rendered/"invisible"). By increasing the radiusscale you can practically remove the annoying "object gets invisible all of a sudden at a certain distance". Obviously you gotta test for perfomance, as this will increase the load a bit.

Meshchange on distance is either wrongful LODs in the .sm, an entirely wrong LodSelector or a wrong simplemesh :/ .

Re: Mesh changing at a distance

Posted: Tue Apr 09, 2013 7:30 pm
by BotHunter
Here is an example (Top photo):

http://battlefieldarea51mod.weebly.com/photos.html

The BF109's in the background is actually the same thing as the plane up close

Re: Mesh changing at a distance

Posted: Tue Apr 09, 2013 8:08 pm
by BotHunter
Where is the BF109 lod selector defined?

Re: Mesh changing at a distance

Posted: Tue Apr 09, 2013 8:49 pm
by freddy
That must be in Geometries.con ?

Re: Mesh changing at a distance

Posted: Wed Apr 10, 2013 4:46 pm
by Swaffy
I know, I have this same issue with my HandFireArms. I had my 870 showing up close then at a distance it looked like a No4 rifle.

I'll use the M10 tank as an example. If you open up its Objects.con and scroll to the bottom, you will see this:
  • rem *** M10Simple ***
    ObjectTemplate.create SimpleObject M10Simple
    ObjectTemplate.geometry M10_Hull_L1
That's what you see from long distances, when the main Complex mesh is out of range. This is, in your case, that BF-109 mesh when you see your vehicle from far away.

This SimpleObject is added to the LOD object, seen here:
  • rem *** lodM10 ***
    ObjectTemplate.create LodObject lodM10
    ObjectTemplate.hasMobilePhysics 1
    ObjectTemplate.hasCollisionPhysics 1
    ObjectTemplate.hasResponsePhysics 1
    rem -------------------------------------
    ObjectTemplate.addTemplate M10Complex
    ObjectTemplate.addTemplate M10Simple
    ObjectTemplate.addTemplate M10Wreck
    rem -------------------------------------
    ObjectTemplate.lodSelector M10LodSelector
Also note that "M10_Hull_L1" is a different StandardMesh file than the main meshes. It has all of the tank's parts in one single StandardMesh 3D object (turret, hull, tracks), with a reduced poly count. You don't need high poly counts for a far distant object. I've seen them with varying names, such as "ObjectName_L1", "shad_ObjectName", "shade_ObjectName", "shad_ObjectName_m1", etc.