PDA

View Full Version : Effects and Mesh Manipulation with Mesh-table LOD



andi06
June 30th, 2015, 08:06 AM
Suppose we have an asset with three or four versions of the main mesh called LOD1, LOD2 etc.

If a script wants to hide a mesh is it necessary to hide every LOD variant?

If the mesh is then re-displayed and every mesh is unhidden will the game sort out which one is required by the lod scheme or will it display all four at the same time?

If a script wants to apply a texture-replacement do we need to duplicate the effect into very LOD variant? (if we did this we would need to use different effect names for each mesh)

Similar questions arise about coronas and attachments.

WindWalkr
June 30th, 2015, 06:15 PM
Suppose we have an asset with three or four versions of the main mesh called LOD1, LOD2 etc.

If a script wants to hide a mesh is it necessary to hide every LOD variant?

I assume you're talking about mesh-table LOD here, not LM. In that case, yes, if you want to hide each of the four meshes, you'll need to tell the game to hide each of the four meshes. While we humans may think of this as one mesh with four LODs, that is not what is actually happening- there are four distinct mesh-table entries, each restricted to show at one specific LOD.



If the mesh is then re-displayed and every mesh is unhidden will the game sort out which one is required by the lod scheme or will it display all four at the same time?

The game will only display meshes whose LOD and Season data matches the current LOD level and Season.



If a script wants to apply a texture-replacement do we need to duplicate the effect into very LOD variant? (if we did this we would need to use different effect names for each mesh)

Whether there is a LOD restriction present on the meshes does not affect this kind of decision. If you are using a technique which only affects a specific mesh, then you must repeat that technique across each mesh. If you are using a technique which applies automatically to the whole MeshObject, then you do not need to repeat that technique. It's typically very easy to know whether the effect will target a specific mesh: if the parameters for the effect list a specific mesh, then only that mesh will be targeted.




Similar questions arise about coronas and attachments.

Each given attachment point is loaded from an IM file. If you attach something to it, and the parent mesh is hidden, then the attachment point and everything descending from that should also be hidden.

If you have multiple attachment points which happen to have the same name, then it's undefined which point will be selected as the parent.


chris

andi06
June 30th, 2015, 06:43 PM
So to hide an object we hide all four meshes, and to re-display it we unhide them all, leaving the game to take care of which mesh is actually displayed.

In the case of mesh effects we need to carry out the same operation on all four meshes and in this case there must be different effect names if the calls are to work reliably.

Pencil42
June 30th, 2015, 06:59 PM
As a sort of follow-on question; is there a method to apply a texture replacement 'globally' within an asset? If I have multiple LODs or other separate mesh parts that all share a material (like track, for example); do I have to set up texture swapping for each mesh defined in the mesh table, then iterate through the list of meshes via script, or is there a method to say 'replace all instances of 'foo.texture' with 'boo.texture' from the boo texture library?

Thanks,
Curtis

WindWalkr
June 30th, 2015, 07:11 PM
So to hide an object we hide all four meshes, and to re-display it we unhide them all, leaving the game to take care of which mesh is actually displayed.

In the case of mesh effects we need to carry out the same operation on all four meshes and in this case there must be different effect names if the calls are to work reliably.

Yes. To reiterate: anything which is performed per-mesh must be called once per mesh.

chris

WindWalkr
June 30th, 2015, 07:14 PM
As a sort of follow-on question; is there a method to apply a texture replacement 'globally' within an asset? If I have multiple LODs or other separate mesh parts that all share a material (like track, for example); do I have to set up texture swapping for each mesh defined in the mesh table, then iterate through the list of meshes via script, or is there a method to say 'replace all instances of 'foo.texture' with 'boo.texture' from the boo texture library?

Mesh-table effects are specified per mesh. If you wish to reproduce the same effect on multiple meshes, then you'll need to specify that.

chris