Closed Narann closed 9 years ago
A tiny commit that should fix most of the problems: https://github.com/Narann/mupen64plus-video-rice/commit/6b9b76c57e5cbb98a57568382bda8ade282d1188
I will close this issue. I'm sure there is still some filtering problems here and there but it's no more completely broken. Each future broken filtering should have its own ticket.
...and I finally understood why!
So, as you maybe know, OpenGL bind filtering parameter per Textures.
While, on the N64 side, texture filtering is a global parameter and not texture dependent:
The function
ApplyTextureFilter()
apply the filter values to the current binded OpenGL textures. Of course, each time it does it you can be sure the binded texture change and potentially lost the filter you set on it... This is why this function is called almost everywhere in the code. Just go here and to a search).For the test, I've tried to apply the wanted filter on every OpenGL texture each time CRender::SetTextureFilter() is called. The could looked like:
old
bindTexture(i)
setParameter(min and max filtert to the wanted value)
bindTexture(old)
Kind of brute force... This bring to massive slowdown but totally fix the problem.
Notice this is "fixed" by new OpenGL version, see gtruc review for more info. It's so simple I'm so sad to need to do a workaround...
I have multiple ways to fix this problem:
SetTextureFilter()
is called...ApplyTextureFilter()
and see if another texture could be bound between the filtering change and the draw call. It's far from perfect...There is other options, I'm still investigating. I also notice Rice does not have any place where texture are explicitly bound. For example, removing the texture binding from
SetTextureUFlag()
(which is only supposed to put some UV flags) make almost every texture blacks. This mean the textures are only binded at this place...