• Announcements

    • Detrux

      Site Relaunched   10/13/2016

      Welcome back to BFEditor.org! We've upgraded the forum software, removed the spammers, and improved security. Apologies for the downtime! Det
Remdul

New Tool: Bfmeshview

92 posts in this topic

I'm confused wrt occlusion meshes. When I took a look at BF2 occ files in bfmeshview, I'm pretty sure the position of the mesh differed from the staticmesh, for example the occ for the Karkand hotel building looks a lot slimmer than the actual building mesh. Most meshes seem to be just boxes in approximate positions to the static mesh.

I exported an occ mesh for one of the PR statics by importing the static mesh into 3ds max and modeling the occ mesh along its boundaries and exporting it from the same position. I added the occ into the objects_client, then placed that static on a map along with its double that had no occ and identical objects behind both statics to compare FPS, but due the above I'm not sure if it actually worked, though there was a difference in FPS when looking at the object with occ and no occ. Am I doing this right or wrong?

Edited by Outlawz

Share this post


Link to post
Share on other sites

Hey Remdul I have a request.

Is it possible to add support to BFmeshview to be able to generate samples for dest objects? Currently if you try to generate samples for even gemo0 it gives you an error saying it can't generate for objects with multiple gemos.

Also one other really useful feature would be when you select the next lod down when doing the samples, it would 1/2 the size of the lightmap you had before as default since 90% of the time that's what you want :D

This would make my life a lot easier if you could do this :)

Cheers!

Share this post


Link to post
Share on other sites

I just released a new version (BfMeshView 2.2.0)! I didn't realize last release was over a year ago!

http://www.bytehazard.com/bfstuff/bfmeshview/

UPDATE: the contents of the v220 archive was borked, if you downloaded before the time of this edit, please re-download!

The highlights:

* full BF2 shader emulation

* support for suffixed textures

* added vehicle component positioning (loads .CON)

* added CollisionMesh color legend

* experimental SkinnedMesh vertex weight tools

* much improved UV editor

* integrated animation player with main window

* lots of bug fixes, performance tweaks and improved compatibility

Feedback welcome. Please report regressions and new bugs.

PS: I will try to address your questions if I find the time. Some of the bug fixes may solve the problems mentioned.

Edited by Remdul

Share this post


Link to post
Share on other sites

@Outlawz: I will see if I can write a BF2 occlusion mesh tutorial. Short answer: if you place your ready-for-export static in 3dsmax at the origin (root node is at 0/0/0), then the occlusion mesh will line up properly. An occlusion mesh should generally be entirely inside the visible mesh.

Occlusion testing ensures that any objects behind the occlusion mesh are never rendered to the framebuffer, which improves framerate. An occlusion mesh has no effect on the model itself however. Big objects such as highrises tend to occlude large number of objects, so they are good occluders.

You can test this in BF2 by moving the camera inside the visible mesh, but outside the occluder. You should see objects disappear.

@Rhino: lightmapped destroyable objects are so rare, I didn't bother adding support. But I think there is a workaround: export the destroyed model seperately as regular static, generate the samples for it with BfMeshView, then rename the samples and put them along the destroyable version.

The report about "bad faces" means there are some errors in your model. Most likely these are degenerate (infinitely thin) triangles. These cause all sorts of mathematical problems. You can detect them using this MaxScript: http://www.bytehazard.com/bfstuff/meshcheck.ms. The source of these thin triangles tends to come from CSG modeling techniques, and poor triangulation with Editable Poly in 3dsmax. Since I'm old-skool, I always re-triangulate my models as Editable Mesh ('Edge' mode > 'Turn' tool) before UV-ing.

@[sFaith]neko: I believe this bug is addressed in the latest BfMeshView version.

Edited by Remdul

Share this post


Link to post
Share on other sites

Hey,

just tried your updated tool.. however it doesn't show any kind of meshes (bundled, static, collision) in the viewport, the geom/lod hierarchy is loaded correctly though.

Might be related to my new GPU (AMD 7870) ?!

Also the old 210 build shows this error on startup: "DrawColMeshGeom Division by Zero".

A similar error shows up when opening the UV editor in the 220 build: "Run-time error '11': Division by Zero"

Share this post


Link to post
Share on other sites

Hi Remdul,

I am having trouble getting version 2.2.0 to display textures. The added paths are correct and in the material setup it appears to have loaded them, but the mesh is still just gray/shaded. I applied all settings and tried reloading textures but none of that worked. I am using dual GTX480/SLI with Win 7 Ultimate.

Share this post


Link to post
Share on other sites

Hi Remdul,

I am having trouble getting version 2.2.0 to display textures. The added paths are correct and in the material setup it appears to have loaded them, but the mesh is still just gray/shaded. I applied all settings and tried reloading textures but none of that worked. I am using dual GTX480/SLI with Win 7 Ultimate.

Could you verify some things:

* what does your mod/texture path look like? It should be like this: "H:\Games\Battlefield 2\mods\fh2test"

* are the green map icons marked by a red cross?

* after loading a BF2 model, do you see in View > Debug Log any errors about textures not being loaded (near bottom)?

* is View > Diffuse Map checked?

* is Options > Load Textures checked?

* is View > GLSL Shaders checked or unchecked?

Edited by Remdul

Share this post


Link to post
Share on other sites

I figured out what the problem is, If a mesh is exported with long file paths like this:

c:/program files (x86)/ea games/battlefield 2/mods/bf2/objects/staticobjects/common/common_01_c.dds

It wont recognize or show the texture. The icon has a red X and the mesh is gray. When I click on the material and try to edit the texture paths I get this error:

error_01.png

The mesh disappears completey, and I have to restart the program.

If I fix the texture paths to what they should be with BFMaterials and then load the mesh with meshview, everything seems to work fine.

/objects/staticobjects/common/common_01_c.dds

This isn't really a big deal, just that the "fix scene image paths" doesnt seem to work on my computer so I always use meshview to fix them and the older versions didnt seem to mind the long file paths, but I can just use BFMaterials. :D

Edited by Coronaextra

Share this post


Link to post
Share on other sites

The report about "bad faces" means there are some errors in your model. Most likely these are degenerate (infinitely thin) triangles. These cause all sorts of mathematical problems. You can detect them using this MaxScript: http://www.bytehazard.com/bfstuff/meshcheck.ms. The source of these thin triangles tends to come from CSG modeling techniques, and poor triangulation with Editable Poly in 3dsmax. Since I'm old-skool, I always re-triangulate my models as Editable Mesh ('Edge' mode > 'Turn' tool) before UV-ing.

In BFmeshview, when looking at collison meshes I frequenlty see a red x by the mesh name (col0, col1, col2, or col3). What are the possible reasons for the red x? Is it a 'bad face' as a above?

Share this post


Link to post
Share on other sites

In BFmeshview, when looking at collison meshes I frequenlty see a red x by the mesh name (col0, col1, col2, or col3). What are the possible reasons for the red x? Is it a 'bad face' as a above?

Thin triangles (can cause bad calculations), though generally not a worry.

Share this post


Link to post
Share on other sites

I just released a new version (BfMeshView 2.3.2)!

http://www.bytehazard.com/bfstuff/bfmeshview/

The highlights:
* added 'Copy UV Channel' tool
* added mouse wheel zoom to 'UV Editor'
* added 'Fix Overgrowth Alpha Mode' for BF2 .staticmesh
* added 'pro user' mode to skip overwrite warning on mesh save (enable in "config.ini": promode=1)
* added option to choose UV channel for OBJ export
* added option to export transformed vertices for OBJ export
* fixed OBJ export UVs being vertically inverted
* fixed error message when selecting missing material texture maps
* 'Generate Samples' tool now automatically reloads samples

Feedback welcome. Please report regressions and new bugs.

PS: GitHub code is temporarily out of date, will sync my SVN repo with GitHub later.

Share this post


Link to post
Share on other sites

@ Remdul

Are you able to modify meshviewer,or make a seperate program

That can search through a folder,full of folders (zipped or unzipped) ,such as Weapons/Handheld

And find a text string written in a bundledmesh file

Such as xxx/Textures/Scope.dds

 

 

Share this post


Link to post
Share on other sites

If you've got a *nix system, you could do:

find . -name *bundledmesh -exec strings "{}" \; | grep '/textures/.*.dds$' | uniq -c

which will do what you described for all files/folders recursively in the current directory.  Though, it would need a little tweaking to look in zips as well.

Edited by amideadyet

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now