-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DXT textures have black mipmap levels (Windows, DirectX) #1783
Comments
Hum.... @KonajuGames will have to respond to this one. My understanding at the time was that this was required for both DX and GL, but I could be wrong. |
It may well be an OpenGL only requirement. If you wish to submit a pull |
We have similar problems on OpenGL as well... we were dealing with this in Gateways on MG-SDL2 after adding S3TC support, made a quick (read: bad and awfully slow) fix in MG-SDL2: https://github.com/flibitijibibo/MonoGame/blob/monogame-sdl2/MonoGame.Framework/Content/ContentReaders/Texture2DReader.cs#L245 The w/h checks don't seem to affect things either way for us. |
Thanks for the quick replies. We will make some more tests and create a pull request which updates the DirectX paths in Texture2D and TextureCube. |
Something else I have found (which is not addressed in the pull request):
AFAIK, DXT textures only have to be a multiply of 4. It is not required that they are POT. And NPOT DXT textures seem to work fine (when you ignore the assert messages). (Tested on Windows desktop (DX and OpenGL) and Windows Store.) |
In XNA, DXT was required to be POT when using the Reach graphics profile I believe PVRTC requires POT. ETC1 likely same as DXT as it is 4x4 |
Thanks for the info. |
Fixed black mipmap levels in DXT textures (DirectX) - Issue #1783.
In our Windows/DirectX application the lowest resolution mipmap levels of DXT textures are black.
There is following code in Texture2D:
(https://github.com/mono/MonoGame/blob/450733b035add1a359033a0aefdc5dc2ea6fa2af/MonoGame.Framework/Graphics/Texture2D.cs#L327-L340)
Without
if (w > 4)
andif (h > 4)
the textures are displayed correctly (in DirectX).I believe those if statements were added in following commit by @KonajuGames: 620642b.
It seems the ifs are needed for OpenGL, but not for DirectX.
Was this change tested with DirectX or only with OpenGL?
P.S. I guess TextureCube has the same problem.
The text was updated successfully, but these errors were encountered: