HALF_FLOAT and normals changes

pull/3236/head
Jared Davenport 5 months ago committed by Cody Glassman
parent 061f10bef7
commit 349931b5cd

@ -409,10 +409,14 @@ namespace MWRender
mViewer->stopThreading();
auto& shaderManager = MWBase::Environment::get().getResourceSystem()->getSceneManager()->getShaderManager();
auto defines = shaderManager.getGlobalDefines();
defines["disableNormals"] = mNormals ? "0" : "1";
shaderManager.setGlobalDefines(defines);
if (mNormalsSupported)
{
auto& shaderManager
= MWBase::Environment::get().getResourceSystem()->getSceneManager()->getShaderManager();
auto defines = shaderManager.getGlobalDefines();
defines["disableNormals"] = mNormals ? "0" : "1";
shaderManager.setGlobalDefines(defines);
}
mRendering.getLightRoot()->setCollectPPLights(mPassLights);
mStateUpdater->bindPointLights(mPassLights ? mRendering.getLightRoot()->getPPLightsBuffer() : nullptr);

@ -35,7 +35,7 @@ namespace fx
{ "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 },
{ "unsigned_byte", GL_UNSIGNED_BYTE },
{ "short", GL_SHORT },
@ -43,6 +43,7 @@ namespace fx
{ "int", GL_INT },
{ "unsigned_int", GL_UNSIGNED_INT },
{ "unsigned_int_24_8", GL_UNSIGNED_INT_24_8 },
{ "half_float", GL_HALF_FLOAT },
{ "float", GL_FLOAT },
{ "double", GL_DOUBLE },
} };
@ -129,4 +130,4 @@ namespace fx
}
}
#endif
#endif

@ -80,8 +80,8 @@ shared {
radius = max(radius, 0.1);
// 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)
radius *= pow(texcoord.x*2.0-1.0, 2)+1.0;
radius *= pow(texcoord.y*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.0)+1.0;
return radius;
}
vec3 powv(vec3 a, float x)
@ -94,7 +94,7 @@ render_target RT_NoMipmap {
width_ratio = 0.25;
height_ratio = 0.25;
internal_format = rgb16f;
source_type = float;
source_type = half_float;
source_format = rgb;
mipmaps = false;
min_filter = nearest;
@ -105,7 +105,7 @@ render_target RT_Horizontal {
width_ratio = 0.25;
height_ratio = 0.25;
internal_format = rgb16f;
source_type = float;
source_type = half_float;
source_format = rgb;
mipmaps = false;
min_filter = nearest;
@ -116,7 +116,7 @@ render_target RT_Vertical {
width_ratio = 0.25;
height_ratio = 0.25;
internal_format = rgb16f;
source_type = float;
source_type = half_float;
source_format = rgb;
mipmaps = false;
min_filter = linear;

Loading…
Cancel
Save