Mesh Replacement Test

Show off your mod creations or just a work in progress.
Post Reply
User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Mesh Replacement Test

Post by TheLacus »

Thank you :D
I have already met the tilemap ground with the grass mod, that's an interesting system you have there.

For now I'm starting working with sprites, from what i have seen "getting around" the atlas importing directly new materials in DaggerfallBillboard and DaggerfallBillboardBatch look promising, but maybe it's not the cleanest way.

In the meanwhile, i imported a few render i found on the internet in the atlas for fun, and i have to say it would be awesome if someone would do a retexture of trees like that.
Image

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Mesh Replacement Test

Post by TheLacus »

Ok, this is the current situation:

The game can import .IMG, .CIF and .RCI. I couldn't test a lot of the latter ones but it should work fine with all .img.
  • 'filename.png' (ex: MAP100I0.IMG.png) in Daggerfall Unity\textures\img
  • 'filename_record-frame.png' (ex: INVE16I0.CIF_3-0.png) in Daggerfall Unity\textures\cif
It can import textures and interiors sprites from Daggerfall Unity\textures ('archive_record-frame.png', for example 9_1-0.png). I still need to work on exteriors sprite and emission/bump map.
This part could really benefit from a better optimization, but since textures for billboards are loaded into an atlas it's not straightforward.

Models can be replaced if they are placed in resources during compile, they use the appropriate textures depending on season and, as suggested by interkarma, they use the same filter type as vanilla models.

script_10-12-2016 download

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Mesh Replacement Test

Post by Nystul »

nice trees (and nice horse :D)

User avatar
Interkarma
Posts: 7244
Joined: Sun Mar 22, 2015 1:51 am

Re: Mesh Replacement Test

Post by Interkarma »

Interkarma wrote:Nice work! This shows some real promise.

As Nystul mentioned, the ground tile textures are built into a specialised atlas for the tilemap shader. You can read about how this works here. The atlas pre-transforms (rotates and flips) all the tiles ahead of time and generates extra data to simulate wrapping or clamping depending on the tile. This allows the shader to blast out any number of tiles very quickly to a single quad in one draw call.

So changing the terrain textures is definitely possible - but would need a lot of extra work to overhaul the terrain system. The current tilemap setup is also dependent on Daggerfall's small tile texture size for everything to fit into a single atlas per climate zone. Larger textures would quickly blow out the max atlas size. A whole new approach will probably be needed by this point.
I just wanted to update this and suggest that it should be possible to revamp the terrain tiling system to use texture arrays, a new feature in Unity 5.4. This might overcome some of the problems inherent to the atlas setup and allow for easier replacement of these tile textures at runtime.

It's definitely something to investigate in detail as this kind of modding gains traction.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Mesh Replacement Test

Post by TheLacus »

  • support for custom emission maps.
MeshReplacementScript_15_12_2016

Interkarma, do you think it's time i commit the part of the code for textures to github? The whole replacement thing should get a revision on a larger scale for a better optimisation and to include sprites, maybe taking advantage of this new functionality, but as of now the script does its simple job for textures and UI images.
I think we could start to implement it for the HD UI and maybe take the occasion to contact the authors of Daggerxl texture pack, but it's up to you decide what is best :)

User avatar
Interkarma
Posts: 7244
Joined: Sun Mar 22, 2015 1:51 am

Re: Mesh Replacement Test

Post by Interkarma »

Sorry for late reply. :)

Yep, happy for you to send me a PR for mesh and texture replacement scripts into core if you like. I'd enjoy seeing more progress with this, and being on git means anyone can add to it.

User avatar
Bloodinfested
Posts: 8
Joined: Sat Dec 24, 2016 5:02 am

Re: Mesh Replacement Test

Post by Bloodinfested »

Nice work TheLacus!
This might be a good time to post this since you guys are talking about textures. I really just started to mess around with some textures I prefer to keep more of the original look so I upscaled and manipulated the original textures. I started in 512x512 mainly for performance reasons although I could easily change that to 1024 at this point. They also use to be much sharper but added blur personally find it easier on the eyes in game. TEXTURE.022 (Desert Dungeons A)

Image

Image

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Mesh Replacement Test

Post by Nystul »

wow these look gorgeous!

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Mesh Replacement Test

Post by TheLacus »

Hey, good work with these textures!

User avatar
tyhender
Posts: 15
Joined: Thu Feb 23, 2017 5:58 pm

Re: Mesh Replacement Test

Post by tyhender »

Damn,this would look so good in game!
But trees seem a little bit too bright,don't you think so?

Post Reply