librw
librw copied to clipboard
Problem with Mipmaps in ReVC
I'm running it on a PlayStation Classic which is a armv7 device similar to a raspberry pi 3. When I have the engine convert the textures to optimal format like this:
It would produce corrupt textures like this. It seems to be a mipmap problem:
Seems like when it's in closer view, it looks correct, but when at a further distance it is skewed like its going bigger instead of smaller or something
Originally I followed MastaG's solution of disabling the convert textures and having it use the stock gta3.img. https://github.com/aap/librw/issues/71
This works however the game crashes often, like every 13 minutes. In this video clip it crashed 4 times in the span of 47 minutes https://www.youtube.com/watch?v=Eyuo2HqkHb4
The PSC only has 1gb of ram so I assume maybe it ran out of memory. However i found a solution by using magictxd. basically I have it clear the mipmaps and reconstruct the IMG archives
When I do this I am able to play for 2+ hours without crashing. Though it may still occasionally crash when there's a lot going on https://youtu.be/dzQbEmjE-Qk
So I was wondering if there's a way to edit the source code so that it generates the mipmaps properly? My theory is that it's going in the opposite direction, like a negative value is going the opposite direction. I don't know anything about programming I'm just guessing
My guess would be that the auto-generated mipmaps are buggy on that implementation of OpenGL. You could try getting rid of this code and see if it fixes anything:
if(level == 0 && natras->autogenMipmap)
glGenerateMipmap(GL_TEXTURE_2D);
My guess would be that the auto-generated mipmaps are buggy on that implementation of OpenGL. You could try getting rid of this code and see if it fixes anything:
if(level == 0 && natras->autogenMipmap) glGenerateMipmap(GL_TEXTURE_2D);
Sadly it still produce corrupt textures when I delete the code above. Got any other possible fixes? What's weird is Re3 and ReLCS convert textures and it has no issues
Have you found the solution? I have the same one. It just crops mipmaps instead of downscaling. And only on gles