Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stickers #1958

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Stickers #1958

wants to merge 6 commits into from

Conversation

apjagdale
Copy link
Contributor

Added screenshot capture feature by using 3 Pixel Buffer objects.
New class introduced : GVRSticker(GVRContext gvrContext, String tag, long interval)

  • tag for outputting PNG's to the SD Card along with appended frame ID in folder GearVRFScreenshots
  • (interval) Time in milliseconds to take screenshot at that interval

Methods:

  • start/stopCapturing()

GearVRf DCO signed off by: Abhijit Jagdale a.jagdale@samsung.com

@roshanch
Copy link
Contributor

roshanch commented Aug 6, 2018

We are using horizontal/ vertical flip shaders, or post effects just for inverting a scene. we should be modifying mvp instead to rotate or flip the scene instead of all that overhead which is not efficient. Which will also avoid creating unnecessary render targets.

@liaxim
Copy link
Contributor

liaxim commented Aug 7, 2018

Couple of tests I believe would be useful.
There is a backend adapter that no longer compiles.

File sdcard = Environment.getExternalStorageDirectory();
mDirectory = sdcard.getAbsolutePath() + "/GearVRFScreenshots/";
File d = new File(mDirectory);
d.mkdirs();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the fact that WRITE_EXTERNAL_STORAGE is required should be mentioned. Also I'd recommend checking the return value of mkdirs and throwing an exception immediately if needed.

@liaxim
Copy link
Contributor

liaxim commented Aug 7, 2018

Have you verified screenshotting with all backend adapters?

@@ -236,6 +233,7 @@ void onDrawEye(int eye, int swapChainIndex, boolean use_multiview) {

renderTarget.cullFromCamera(mMainScene, mainCameraRig.getCenterCamera(), mRenderBundle.getShaderManager());
captureCenterEye(renderTarget, false);
captureSticker();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other backend adapters?

@liaxim
Copy link
Contributor

liaxim commented Aug 7, 2018

What about generating stickers in "headless mode"? Where the framework is only used to render into the images as a background "service"? Should there be all new backend adapter for that mode?


GLuint* &pbos = gRenderer->getPBOs();
if(pbos == NULL){
pbos = new GLuint[3];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a constant for the number of pbos.

@@ -202,10 +202,13 @@ class Renderer {
}
return nullptr;
}
virtual bool readRenderResultInPBO(int) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal but PBO is not directly applicable to Vulkan, correct? A more generic name like buffer may be better.

@liaxim
Copy link
Contributor

liaxim commented Aug 7, 2018

Looks pretty good overall.

@liaxim
Copy link
Contributor

liaxim commented Aug 13, 2018

Needs rebase. Are any of the comments valid?

@NolaDonato
Copy link
Contributor

Please generalize beyond stickers. This should be a component you attach to the Scene object that owns the render target to capture textures.

@apjagdale
Copy link
Contributor Author

apjagdale commented Aug 14, 2018

@thomasflynn @NolaDonato In the current approach there is a way to set the interval at which the sticker(screenshot) needs to be captured. So if we move to RenderTarget based approach, onDrawFrame will be called every time. That means no interval but capturing every frame. Do we want interval for RenderTarget approach as well?

@NolaDonato
Copy link
Contributor

Yes that would be useful. We should be able to specify it in terms of frames or seconds

@liaxim
Copy link
Contributor

liaxim commented Nov 28, 2018

Should we close?

@NolaDonato
Copy link
Contributor

We still want the feature but it can go into SXR instead of GVRF

Copy link

@ftservice ftservice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android system webviwver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants