You are not logged in.

jeromebg

Professional

  • "jeromebg" started this thread

Posts: 1,120

Location: Angers - France

Occupation: 360 experiences creator

  • Send private message

1

Saturday, March 17th 2018, 3:55pm

Max Resolution ?

The new krpano.webGL.makeScreenshot is great to take screenshots at higher resolution than displayed on the screen, but is there a way to know the max width/height than can be generated without pixel scaling ?

2

Saturday, March 17th 2018, 10:41pm

Hi,

you could get it via:

Source code

1
2
var gl = krpano.webGL.context;
var maxsize = gl.getParameter(gl.MAX_RENDERBUFFER_SIZE);


Typically at least 4096x4096 and higher - with some exception for some very old systems, there 2048x2048 is the maximum.

Best regards,
Klaus

jeromebg

Professional

  • "jeromebg" started this thread

Posts: 1,120

Location: Angers - France

Occupation: 360 experiences creator

  • Send private message

3

Sunday, March 18th 2018, 8:44pm

Thanx for your reply Klaus, but that wasn't the question (I might not have been clear enough...)
Imagine you have a 20 000px x 10 000px pano displayed with a 90° HFOV, the max output without pixel scaling should be 5000px wide, right ?
So my question is is there a way to calc the max output resolution depending on the pano resolution and fov of the screenshot ?

4

Sunday, March 18th 2018, 9:36pm

Trigonometry is your friend: ;-)
https://en.wikipedia.org/wiki/Trigonometry

But generally it's a trade-off depending on what you want to achieve - sharpness on all edges or getting all pixels/details.

Here two possibilities:


You could also use a mixture of both.
For very small fov values they would be very similar,
and for very large fov values there would need to a special solution (e.g. slowly limit the size) otherwise the image would become too large.

ramirox3

Intermediate

Posts: 354

Location: La Ceja, Colombia

Occupation: photographer

  • Send private message

5

Monday, March 19th 2018, 3:37pm

Hi
where can I to find documentation how I can make take screenshots at higher resolution than displayed on the screen.
Using The new krpano.webGL.makeScreenshot ?
Ramiro

jeromebg

Professional

  • "jeromebg" started this thread

Posts: 1,120

Location: Angers - France

Occupation: 360 experiences creator

  • Send private message

6

Monday, March 19th 2018, 4:20pm

Hi
where can I to find documentation how I can make take screenshots at higher resolution than displayed on the screen.
Using The new krpano.webGL.makeScreenshot ?
Ramiro

https://krpano.com/docu/plugininterface/….makeScreenshot

jordi

Professional

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

7

Monday, March 19th 2018, 6:52pm

Does it has any sense to make an image bigger than the canvas, isn't it interpolating anyway a part from original image size ?

In the case of multires, can it create the image from unloaded levels ?
everpano.com step beyond 360

jordi

Professional

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

8

Tuesday, March 20th 2018, 2:43pm

Source code

1
2
3
// GET IMAGE MAXSIZE
var gl = krpano.webGL.context;
var maxsize = gl.getParameter(gl.MAX_RENDERBUFFER_SIZE);


I have succesfully generated a 4096 * 4096 image but maxsize is supossed to be 4x times = 16384, working on a simple mac mini

I just checked what happened after 4096 and is just de 4096 pixels and the rest is transparent.
everpano.com step beyond 360

9

Tuesday, March 20th 2018, 5:39pm

Hi,

Does it has any sense to make an image bigger than the canvas, isn't it interpolating anyway a part from original image size ?
The image will be new rendered with the given resolution, it's not a scaling of the current screen.

In the case of multires, can it create the image from unloaded levels ?
It can only use the current loaded files.
Loading new images would require time (and mem) and also would need to be async.

If you want to make 'screenshots' with a tiles from a higher res, you could try that:
  1. set image.multiresthreshold to a higher value
  2. set memory.maxmem to a higher value (all tile pixels should fit into it, mem = width * height * 4)
  3. wait for the next onloadcomplete event
  4. then make the screenshot call
  5. and restore all settings


I just checked what happened after 4096 and is just de 4096 pixels and the rest is transparent.
That means the browser returns a wrong value for MAX_RENDERBUFFER_SIZE.
That size is probably passed through from the systems OpenGL API, and during real rendering the browser is limiting the size.

Here the related Safari bug:
https://bugs.webkit.org/show_bug.cgi?id=178223

Best regards,
Klaus

jordi

Professional

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

10

Wednesday, March 21st 2018, 10:20am

The image will be new rendered with the given resolution

that is very good ! and make difference with my previous version where the image was created from the canvas itself not a new render !

make 'screenshots' with a tiles from a higher res, you could try that

I'm gonna try it. I've been testing that not using the preserveDrawingBuffer it's also generating the image. Could be dynamically toggle this attribute ? that would help keeping performance.

That means the browser returns a wrong value for MAX_RENDERBUFFER_SIZE

this was what I thought, so basically it's a unknown value, having in mind that 4096 would be mostly doable in all desktops

Here the related Safari bug

What I was trying was using chrome not safari.

Thanks for the info
everpano.com step beyond 360

11

Thursday, March 22nd 2018, 11:05pm

Hi,

that is very good ! and make difference with my previous version where the image was created from the canvas itself not a new render !
Just as note - because it's a new rendering, it would be also possible to change the view settings (e.g. hlookat/vlookat) directly before calling makeScreenshot and then after that restoring it again to make screenshots of pano areas different to the current screen view - but with one limitation - only the currently loaded tiles can be used for the rendering, so when making a screenshot of a part where no tiles are in memory yet, there might be only the preview pano to render.


I'm gonna try it. I've been testing that not using the preserveDrawingBuffer it's also generating the image. Could be dynamically toggle this attribute ? that would help keeping performance.
I've noticed that too - it seems the latest browser versions don't require preserveDrawingBuffer=true anymore (I don't know when this was changed). Dynamically toggling preserveDrawingBuffer is technically not possible. But in the next release there will be also a possibility for screenshots without the need for preserveDrawingBuffer=true even when the browser would normally require it.


this was what I thought, so basically it's a unknown value, having in mind that 4096 would be mostly doable in all desktops
In this next release the image-size will be automatically proportionally downscaled to the maximum possible size supported/reported by the browser.

Best regards,
Klaus