mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 06:29:56 +00:00
HALF_FLOAT and normals changes
This commit is contained in:
parent
061f10bef7
commit
349931b5cd
3 changed files with 16 additions and 11 deletions
|
@ -409,10 +409,14 @@ namespace MWRender
|
||||||
|
|
||||||
mViewer->stopThreading();
|
mViewer->stopThreading();
|
||||||
|
|
||||||
auto& shaderManager = MWBase::Environment::get().getResourceSystem()->getSceneManager()->getShaderManager();
|
if (mNormalsSupported)
|
||||||
auto defines = shaderManager.getGlobalDefines();
|
{
|
||||||
defines["disableNormals"] = mNormals ? "0" : "1";
|
auto& shaderManager
|
||||||
shaderManager.setGlobalDefines(defines);
|
= MWBase::Environment::get().getResourceSystem()->getSceneManager()->getShaderManager();
|
||||||
|
auto defines = shaderManager.getGlobalDefines();
|
||||||
|
defines["disableNormals"] = mNormals ? "0" : "1";
|
||||||
|
shaderManager.setGlobalDefines(defines);
|
||||||
|
}
|
||||||
|
|
||||||
mRendering.getLightRoot()->setCollectPPLights(mPassLights);
|
mRendering.getLightRoot()->setCollectPPLights(mPassLights);
|
||||||
mStateUpdater->bindPointLights(mPassLights ? mRendering.getLightRoot()->getPPLightsBuffer() : nullptr);
|
mStateUpdater->bindPointLights(mPassLights ? mRendering.getLightRoot()->getPPLightsBuffer() : nullptr);
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace fx
|
||||||
{ "bgra", GL_BGRA },
|
{ "bgra", GL_BGRA },
|
||||||
} };
|
} };
|
||||||
|
|
||||||
constexpr std::array<std::pair<std::string_view, int>, 9> SourceType = { {
|
constexpr std::array<std::pair<std::string_view, int>, 10> SourceType = { {
|
||||||
{ "byte", GL_BYTE },
|
{ "byte", GL_BYTE },
|
||||||
{ "unsigned_byte", GL_UNSIGNED_BYTE },
|
{ "unsigned_byte", GL_UNSIGNED_BYTE },
|
||||||
{ "short", GL_SHORT },
|
{ "short", GL_SHORT },
|
||||||
|
@ -43,6 +43,7 @@ namespace fx
|
||||||
{ "int", GL_INT },
|
{ "int", GL_INT },
|
||||||
{ "unsigned_int", GL_UNSIGNED_INT },
|
{ "unsigned_int", GL_UNSIGNED_INT },
|
||||||
{ "unsigned_int_24_8", GL_UNSIGNED_INT_24_8 },
|
{ "unsigned_int_24_8", GL_UNSIGNED_INT_24_8 },
|
||||||
|
{ "half_float", GL_HALF_FLOAT },
|
||||||
{ "float", GL_FLOAT },
|
{ "float", GL_FLOAT },
|
||||||
{ "double", GL_DOUBLE },
|
{ "double", GL_DOUBLE },
|
||||||
} };
|
} };
|
||||||
|
|
|
@ -80,8 +80,8 @@ shared {
|
||||||
radius = max(radius, 0.1);
|
radius = max(radius, 0.1);
|
||||||
// hack: make the radius wider on the screen edges
|
// hack: make the radius wider on the screen edges
|
||||||
// (makes things in the corner of the screen look less "wrong" with not-extremely-low FOVs)
|
// (makes things in the corner of the screen look less "wrong" with not-extremely-low FOVs)
|
||||||
radius *= pow(texcoord.x*2.0-1.0, 2)+1.0;
|
radius *= pow(texcoord.x*2.0-1.0, 2.0)+1.0;
|
||||||
radius *= pow(texcoord.y*2.0-1.0, 2)+1.0;
|
radius *= pow(texcoord.y*2.0-1.0, 2.0)+1.0;
|
||||||
return radius;
|
return radius;
|
||||||
}
|
}
|
||||||
vec3 powv(vec3 a, float x)
|
vec3 powv(vec3 a, float x)
|
||||||
|
@ -94,7 +94,7 @@ render_target RT_NoMipmap {
|
||||||
width_ratio = 0.25;
|
width_ratio = 0.25;
|
||||||
height_ratio = 0.25;
|
height_ratio = 0.25;
|
||||||
internal_format = rgb16f;
|
internal_format = rgb16f;
|
||||||
source_type = float;
|
source_type = half_float;
|
||||||
source_format = rgb;
|
source_format = rgb;
|
||||||
mipmaps = false;
|
mipmaps = false;
|
||||||
min_filter = nearest;
|
min_filter = nearest;
|
||||||
|
@ -105,7 +105,7 @@ render_target RT_Horizontal {
|
||||||
width_ratio = 0.25;
|
width_ratio = 0.25;
|
||||||
height_ratio = 0.25;
|
height_ratio = 0.25;
|
||||||
internal_format = rgb16f;
|
internal_format = rgb16f;
|
||||||
source_type = float;
|
source_type = half_float;
|
||||||
source_format = rgb;
|
source_format = rgb;
|
||||||
mipmaps = false;
|
mipmaps = false;
|
||||||
min_filter = nearest;
|
min_filter = nearest;
|
||||||
|
@ -116,7 +116,7 @@ render_target RT_Vertical {
|
||||||
width_ratio = 0.25;
|
width_ratio = 0.25;
|
||||||
height_ratio = 0.25;
|
height_ratio = 0.25;
|
||||||
internal_format = rgb16f;
|
internal_format = rgb16f;
|
||||||
source_type = float;
|
source_type = half_float;
|
||||||
source_format = rgb;
|
source_format = rgb;
|
||||||
mipmaps = false;
|
mipmaps = false;
|
||||||
min_filter = linear;
|
min_filter = linear;
|
||||||
|
|
Loading…
Reference in a new issue