Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heat Shields with FAR #572

Closed
svm420 opened this issue Mar 29, 2019 · 14 comments
Closed

Heat Shields with FAR #572

svm420 opened this issue Mar 29, 2019 · 14 comments
Labels
bug bug pertains to non-art issues Mod Compatibility Compatibility issues with other mods restock base content is base restock

Comments

@svm420
Copy link

svm420 commented Mar 29, 2019

The current master release and latest FAR has some issue with the meshs(?) when using FAR. I know it isn't designed for FAR, but I want to at least report it. Feel free to say you don't care.

Images

The 0.625 heat shield appears flat and extended beyond the actual part bounds
The 1.25m shield has the shroud mesh always on.
The 2.5m shield mesh extends down beyond the bounds of the part around the outer edge of the part.
Let me know if you need anything from me.

@drewcassidy drewcassidy added bug bug pertains to non-art issues Mod Compatibility Compatibility issues with other mods restock base content is base restock labels Mar 30, 2019
@ChrisAdderley
Copy link
Contributor

ChrisAdderley commented Apr 1, 2019

Based on these images, FAR is voxelizing the colliders vs the meshes - those look like the stock colliders. You could indicate that to the FAR dev - I spent a while in the FAR repo just now trying to see if there was an obvious way they were overridden somewhere and can't find anything, so I have no idea what I might do to fix this.

@PhineasFreak
Copy link

You can command FAR to use the mesh instead of the collider by:

@PART[MyPart1|MyPart2|MyPartN]:AFTER[FerramAerospaceResearch]
{
    @MODULE[GeometryPartModule]
    {
        %forceUseMeshes = True
    }
}

But i find it weird that RS would need such patches since you are replicating the part colliders. FAR itself does ship a patch for specific parts but the stock heat shields are not among them.

@dkavolis
Copy link

dkavolis commented Apr 3, 2019

Actually, you will probably want to force colliders (meshes are used by default pretty much always). In the screenshot, voxels are based on the mesh and the wireframe shows collider which is much closer to the actual heat shield shape than the mesh itself, though still a cylinder.

screenshot35

The 3.75m heat shield has a bug in its mesh
screenshot36

EDIT: Added some debug messages to voxelization in my debug build, should help narrow down the offending meshes:
screenshot37

Also a question: would adding a list to exclude specific transforms when voxelizing in GeometryPartModule be of any use?

@ChrisAdderley
Copy link
Contributor

I think you're going to need to be clearer about how you define a bug in the mesh for FAR's purposes.

Looking at the list of mesh items that have the fail tag next to them, it's not clear to me what is going on - in fact it looks like all of the actual visible model mesh objects (HeatShield125Brown, HeatShield125Internals, fairing) have failed.

What causes a mesh to fail voxelization, specifically? These parts aren't doing anything special.

@dkavolis
Copy link

dkavolis commented Apr 3, 2019

You can see in the 2nd screenshot that there are 2 planes in the mesh which I suppose should not be there. FAR will generate tons of drag with it in its current state.

Mesh isn't voxelized if the transform doesn't have MeshFilter or SkinnedMeshRenderer component attached or the part prefab contains model transform from the associated gameObject in TransparentFX layer.

https://github.com/dkavolis/Ferram-Aerospace-Research/blob/d902b9d8cf6b659554f810d7e42a2a8c85d8fc8d/FerramAerospaceResearch/FARPartGeometry/GeometryPartModule.cs#L669-L673

@ChrisAdderley
Copy link
Contributor

I'm fairly certain there aren't any giant planes in that model. I will check it out.

That doesn't clarify much regarding the 3rd screenshot and the failing objects, though. I am completely sure that those objects that are failing have MeshFilters and not on that layer.

@dkavolis
Copy link

dkavolis commented Apr 3, 2019

Oh sorry, the success and fail should be inverted.

@ChrisAdderley
Copy link
Contributor

Ok that's helpful. I will look into the issue in the 3.75m case to see if there are any anomalies, but getting back to the original issues in the first post, what can be done here? It looks certainly like the voxelization is not operating successfully on the parts that are described.

@dkavolis
Copy link

dkavolis commented Apr 3, 2019

The voxelization works fine, in the case of HeatShield2 fairing.001 and COLLIDER 1 are unnecessary. I'm trying to add a config key for ignoring specific model transforms right now.

@ChrisAdderley
Copy link
Contributor

Hang on I think I might see what's going on here. It's possible that these items have mesh filters but no mesh renderers. Therefore we don't see them in the game or in Unity but I guess FAR sees them. Is there a particular reason why keying off the filters vs the renderers was done?

@dkavolis
Copy link

dkavolis commented Apr 3, 2019

The MeshFilter components contain the mesh, tried discarding transforms without MeshRenderer attached. While it worked for heat shields, it broke some other parts, at least the Mammoth engine (nozzles were no longer voxelized). I can add config value for ignoring transforms without MeshRenderer component or ignore specific transforms. Something like

@PART[HeatShield2]:AFTER[FerramAerospaceResearch]
{
	@MODULE[GeometryPartModule]
	{
		%ignoreNoRenderer = true // ignore all transforms without MeshRenderer component
		ignoreTransform = fairing.001 // ignore specific transform
		ignoreTransform = COLLIDER 1
	}
}

screenshot38

@dkavolis
Copy link

dkavolis commented Apr 4, 2019

I've added new nodes to GeometryPartModule and included heat shield fixes in FAR since stock heat shields were affected as well. With the new config nodes, engines should be checked and fixed since a lot of them have invisible cones that get voxelized.
See dkavolis/Ferram-Aerospace-Research#37. I will do a release next week when KSP 1.7 ships.

You might want to check the voxelization of some other parts as well. I reckon forceUseMeshes and ignoreIfNoRenderer both true should work for most parts such that I might change the default behaviour to it.

@dkavolis
Copy link

FYI, this can be closed now, the latest FAR release contains the changes.

@ChrisAdderley
Copy link
Contributor

Noted, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug pertains to non-art issues Mod Compatibility Compatibility issues with other mods restock base content is base restock
Projects
None yet
Development

No branches or pull requests

5 participants