Comments (10)
For what it's worth, I thought of another workaround - to write a behavior/API to "unoptimize" the mesh on first access. For any vertex/uv that has already been seen, it can append a copy and update triangles with the new index. I'll test it out tomorrow.
from tiled2unity.
And I just realized the mesh import property sheet is a unity-specific thing, and not a tiled2unity one.
Working around this probably means some crazy heroics when generating the .dat files, which probably isn't woth it. I think the "unoptimizer" workaround is probably not too difficult, so I'm going to just close this out unless you feel strongly otherwise.
from tiled2unity.
What are the .dat flies you're talking about?
I wonder if it is something that could be solved by Tiled2Unity aferall?
Like if I forced every face on the mesh to have unique vertices? I wouldn't
want to turn that on for everybody but if it fixes your case it won't be
too hard to add.
Best,
Sean
On Thu, Jun 2, 2016 at 11:40 AM, Peter Ruibal [email protected]
wrote:
And I just realized the mesh import property sheet is a unity-specific
thing, and not a tiled2unity one.Working around this probably means some crazy heroics when generating the
.dat files, which probably isn't woth it. I think the "unoptimizer"
workaround is probably not too difficult, so I'm going to just close this
out unless you feel strongly otherwise.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#37 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AGqEFu1C4dcf4nnJc-qrO6nBB41TuI_Gks5qHweVgaJpZM4IsQjS
.
from tiled2unity.
The .dat files are the files that unity imports the meshes from inside the prefabs. I'm afk at the moment, but I believe they land in Assets/Tiled2Unity/Meshes/
As long as every quad had at least 4 unique vertices (6 unique for each triangle should work as well if that's simpler) that would solve my problem either way.
I got my "MeshUnoptimizer" and UV calculation logic sorted, so there's no rush.
I've got a Makefile I use to automatically run Tiled2UnityLite against my .tmx files and can add whatever custom flags I'd need to make that work. I'm a coder so I can test a patch or provide a Behavior that reproduces the issue if it helps.
from tiled2unity.
Hi again, Peter. I expect meshes to be exported as Wavefront OBJ files
(with the .obj extension). I've never seen any .dat files get generated.
If you can send me a behaviour that reproduces the issue that would help me
understand what you're trying to achieve and how Tiled2Unity may be able to
help (and if the fix would be general enough to help others).
Best,
Sean
On Thu, Jun 2, 2016 at 9:24 PM, Peter Ruibal [email protected]
wrote:
The .dat files are the files that unity is imports the meshes from inside
the prefabs. I'm afk at the moment, but I believe they land in
Assets/Tiled2Unity/Meshes/As long as every quad had at least 4 unique vertices (6 uniqueness each
triangle should work as well if that's simpler) that would solve my problem
either way.I got my "MeshUnoptimizer" and UV calculation logic sorted, so there's no
rush.I've got a Makefile I use to automatically run Tiled2UnityLite against my
.tmx files and can add whatever custom flags I'd need to make that work.
I'm a coder so I can test a patch or provide a Behavior that reproduces the
issue if it helps.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#37 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AGqEFoZTk8bLezIdFhxawu-ajjhr6qwKks5qH5BogaJpZM4IsQjS
.
from tiled2unity.
Sorry for the confusion, they're definitely .obj files, not .dat files.
I've created a gist that explains the issue a bit better and provides the behavior and support classes to repro here: https://gist.github.com/fmoo/5f5787d2a22a3252405d3c75f3ef15ff
The behavior swaps out 10 random quads on the target layer with 10 random tiles selected from the source layer every behavior Update()
.
Here's a screenshot of the issue when the mesh is not preprocessed to remove optimizations:
As you can see, while some of the tiles render correctly, others have been corrupted with the source texture stretched at weird angles. As stated before, this is because those tiles on the original mesh had previously been adjacent to their same neighbors as on the source texture, so the underlying mesh shared vertices (and uv values); When one neighbor gets swapped to a tile that is no longer adjacent, the neighbors' shared uvs move to the non-neighboring part of the source texture, causing the texture to render an unexpected region to the neighboring triangles.
from tiled2unity.
Thanks, my schedule may keep me away from checking this is out as soon as
I'd like but I'll see if there's an easy fix eventually.
Best,
Sean
On Fri, Jun 3, 2016 at 11:49 AM, Peter Ruibal [email protected]
wrote:
Sorry for the confusion, they're definitely .obj files, not .dat files.
I've created a gist that explains the issue a bit better and provides the
behavior and support classes to repro here:
https://gist.github.com/fmoo/5f5787d2a22a3252405d3c75f3ef15ffThe behavior swaps out 10 random quads on the target layer with 10 random
tiles selected from the source layer every behavior Update().Here's a screenshot of the issue when the mesh is not preprocessed to
remove optimizations:
[image: selection_919]
https://cloud.githubusercontent.com/assets/143504/15785992/13fb69de-296f-11e6-8cb5-66c797ca7ca3.pngAs you can see, while some of the tiles render correctly, others have been
corrupted with the source texture stretched at weird angles. As stated
before, this is because those tiles on the original mesh had previously
been adjacent to their same neighbors as on the source texture, so the
underlying mesh shared vertices (and uv values); When one neighbor gets
swapped to a tile that is no longer adjacent, the neighbors' shared uvs
move to the non-neighboring part of the source texture, causing the texture
to render an unexpected region to the neighboring triangles.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#37 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AGqEFtQPpVSCItFBhe4c_4nWEdtet4lyks5qIFr_gaJpZM4IsQjS
.
from tiled2unity.
Thanks Sean, I'll reopen this just so it's less likely to get lost. Feel free to close it out if it looks like it's an optimization unity is making on their end and doesn't make sense to try to work around.
from tiled2unity.
Sorry I haven't fully resolved this yet but I do have a working solution I hope to put into Tiled2Unity soon.
What I'd really like to do is have the model importer settings automatically assigned for you during export (Optimize Mesh disabled, Vertices Readable/Writable enabled, Keep Quads enabled, etc.) when you choose this option. Unfortunately, Unity does not make the "Keep Quads" option available through script. However, I did enter a bug with Unity and have heard back that they plan to address that soon.
I probably won't wait on that bug fix before deploying this but I'll keep an eye out for it regardless.
Anyways, more to come, soon.
from tiled2unity.
FWIW, I haven't lost sight of this. I still need Unity to make the "isWriteable" flag exposed to scripting on the ModelImporter class.
from tiled2unity.
Related Issues (20)
- Error Report HOT 22
- Tileset file does not exist HOT 4
- Object reference not set as an instance while parsing layer data as Xml elements. HOT 3
- Tiled2Unity: “Object reference not set to an instance of an object” HOT 5
- After recent update: FileNotFoundException and NullReferenceException, import stalls forever
- Preview scale?
- Tiled2Unity doesn't import map with textures into Unity
- Error Finding Textures HOT 3
- Animations won't play on objects on Object Layers HOT 5
- Tiled2Unity exports only .xml and creates no prefab / Preview complains about index out of range HOT 2
- "The object you are trying to replace does not exist or is not a Prefab." HOT 6
- Unity Android and Tiled2Unity Blurred Textures Issue HOT 2
- ICustomTiledImporter not called
- Warning: Rectangle has no width/height HOT 2
- Importing map problem. Getting error missing texture HOT 4
- Issue HOT 2
- Vertex numbers in meshes changing into "Infinity" or "NaN" after export HOT 2
- After i export a map with tiled i find it on prefab HOT 1
- How do i fix these compiler errors? HOT 1
- Tiled- why does it say it cant find my files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiled2unity.