Fix: 渲染错误

main
wuyize 2023-04-05 13:00:56 +08:00
parent b249eff8f4
commit fb107870c2
3 changed files with 3 additions and 4 deletions

View File

@ -50,6 +50,8 @@ void main()
gNormal = getNormalFromMap();
else
gNormal = Normal;
if(!gl_FrontFacing)
gNormal = -gNormal;
if(texture_metallic_roughness_available)
gMetallicRoughness = texture(texture_metallic_roughness, TexCoords).bg;
else

View File

@ -204,9 +204,6 @@ void main()
vec3 V = normalize(camPos - worldPos);
if(dot(V, normal)<0)
normal = -normal;
vec3 F0 = vec3(0.04);
F0 = mix(F0, albedo, metallic);

View File

@ -91,7 +91,7 @@ void PaintingUtil::handleLayerWrapper(LayerWrapper* nowLayer, QTransform transfo
//qDebug() << leafLayer<<"------" << painterPath;
// transform to -1£¬ 1
QTransform trans;
double maxLen = (std::max(bound.width(), bound.height()) + 2 * maxWidth) * 1.00001 * 2;
double maxLen = (std::max(bound.width(), bound.height()) + 2 * maxWidth) * 1.00001 / 2;
//qDebug() << maxLen << bound;
trans.scale(1 / maxLen, 1 / maxLen);
trans.translate(-bound.center().x(), -bound.center().y());