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

[WIP] ARKit support #9967

Closed
wants to merge 2 commits into from
Closed

Conversation

BastiaanOlij
Copy link
Contributor

@BastiaanOlij BastiaanOlij commented Jul 29, 2017

This is far from finished and very, very rough, but I figured I'd submit it for people to start taking a look at and coming up with better solutions for a few of the issues.

Functionality everything is there except for plane detection, that shouldn't be hard to add in. For me the main goal was to get the tracking up and running and the camera.

The camera isn't implemented the way I would like to, right now I'm taking the render buffer created by Godot and overlaying it ontop of the camera image during the final copy to screen. I don't believe this is the right way about it. I need to find a way to make the camera image available to the render engine so it can render the geometry on top of the image. The really annoying part here is that the image is provided by the camera as a YCbCr image so it needs to be converted to RGB. Since we get a new image almost every frame I'm doing this in the shader itself.
Basically everything in arkit_shader.h and arkit_shader.cpp should be solved differently

The other thing which right now is fairly dirty is the way everything hangs together. For 90% ARKit actually works with a pull mechanism but the remaining 10% required some ugly hacks. I'll be cleaning that up soon.

Finally there are a bunch of rendering issues but they are issues on iPhone in general. One specific to ARKit is that without a background (it being the camera image of the phone) there is no HDR image to do nice reflections with. I'm uploading a video to YouTube to show off the tracking, will post the link as soon as it finishes.

https://youtu.be/QCH5wOYeIdQ

@BastiaanOlij BastiaanOlij requested a review from reduz July 29, 2017 10:47
@BastiaanOlij
Copy link
Contributor Author

Owh one thing I forgot to add here. ARKit requires iOS 11 and XCode 9 beta to run. That is a bit of an issue as well, it needs to be possible to make ARKit an optional compile.

@BastiaanOlij
Copy link
Contributor Author

This is the test project I used in the video that I posted:
https://github.com/BastiaanOlij/godot3_test_projects/tree/master/ARKit

Note at this time the "green screen" background that I abuse to overlay the camera. That is only temporary until I get the camera to render properly as the background of our main render buffer.

@BastiaanOlij
Copy link
Contributor Author

Pretty much got everything working at the moment. I haven't had time to rebase it yet, planning to do that over the weekend.

Plane detection now works, the new ARVRAnchor object will probably get its own PR soon and needs to be enhanced to extract the scaling.

Discussed a possible solution to improve the way the camera image is implemented with Reduz today, we'll see how easy that will turn out to be implemented.

@BastiaanOlij
Copy link
Contributor Author

Sorry for the little movement on this. Work has been keeping me busy, I'm slowly working on a new framework so Godot can capture video feeds and use those with one of the goals of feeding ARKits camera frames into this (as ARKit already does this, no use in doubling up and using the camera directly). Once I have finished that I'll round of the ARKit implementation.

@akien-mga akien-mga changed the title Arkit ARKit Sep 21, 2017
@BastiaanOlij
Copy link
Contributor Author

This is still quick and dirty but I redid some of the code so this now works with my camera server implementation.

Its rebased to todays master and provided you have XCode 9 installed (which is no longer in beta) this should compile.

I'll be spending more time polishing this up as I've still cut a few corners, but it is really coming together now!

@BastiaanOlij BastiaanOlij force-pushed the arkit branch 2 times, most recently from 54ba3d8 to 35eae67 Compare September 24, 2017 12:26
@BastiaanOlij
Copy link
Contributor Author

Just a few bug fixes and a rebase..

@BastiaanOlij BastiaanOlij force-pushed the arkit branch 3 times, most recently from 0a3fd1e to bc8105d Compare October 1, 2017 09:28
@BastiaanOlij
Copy link
Contributor Author

Rebased, and applying the tweaks we're working on in the arvr server.

@BastiaanOlij
Copy link
Contributor Author

Just a rebase, no changes.

@akien-mga
Copy link
Member

Thanks a lot for your contribution!
We are now entering a strict release freeze for Godot 3.0 and will only consider major bug fixes. We won't merge new features and enhancements anymore until 3.0 is released.

Moving this PR to the 3.1 milestone, to be reviewed once the release freeze is lifted. It could eventually be cherry-picked for a future 3.0.1 maintenance release if it doesn't change the user-facing APIs and doesn't compromise the engine's stability.

@akien-mga akien-mga added this to the 3.1 milestone Jan 4, 2018
@BastiaanOlij
Copy link
Contributor Author

Rebased but can't test yet, issues with exporting

@akien-mga akien-mga changed the title ARKit [WIP] ARKit support Jul 24, 2018
@akien-mga akien-mga modified the milestones: 3.1, 3.2 Jul 24, 2018
@BastiaanOlij
Copy link
Contributor Author

PR #24227 has superseded this now that all code builds for Godot 3.1+

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.

3 participants