Archive 17/01/2023.

Porting projects from Unity to Urho

glebedev

I’ve put together working unity script to convert Unity assets into Urho assets.

Here is how result looks like at the moment:


Just open a package manager in unity and add the package from git URL:
image

The URL is: https://github.com/gleblebedev/Unity2Urho.git

Video instructions:

How add it to Unity project:

How to create MDL file with LODs:

Exporting animation:

Skyboxes and reflection probes:

johnnycable

Interesting. Can I ask you why are you changing for Urho from Unity? Urho is lightweight in respect to Unity, and no plugins…

glebedev

I don’t like Unity. Every time I’ve joined a Unity-centric team on a game jam it ended up being a disaster.

On other hand I love UrhoSharp - this is exactly what I need in my pet projects. Urho seems to be a small and efficient, not bloated with unnecessary features and very extendable.

So I would say it’s a personal preference.

johnnycable

Think the same, some tools are unnecessary heavy…

coldev

thanks for this usefull script…

glebedev

Transparency fixed + technique selection improved:

glebedev

Now with heightmaps for terrain

glebedev
smellymumbler

Can you post the originals for comparison? Lighting sucks in Urho. :frowning:

smellymumbler

Also, what’s with the artifacts?


glebedev

I think these artifacts appear due to dynamic lighting. Unity use lightmaps and I don’t know yet how to export them correctly. Vanila Urho doesn’t support lightmaps as they should be shared among multiple meshes.

Original assets utilize PBR rendering. I failed to extract cubemaps - Unity doesn’t allow to read them in editor :frowning:

The latest source is available by the original link. You can try it on any other unity asset you have and report any issues you found.

The same asset in Unity and Unreal:

glebedev

I’m looking for someone who would help me to make the best Urho can deliver from the assets. The very first question people ask me about Urho3D - what level of graphics it could deliver. I believe that with right assets and shaders it could be quite good.

rasteron

It does, but diffuse only and with alpha.

CoreData/Techniques/DiffLightMap.xml
CoreData/Techniques/DiffLightMapAlpha.xml

glebedev

I mean: It does but not in a practical way. I can’t create a unique material for each mesh in the scene. I should be able to keep original material + pass a second stream of UVs and lightmap texture for each static model.

The easiest way from my perspective at the moment - to merge all static geometry during the export and then put it in the scene as a single static model with generated materials based on original + lightmap. It’s 100% doable… But I just don’t have much time to do it. I want to make a small game first and as a result I’m updating the export script only when I need to add something that my game needs.

rasteron

You can use different materials and share one lightmap texture on 2nd UV. Merging objects or a single mesh is of course great for mobiles or optimization.

smellymumbler

Yeah, it definitely doesn’t look as good as it could be. But it’s not just the lightmap, IMO. The materials all look like plastic. Are they using the same specular configuration? Or do they have specular maps? Is Urho configured to read the speculars?

As for artifacts, they shouldn’t happen. Unity also has dynamic lighting and that does not occur. Same for other engines, like Ogre. Maybe it’s the shadowmapping configuration needing some tweaks?

monkeyface

I gave this a try with the Unity viking demo scene but my results weren’t so successful :frowning:

image

glebedev

And a year later I’ve made some improvements to the script:

I’ll publish the fixed version later

glebedev

Source code and unity asset are now available on github:

smellymumbler

That’s super useful. Thanks a lot for the hard work!

glebedev

… And couple years later I’ve made few fixes for PBR compatibility:

glebedev

I know 3 years passed… May I ask you to try again? I’ve fixed a lot of small issues and now it should be way better.

glebedev

Now it converts all textures to compressed DDS format. it makes project loading times shorter.

HeadClot

Hey is there a specific version of unity that I should use? Just curious :slight_smile:

glebedev

I would guess any 2017+ version should work. If you have any troubles - open a ticket on GitHub.

HeadClot

Noted and will do :slight_smile:

glebedev

New feature: now it exports terrain trees. Also custom geometry naming is kinda fixed so you can export rivers and roads generated with R.A.M.

coldev

thank you very very very very much :grinning:

glebedev

glebedev

Now exporter support LODgroup. Only works with static geometry at the moment.

elix22

I played with this tool a little bit.
Amazing stuff !!
Found some issue ,
Disabled components in Unity are not disabled in Urho3D .
For example disabled “Mesh Renderer” in Unity , Static model is shown in Urho3D.
The exported components are missing the “Is Enabled” attribute
Every disabled component should have the following attribute.

attribute name=“Is Enabled” value=“false”

Thanks for sharing this amazing tool

glebedev

May I ask you to open an issue on GitHub? I may forget to fix it otherwise.

elix22

Sure
Done