Sie sind nicht angemeldet.

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

1

Samstag, 17. März 2018, 15:55

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

Samstag, 17. März 2018, 22:41

Hi,

you could get it via:

Quellcode

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« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

3

Sonntag, 18. März 2018, 20:44

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

Sonntag, 18. März 2018, 21:36

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

Fortgeschrittener

Beiträge: 354

Wohnort: La Ceja, Colombia

Beruf: photographer

  • Nachricht senden

5

Montag, 19. März 2018, 15:37

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« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

6

Montag, 19. März 2018, 16:20

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

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

7

Montag, 19. März 2018, 18:52

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

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

8

Dienstag, 20. März 2018, 14:43

Quellcode

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

Dienstag, 20. März 2018, 17:39

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

Profi

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

10

Mittwoch, 21. März 2018, 10:20

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

Donnerstag, 22. März 2018, 23:05

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