Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken skybox when one of the face have a different size than the others #142

Closed
illwieckz opened this Issue Nov 23, 2018 · 5 comments

Comments

3 participants
@illwieckz
Copy link
Member

illwieckz commented Nov 23, 2018

This a bug I first faced while porting maps from Tremulous for my InterstellarOasis initiative. At this time I workarounded the bug by modifying the skyboxes, but it's just a one-shot workaround and not a fix.

So, what's the issue? Sometime some skyboxes have one face with a different size than the others, usually the bottom one is smaller since it's unseen from the player point of view because of the floor of the map itself. Quake3 mods looked to rely on this trick to save file space (especially when pictures where shipped uncompressed and bandwith was low).

Have a look at the alamo skybox by Joe Kari from Smokin' Guns:

smaller face

The skybox rendering is broken:

broken alamo skybox

To reproduce the issue it's possible to download some preview dpks of Smokin' Guns assets this way:

wget -O- http://gg.illwieckz.net/dl/smokinguns/dev/SmokinGunsAssets.get | xargs wget

and load the dm-alamo map this way:

/set g_neverEnd 1
/devmap dm-alamo

There is no such issue in idtech3 derivated games like Tremulous or Smokin' Guns so this looks to be a regression (it can even predate Unvanquished if introduced by XreaL/ET:XreaL, I don't know).

@illwieckz illwieckz added this to To do in Smokin' Guns via automation Nov 23, 2018

@t4im t4im added the Renderer label Nov 24, 2018

@bofh80

This comment has been minimized.

Copy link

bofh80 commented Mar 2, 2019

so after a bit of digging around here comes a link again. http://www.dersaidin.net/xreal/docs/ seems dersaidin took the time to archive the wiki contents. Textureguidelines Shadermanual etc. Not sure if you had access to them before. they might help. it might just be that the shader needs corrected for the skybox to work.

@illwieckz

This comment has been minimized.

Copy link
Member Author

illwieckz commented Mar 2, 2019

it might just be that the shader needs corrected for the skybox to work.

If we have to edit the shader or the image (we have verified that editing the image works), it's a regression. Fixing the asset is not an option at this point, the issue is not that the engine is not able to render skyboxes, the issue is that the engine is not able anymore to render skyboxes that worked before.

Thanks for the link, I also knew https://tremap.xtr3m.net/__Games/Xreal/Manual_Shader_1/ShaderManual.htm :-)

@bofh80

This comment has been minimized.

Copy link

bofh80 commented Mar 4, 2019

The only extra remark that might help explain some things was that for a lot of testing, especially normal q3a assets you had to use the compatq3 or similar switches. I'm not sure that was true for etxreal though.
When i ran into issues like this (with q3a assets) i was basically told xreal wasn't designed to be backwards compatible so to remake the assets/shaders as required. again disparity between etxreal/xreal this might not be true :) (as i still can't remember which engine got ported for this)

And while this isn't exactly helpful, in sorting it out, it might explain other odities you've noticed.

@illwieckz

This comment has been minimized.

Copy link
Member Author

illwieckz commented Mar 4, 2019

Yeah, knowledge is helpful in any way. And yes XreaL did not care so much about upstream compatibility, especially in the end with doom3 stuff. Btw this is the kind of simple feature we must be ok to take care.

as far as I know Dæmon as lineage on etxreal, there is wolf:et bits and some doom3 related stuff (like surface keywords) in it.

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 5, 2019

fix quake3 skybox with small bottom face, fix DaemonEngine#142
some quake3 skyboxes were shipped with a smaller bottom face,
for example a 16×16 bottom face while other faces were 512×512
that was probably a trick to save file size when textures were
stored losslessly in a tga and bandwith was low as voice modems

to fix this, a new function R_Resize is added to tr_image.cpp
and the size of the first face is stored, then if the fith
face (bottom face) has a different size, this one is resized
before being submitted for cube image creation

note that the resizing is very naive, a warning is displayed
so the user is encouraged to fix the skybox

in any way, those kind of small bottom faces were likely
to not be seen, that's also why they were downscaled

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 5, 2019

fix quake3 skybox with small bottom face, fix DaemonEngine#142
some quake3 skyboxes were shipped with a smaller bottom face,
for example a 16×16 bottom face while other faces were 512×512
that was probably a trick to save file size when textures were
stored losslessly in a tga and bandwith was low as voice modems

to fix this, a new R_Resize function is added to tr_image.cpp
and the size of the first face is stored, then if the fith
face (bottom face) has a different size, this one is resized
before being submitted for cube image creation

note that the resizing is very naive, a warning is displayed
so the user is encouraged to fix the skybox

in any way, those kind of small bottom faces were likely
to not be seen, that's also why they were downscaled at first
@illwieckz

This comment has been minimized.

Copy link
Member Author

illwieckz commented Mar 5, 2019

See #179 for a PR implementing a fix:

fixed alamo skybox

fixed alamo skybox

ping @gbougard

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 5, 2019

fix quake3 skybox with small bottom face, fix DaemonEngine#142
some quake3 skyboxes were shipped with a smaller bottom face,
for example a 16×16 bottom face while other faces were 512×512
that was probably a trick to save file size when textures were
stored losslessly in a tga and bandwith was low as voice modems

to fix this, a new R_Resize function is added to tr_image.cpp
and the size of the first face is stored, then if the fith
face (bottom face) has a different size, this one is resized
before being submitted for cube image creation

note that the resizing is very naive, a warning is displayed
so the user is encouraged to fix the skybox

in any way, those kind of small bottom faces were likely
to not be seen, that's also why they were downscaled at first

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 5, 2019

fix quake3 skybox with small bottom face, fix DaemonEngine#142
some quake3 skyboxes were shipped with a smaller bottom face,
for example a 16×16 bottom face while other faces were 512×512
that was probably a trick to save file size when textures were
stored losslessly in a tga and bandwith was low as voice modems

to fix this, a new R_Resize function is added to tr_image.cpp
and the size of the first face is stored, then if the fith
face (bottom face) has a different size, this one is resized
before being submitted for cube image creation

note that the resizing is very naive, a warning is displayed
so the user is encouraged to fix the skybox

in any way, those kind of small bottom faces were likely
to not be seen, that's also why they were downscaled at first

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 5, 2019

fix quake3 skybox with small bottom face, fix DaemonEngine#142
some quake3 skyboxes were shipped with a smaller bottom face,
for example a 16×16 bottom face while other faces were 512×512
that was probably a trick to save file size when textures were
stored losslessly in a tga and bandwith was low as voice modems

to fix this, a new R_Resize function is added to tr_image.cpp
and the size of the first face is stored, then if the fith
face (bottom face) has a different size, this one is resized
before being submitted for cube image creation

note that the resizing is very naive, a warning is displayed
so the user is encouraged to fix the skybox

in any way, those kind of small bottom faces were likely
to not be seen, that's also why they were downscaled at first

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 6, 2019

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 6, 2019

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 6, 2019

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 6, 2019

fix quake3 skybox with small bottom face, fix DaemonEngine#142
some quake3 skyboxes were shipped with a smaller bottom face,
for example a 16×16 bottom face while other faces were 512×512
that was probably a trick to save file size when textures were
stored losslessly in a tga and bandwith was low as voice modems

to fix this, a new R_Resize function is added to tr_image.cpp
and the size of the first face is stored, then if the fith
face (bottom face) has a different size, this one is resized
before being submitted for cube image creation

note that the resizing is very naive, a warning is displayed
so the user is encouraged to fix the skybox

in any way, those kind of small bottom faces were likely
to not be seen, that's also why they were downscaled at first

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 6, 2019

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 9, 2019

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 9, 2019

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 9, 2019

@illwieckz illwieckz closed this in 58342ad Mar 10, 2019

Smokin' Guns automation moved this from To do to Done Mar 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.