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

Added 5 Unity classes + Fix X-mirroring of models #103

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz

I added 5 classes that I came along on my travels:
MeshFilter, MeshRenderer, MeshCollider, SphereCollider and CapsuleCollider.

I also cleaned up renderer.py a bit.

Added SphereCollider, CapsuleCollider and MeshCollider.
Added SphereCollider, CapsuleCollider and MeshCollider.
- Added MeshRenderer

- Added RendererBase and ParticleRendererBase to reduce code while achieving the same result.
Added the one value MeshFilter has.
@sebastientromp
Copy link

Hey! By any chance, would you know how to add support for the new (Unity 5.5+) shaders?

@j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz

I would recommend looking at the YAML-dump of such a shader.
unity2yaml ShaderSampleBundle > out.yaml
vim out.yaml

@sebastientromp
Copy link

Thanks for the advice. Unfortunately, that doesn't help because the shader code itself is stored under compressedBlob and would need to be decompressed / decoded.

@j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz

I see. The compression you're looking at is most likely done using the .net deflate class.
But as for the code itself, I don't know. You might have use of tools such as Radare2, Ghidra or ILSpy.

I had a headache trying to figure out what was wrong with my code. Turns out it wasn't my code but this code.
Might have to do with the specific Unity version?
@@ -147,7 +147,7 @@ def __init__(self, mesh):
@staticmethod
def face_str(indices, coords, normals):
ret = ["f "]
for i in indices[::-1]:
Copy link
Contributor

@robert-nix robert-nix Jul 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was done to convert from left-handed coordinates to right-handed coordinates, FWIW. So without this the face normals would all be inside out in tools that expect right-handed models.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, um, TBH I thought pull requests would only add the commits from before they were made.
Either way, you are correct, however removing the - on line 31 inverts the models once, so the face normals are as they should.
I know it's a bit counter-intuitive but if you test it, it should be fine.

@j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz changed the title Added 5 Unity classes Added 5 Unity classes + Fix X-mirroring of models Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants