SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
84 stars 18 forks source link

Separate materials shared between items and barricades/structures #4348

Open sunnamed434 opened 4 months ago

sunnamed434 commented 4 months ago

This happens only when you have enabled one option in settings: Graphics -> Render Mode -> Deferred [Recommended]

image

When I also damage the Pine Floor (id: 52), it shows that I likely damage Metal Floor (id: 369), it must be damage to Pine, it is also weird when another player moves (back and forward) the hits weirdly going on top of the item that player holding in hands

https://github.com/SmartlyDressedGames/Unturned-3.x-Community/assets/65300126/6e043d7c-b192-46ac-8fbd-c8717636c5ba

SDGNelson commented 4 months ago

This is because in forward mode there are flat planes used for decals, whereas in deferred mode they project within a box. The bullet holes are a bit taller than might be ideal, but IIRC it's necessary for some objects with relatively big discrepancy between collision and visual.

I suppose the item and structure models share a material, and then when I added support for attaching decals to moving objects - including structures - and enabled decals on them the items inherited that as well. I should go separate out materials for items from the structures.