godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.09k stars 21.14k forks source link

Possible bug in Godot 4 rendering of textures . . . #52777

Open charlesmlamb opened 3 years ago

charlesmlamb commented 3 years ago

Godot version

Godot 4.0 60d67f93c

System information

Windows 10, Vulkan, nVidia RTX 3070 . . .

Issue description

There's a weird error, in the rendering, compared to Blender, it looks like the pixels aren't rendered, as one might suspect, here . . .

Skærmbillede (2245)

Compare Blender, that looks to have better rendering, in Eevee . . .

Skærmbillede (2246)

For some reason, the texture looks pixelated, also at run-time, where it's really noticable, at 720p resolution . . .

Not sure it's a bug, it looks like a few steps back, from what I'd expect, thanks . . . .

Steps to reproduce

Well, just imported a .glTF from Blender, and it looked really pixelated, and well some-what worse, than Blender, in terms of texture details or, rendering . . . .

Minimal reproduction project

Well, I think any 3D model, esp. with small details, would look the same, not sure if it's a setting I'm not setting, anti - aliasing, some quality setting, thanks . . . .

charlesmlamb commented 3 years ago

Uh, here, can't see in image, after scaling . . . .

Skærmbillede (2245)

Wait, need to click the image, to see it, not sure if it's intentional, looks a bit weird, can't see in scaled down pictures, need to click or, so . . . .

Add, it's like pixels are missing, compared to Blender, that's all . . . .

aaronfranke commented 3 years ago

Try changing the anti-aliasing setting in your project settings.

Calinou commented 3 years ago

According to the screenshot, MSAA is already being used. You could enable FXAA on top of that (set Screen Space Aa to FXAA in the advanced project settings). That said, the issue looks like it's related to texture mipmapping instead. Alternatively, it could also be due to alpha scissor transparency being used without the alpha antialiasing property being enabled in StandardMaterial3D.

If this is due to mipmapping, this is likely a duplicate of https://github.com/godotengine/godot/issues/49981. (Can you reproduce this if you reimport the texture with Lossless compression instead of VRAM Lossy?)

charlesmlamb commented 3 years ago

Uhh, tried disabling AA from 4 x, to 0 x, result is the same . . .

AA 4x . .

Skærmbillede (2248)

AA 0x . .

Skærmbillede (2249)

Uhh, the textures are in .glTF, afaik I can't reimport the textures, they're stored in the materials . . . I need to make .obj, and export textures, then . . .

Here's how it looks, with 720p, at runtime, using viewport mode, from 720p, to a 4K monitor, goal is make 720p games . . . .

Skærmbillede (2251)

Tried enabling 4x AA, and FSAA, looks sort-of same, or worse . . .

charlesmlamb commented 3 years ago

Also, not sure if this is supposed to happen, it just looks very different from Blender, where one can see the barbarian battle-uniform ( thong ), when zoomed out, ie. no pixels missing, maybe it's supposed to look that way, it's just very different from Blender, where zooming camera, well this doesn't happen . . .

charlesmlamb commented 3 years ago

Ok, tried making an .obj, and exporting texture, for some reason can't use normal ' material ' in the mesh, it just makes 3D model black, used Surface Override Material, and it looks fine, but .obj don't store animations, so yikes . . . .

Skærmbillede (2252)

.glTF left ( missing pixels, on the clothes / thong ) vs. .obj, on right . . . .

Not sure what happens, bit annoying if .glTF isn't supported, but it is working, just not in .glTF, maybe my 3D model is bit weird, or the texture has very narrow line, of pixels, it's just different from Blender, at least, thanks . . . .

charlesmlamb commented 3 years ago

Made a reference, where model is white, with black lines, similar thickness to bikini, thong . . . Looks quite bad, here, ie. all those black lines, actually go all way around model, in Blender, no missing pixels, like .obj . . . .

Skærmbillede (2253)

First picture, .glTF, with black lines, on white model, second picture, export from Blender, .glTF, third picture, export .obj, add texture manually, looks good . . .

Well, not sure, think the 3D models look bit better, like the .obj, or in Blender, looks to be .glTF problem, not .obj . . . .

Anyway, if this is a mipmap thing, it's weird the .obj with the same texture, looks fine, unless there's some difference between mipmap rendering, for a .glTF, vs. .obj after import . . The island margin is 12 pixels, for a 2560 texture, also normally mipmap errors occur near the seams, afaik there are no seams, where the texture is, need to check . . . .

Add, the .obj was imported with VRAM compression, so it looks fine with that NOT set to on, ie. for .obj the problem isn't lossless compression, or so . . .

charlesmlamb commented 3 years ago

Ok, made a .gif, think it shows it better . . .

Animation (23)

First is .glTF, made for reference, white model, black lines across model, same thickness as thong, weird artifacts, I say it's 'missing pixels ', same thing for middle, is .glTF, to the right is an .obj, with SAME texture, imported, have tried with both Lossy VRAM and, lossless, and .obj looks the same . . . Well, it works for .obj, so there are no problems, it may be some weird optimization, in .glTF, or so . . .

charlesmlamb commented 3 years ago

This might be dumb, imported the 3D model, made an instanced scene, of .glTF, and used surface material over-ride, and it worked fine . . .

Animation (24)

Well, looks to be a smaller problem, somewhere in .glTF material importer, or not sure . . . .

At least, there's a work-around, also making a barbarian title, so uhh they don't have that much clothes, sorry lol . .