ZDoom / Raze

Build engine port backed by GZDoom tech. Currently supports Duke Nukem 3D, Blood, Shadow Warrior, Redneck Rampage and Powerslave/Exhumed.
691 stars 59 forks source link

[BUG] [SW] Voxels are invisible #708

Closed Talon1024 closed 2 years ago

Talon1024 commented 2 years ago

Raze version

Git master b1cbecf268e6716dcec218602499391d828ada6f

Which game are you running with Raze?

Shadow Warrior

What Operating System are you using?

Linux x86_64

Please describe your specific OS version

Kubuntu 20.04

Relevant hardware info

Intel i5-4690K CPU, NVidia GeForce GTX 970 GPU

Have you checked that no other similar issue already exists?

A clear and concise description of what the bug is.

Voxels are invisible. I had to turn voxels off in order to see the things.

Even though the game is Shadow Warrior, Duke3D and Blood are affected as well. With Duke3D and the ERP, only the sprites show up, even if voxels are turned on.

Steps to reproduce the behaviour.

Explain how to reproduce

  1. Start a game that has voxels (Blood or Shadow Warrior)
  2. Go to where a sprite/voxel should be
  3. The voxels do not show up

Your configuration

No response

Provide a Log

Unable to load voxel from Sw.grp:MEDPAK.KVX
Unable to load voxel from Sw.grp:MEDKIT.KVX
Unable to load voxel from Sw.grp:UZI.KVX
Unable to load voxel from Sw.grp:GRENADE.KVX
Unable to load voxel from Sw.grp:GUNBARL.KVX
Unable to load voxel from Sw.grp:CAMERA.KVX
Unable to load voxel from Sw.grp:40MMBOX.KVX
Unable to load voxel from Sw.grp:MINES.KVX
Unable to load voxel from Sw.grp:SHOTGUN.KVX
Unable to load voxel from Sw.grp:ROCKET.KVX
Unable to load voxel from Sw.grp:SHTGAMMO.KVX
Unable to load voxel from Sw.grp:RCKTAMMO.KVX
Unable to load voxel from Sw.grp:TOOLS.KVX
Unable to load voxel from Sw.grp:UZICLIP.KVX
Unable to load voxel from Sw.grp:NITEVIS.KVX
Unable to load voxel from Sw.grp:RAILGUN.KVX
Unable to load voxel from Sw.grp:RAILPAK.KVX
Unable to load voxel from Sw.grp:ARMOR.KVX
Unable to load voxel from Sw.grp:STAR.KVX
Unable to load voxel from Sw.grp:HEAT.KVX
Unable to load voxel from Sw.grp:COIN.KVX
Unable to load voxel from Sw.grp:HEART.KVX
Unable to load voxel from Sw.grp:HEART2.KVX
Unable to load voxel from Sw.grp:UZISIDE.KVX
Unable to load voxel from Sw.grp:BOMB.KVX
Unable to load voxel from Sw.grp:SMOKE.KVX
Unable to load voxel from Sw.grp:FLASH.KVX
Unable to load voxel from Sw.grp:GOROHEAD.KVX
Unable to load voxel from Sw.grp:SHADOW.KVX
Unable to load voxel from Sw.grp:CALTROP.KVX
Unable to load voxel from Sw.grp:COOKIE.KVX
Unable to load voxel from Sw.grp:TECHKEY.KVX
Unable to load voxel from Sw.grp:OLDKEY.KVX
Unable to load voxel from Sw.grp:FLAG1.KVX
Unable to load voxel from Sw.grp:FLAG2.KVX
Unable to load voxel from Sw.grp:FLAG3.KVX
Unable to load voxel from Sw.grp:KEYCARD.KVX
Unable to load voxel from Sw.grp:OLDLOCK.KVX
Unable to load voxel from Sw.grp:OLDLOCK2.KVX
Unable to load voxel from Sw.grp:KCRDLCK1.KVX
Unable to load voxel from Sw.grp:KCRDLCK2.KVX
Unable to load voxel from Sw.grp:TCHKLCK1.KVX
Unable to load voxel from Sw.grp:TCHKLCK2.KVX
Unable to load voxel from Sw.grp:TCHKLCK3.KVX
Unable to load voxel from Sw.grp:OLDKEY.KVX
Unable to load voxel from Sw.grp:OLDKEY.KVX
Unable to load voxel from Sw.grp:OLDKEY.KVX
Unable to load voxel from Sw.grp:TECHKEY.KVX
Unable to load voxel from Sw.grp:TECHKEY.KVX
Unable to load voxel from Sw.grp:TECHKEY.KVX
Unable to load voxel from Sw.grp:KEYCARD.KVX
Unable to load voxel from Sw.grp:KEYCARD.KVX
Unable to load voxel from Sw.grp:KEYCARD.KVX
Unable to load voxel from Sw.grp:MINE.KVX
Unable to load voxel from Sw.grp:MINE2.KVX
Unable to load voxel from Sw.grp:MINE3.KVX
Unable to load voxel from Sw.grp:BUTTON1A.KVX
Unable to load voxel from Sw.grp:BUTTON1B.KVX
Unable to load voxel from Sw.grp:SWITCH1A.KVX
Unable to load voxel from Sw.grp:SWITCH1B.KVX
Unable to load voxel from Sw.grp:SWITCH2A.KVX
Unable to load voxel from Sw.grp:SWITCH2B.KVX
Unable to load voxel from Sw.grp:SWITCH3A.KVX
Unable to load voxel from Sw.grp:SWITCH3B.KVX
Unable to load voxel from Sw.grp:SWITCH4A.KVX
Unable to load voxel from Sw.grp:SWITCH4B.KVX
Unable to load voxel from Sw.grp:SWITCH5A.KVX
Unable to load voxel from Sw.grp:SWITCH5B.KVX
coelckers commented 2 years ago

fixed in fa53fcd0853f5f581e7b44f484bef45d9af2d646

Apparently the voxel loader depends on the allocated block being a bit larger.

vladkosi commented 2 years ago

Wouldn't it be better to fix the voxel loader?

See this comment FileData adds an extra 0 byte to the end. https://github.com/ZDoom/Raze/blob/master/source/common/models/voxels.cpp#L164

Remove the -1 from https://github.com/ZDoom/Raze/blob/master/source/common/models/voxels.cpp#L166

Same problem is in GZDoom.

mmaulwurff commented 2 years ago

For the record: https://github.com/ZDoom/gzdoom/issues/1715