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 ?
Max Resolution ?
-
-
-
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 ? -
Trigonometry is your friend:
https://en.wikipedia.org/wiki/TrigonometryBut generally it's a trade-off depending on what you want to achieve - sharpness on all edges or getting all pixels/details.
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. -
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 -
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 -
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 ?
-
Code
// 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.
-
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:
- set image.multiresthreshold to a higher value
- set memory.maxmem to a higher value (all tile pixels should fit into it, mem = width * height * 4)
- wait for the next onloadcomplete event
- then make the screenshot call
- 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=178223Best regards,
Klaus -
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 desktopsHere the related Safari bug
What I was trying was using chrome not safari.Thanks for the info
-
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
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!