Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/SkyManager.cpp
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | if (types[i] == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y || types[i] == GL_TEXTURE_CUBE_MAP_POSITIVE_Y) | ||||
rotated[(y*tex.m_Width + x) * 4 + 0] = data[(invy*tex.m_Width + invx) * 4 + 0]; | rotated[(y*tex.m_Width + x) * 4 + 0] = data[(invy*tex.m_Width + invx) * 4 + 0]; | ||||
rotated[(y*tex.m_Width + x) * 4 + 1] = data[(invy*tex.m_Width + invx) * 4 + 1]; | rotated[(y*tex.m_Width + x) * 4 + 1] = data[(invy*tex.m_Width + invx) * 4 + 1]; | ||||
rotated[(y*tex.m_Width + x) * 4 + 2] = data[(invy*tex.m_Width + invx) * 4 + 2]; | rotated[(y*tex.m_Width + x) * 4 + 2] = data[(invy*tex.m_Width + invx) * 4 + 2]; | ||||
rotated[(y*tex.m_Width + x) * 4 + 3] = data[(invy*tex.m_Width + invx) * 4 + 3]; | rotated[(y*tex.m_Width + x) * 4 + 3] = data[(invy*tex.m_Width + invx) * 4 + 3]; | ||||
} | } | ||||
} | } | ||||
glTexImage2D(types[i], 0, GL_RGB, tex.m_Width, tex.m_Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, &rotated[0]); | glTexImage2D(types[i], 0, GL_RGBA, tex.m_Width, tex.m_Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, &rotated[0]); | ||||
vladislavbelov: Do we actually need alpha here? | |||||
StanUnsubmitted Not Done Inline ActionsWe do not. Skybox textures shouldn't be transparent. Else I guess it would cause visual artifacts. The only case where they might need to be is if there are multiple (Ex mountains and stuff) over sky. That's currently not possible. Stan: We do not. Skybox textures shouldn't be transparent. Else I guess it would cause visual… | |||||
linkmauveAuthorUnsubmitted Done Inline ActionsBut all the files currently have an alpha channel, so unless we do a costly CPU-side conversion from RGBA8888 to RGB888 (for the driver to then do it in the other direction most likely, to get pixels aligned to 32-bit boundaries) we can’t avoid using RGBA here. Another solution would be to convert all textures from RGBA to RGB but they are already compressed so that’d lose even more quality. linkmauve: But all the files currently have an alpha channel, so unless we do a costly CPU-side conversion… | |||||
StanUnsubmitted Not Done Inline ActionsI guess it's fine then. Stan: I guess it's fine then. | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
glTexImage2D(types[i], 0, GL_RGB, tex.m_Width, tex.m_Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); | glTexImage2D(types[i], 0, GL_RGBA, tex.m_Width, tex.m_Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); | ||||
} | } | ||||
} | } | ||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | ||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | ||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | ||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | ||||
#if CONFIG2_GLES | #if CONFIG2_GLES | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Do we actually need alpha here?