lewa-j / Unity-Source-Tools

Plugin to import resources from the Source engine in Unity3D.
GNU General Public License v2.0
109 stars 23 forks source link

Displacements Now Have Lightmaps #45

Closed Fronkln closed 3 years ago

Fronkln commented 3 years ago

Ported over from Source to Unity, tested and confirmed. Biggest contribution yet! image

image

Fronkln commented 3 years ago

There seems to be a super rare interesting bug with this. Some of the displacements are placed with wrong offset

image

Results in this: image

Should probably not be anything difficult to find out/fix? i sure as hell don't have any clue though

Fronkln commented 3 years ago

Not entirely sure but the UV's might need to be flipped by 90 degrees for displacements

lewa-j commented 3 years ago

Already solved this thing in a different project. Look here for reference https://github.com/lewa-j/vbsp-gles/blob/master/src/bsp_loader.cpp#L1014

Fronkln commented 3 years ago

Alright, i'll take a look

Fronkln commented 3 years ago

I believe its easier and better to just rewrite displacement code accordingly to the bsp loader you linked, i'll follow this up with another pull request if i manage to get it working

Fronkln commented 3 years ago

Managed to fix it commit tomorrow

Fronkln commented 3 years ago

SDK 2013 (Build2001 mod city_test03) (rubble displacements) image

Half-Life 2 Beta (quarry_town02) (entire road is a displacement) image

lewa-j commented 3 years ago

Fix identation and trailing spaces please.

Fronkln commented 3 years ago

I hate it when Github does this, i'll take a quick look

lewa-j commented 3 years ago

I has nothing to do with github. I believe the cause is your ide. Now we have mixed up spaces and tabs.

Fronkln commented 3 years ago

Visual studio is playing some big games with me right now, despite the code appearing normal in vs, i'll reopen this when im sure its fixed

I'm really sorry im puttin you through this

lewa-j commented 3 years ago

Try to open files in something like notepad++. It can show you where spaces and tab characters are

lewa-j commented 3 years ago

And instead of closing and opening new PRs, and creating many unnecessary commits, you should learn how to force push commits.