Humble suggestion for fullscreen scaling:

Discussion and feedback on Construct 2

Post » Sat Dec 07, 2013 11:02 am

Yep don't get me wrong, I'm really happy and grateful that you guys implemented the new low-res scale feature for us. But just in case you're still working at the particulars of it I thought I'd offer a couple of suggestions to expand it a bit further.

1. Toggle linearSampling on/off within the fullscreen scaling rollout. Setting Sampling to Point in configuration settings works during edit-time but we can't toggle it during run-time unfortunately. However I noticed that switching this section in Layout.prototype.drawGL:

[quote]
          if (render_to_texture)
          {
              // Need another canvas to render to. Ensure it is created.
              if (!this.runtime.layout_tex)
              {
                    this.runtime.layout_tex = glw.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling);
              }

              // Window size has changed (browser fullscreen mode)
              if (this.runtime.layout_tex.c2width !== this.runtime.draw_width || this.runtime.layout_tex.c2height !== this.runtime.draw_height)
              {
                    glw.deleteTexture(this.runtime.layout_tex);
                    this.runtime.layout_tex = glw.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.linearSampling);
              }
[/quote]
to this:

[quote]
          if (render_to_texture)
          {
              // Need another canvas to render to. Ensure it is created.
              if (!this.runtime.layout_tex)
              {
                    this.runtime.layout_tex = glw.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.pointSampling);
              }

              // Window size has changed (browser fullscreen mode)
              if (this.runtime.layout_tex.c2width !== this.runtime.draw_width || this.runtime.layout_tex.c2height !== this.runtime.draw_height)
              {
                    glw.deleteTexture(this.runtime.layout_tex);
                    this.runtime.layout_tex = glw.createEmptyTexture(this.runtime.draw_width, this.runtime.draw_height, this.runtime.pointSampling);
              }
[/quote]
... turns off filtering for the upscaled texture in low-quality mode while, at least as far as I can see, retaining the linear sampling effect for high-quality mode. This means the high/low-quality fullscreen scaling could also double as a real-time toggle for linear/point sampling quite easily.

2. Okay I may be the only guy around who's actually interested in this but figured I'd ask anyway :P Sometimes a 2X pre-scale can be useful when you have effects that rely on higher than 1X scale, such as an overlay texture to simulate CRT scanlines in my own case. It could also make linear sampling without pixel rounding look less blurry and still keep much of the speed benefit we get with 1X scale. Just thought I'd mention it.

But in any case, great stuff. Thanks again for the new feature :)ErekT2013-12-07 11:17:36
B
39
S
16
G
6
Posts: 542
Reputation: 7,617

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 15 guests