[r195] Mip-Mapping usage threshold seems poorly implemented

Bugs will be moved here once resolved.

Post » Thu Jan 22, 2015 2:14 pm

Problem Description
Mip-Mapping seems to take effect way too early based only on the shortest side of a sprite when it would make more sense to use the longest side.

Attach a Capx
MipRubbish.capx


Description of Capx
Run as is, observe terrible pixellation:
Image

Switch to Low downsampling and observe way better result (although not ideal):
Image

Steps to Reproduce Bug
Use any Downsampling mode (Medium or High) that implements mip-mapping.

Observed Result
Mip-map appears to be picked poorly - based on the shortest edge of a sprite.

Expected Result
Mip-map should be picked based on the longest edge of a sprite.

Affected Browsers
[list]
[*] Chrome: (YES)


Operating System and Service Pack
Windows 7, 64bit

Construct 2 Version ID
r195
You do not have the required permissions to view the files attached to this post.
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

Post » Tue Jan 27, 2015 5:47 pm

As far as I am aware, this is not a bug, but just how mipmap selection works in OpenGL. Mipmaps generally improve downscaling quality, but at extreme aspect ratios (such as 1/4 as wide but 4 times taller) it picks the lower dimension to select the mipmap, and the reduced quality becomes apparent.

I don't think there's anything to be done here, it's just the normal working of OpenGL.
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Tue Jan 27, 2015 5:53 pm

Ashley wrote:I don't think there's anything to be done here, it's just the normal working of OpenGL.


So is the choice of which mipmap to use entirely up to OpenGL? Does C2 only supply the maps themselves or is there some additional information passed onto the renderer? I'd just like to know, since I haven't really encountered similarly poor results in any other software. And, clearly, the selection logic seems a little flawed, given the ugly results.
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

Post » Tue Jan 27, 2015 6:33 pm

The generation and selection of mipmaps is controlled entirely by OpenGL.
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Tue Jan 27, 2015 6:58 pm

Don't mean to bother you too much with all these questions, but may I ask what happens when setting the Downscaling quality option then - does it just switch some flags for the GL renderer?

I noticed that there is a bias option when drawing a texture in OpenGL:
"There is an optional third input parameter of the type float: bias. After calculating the appropriate level of detail for a texture with mipmaps the bias is added before the actual texture lookup operation is executed."

Is this also being affected in any way or is it completely up to the browser?
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests