-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Add external texture support (GLES3) #96982
Conversation
I don't know where to ask this. Do external textures exist on PC? Like video buffers. |
In my research on this, I saw a reference to I didn't see anything about external textures working on desktop with Vulkan and the necessary extension has "ANDROID" in the name ( |
d2a5a2e
to
6ed9781
Compare
I started working on adding Vulkan support, however, I discovered that it depends on Android API level 26 or higher. Presently, we have an API minimum of 21, which would prevent this code from compiling. So, for now, I've split Vulkan support off into PR #97163 to finish some time later. I feel very good about the GLES3 support in this PR here, though! Once PR #96928 (which this PR depends on) is merged, then I'll take this one out of draft. |
6ed9781
to
c78ca97
Compare
ed3e379
to
691f392
Compare
I'm a native Android developer working on creating Android plugins for Godot. For a simple use case, let's say I want to embed an EditText from native Android into a Godot scene. Will this PR assist me in achieving that? Specifically, would I need to use a surface texture as the parent view and add the EditText as a child view, allowing it to be displayed within the Godot scene? Additionally, will the rest of the Godot scene elements (3D/2D nodes) still function as expected alongside the native Android EditText? |
Needs rebase to solve merge conflict. |
Co-authored-by: Fredia Huya-Kouadio <fhuyakou@gmail.com> Co-authored-by: Mauricio Narvaez <nvz@meta.com>
691f392
to
1a6f851
Compare
Rebased!
Yes! Take a look at the demo project linked in the PR description. It uses an Android You could also use this to show a |
@dsnopek Thanks for the reply. I did check the sample project attached. You're opening the camera preview on a button click.
|
That's effectively what this does, just not with a new node, it does it with a new texture resource,
Yes, in the context of adding a video player, you'd need to make your own controls for play, pause, etc in Godot, because all you're getting from Android is the display. Input still goes to Godot. If you wanted to show Android UI, you'd need to write some code to forward the input from Godot to Android so that the Android UI could receive touches.
I think it is, at least in the context of a camera, because the video feed from the camera is YUV, and the shader triggers some magic to convert it to RGB. I haven't tested it, but maybe you could use a |
Thanks! |
This broke building on MSVC, like this case: See: The problem is once again As a temporary workaround I'm using: diff --git a/scu_builders.py b/scu_builders.py
index fc5461196f..ed7b729df3 100644
--- a/scu_builders.py
+++ b/scu_builders.py
@@ -337,7 +337,7 @@ def generate_scu_files(max_includes_per_scu):
process_folder(["scene/animation"])
process_folder(["scene/gui"])
process_folder(["scene/main"])
- process_folder(["scene/resources"])
+ process_folder(["scene/resources"], ["external_texture"])
process_folder(["scene/resources/2d"])
process_folder(["scene/resources/3d"])
|
@BraveEvidence you can take a look at the Gast library which did something similar to what you are describing for Godot 3.x. https://github.com/m4gr3d/GAST Now that this functionality is available in Godot 4.x, it would be possible to update the Gast library to also support Godot 4.x. |
@m4gr3d Thanks, I was kind of expecting something like this. Will you please upgrade the GAST plugin to Godot 4 as I don't have expertise for this and include a Simple Native Android sample, currently all the samples looks like for XR. |
@BraveEvidence the project includes examples for uses with regular Android projects, see https://github.com/m4gr3d/GAST/blob/master/core/src/plugins/java/org/godotengine/plugin/gast/plugins/video/README.md#gast-video-plugin In terms of update, this is unlikely to happen until next year, which is when Godot 4.4 (in which these changes will go) will be released. |
This is a continuation of the work started on PR #83519
To avoid a naming conflict, this builds on PR #96928
It's marked as a DRAFT because PR #96928 needs to be merged first, and I'd like to figure out how to add Vulkan support (right now this is just GLES3).UPDATE: I started working on adding Vulkan support, however, I discovered that it depends on Android API level 26 or higher. Presently, we have an API minimum of 21, which would prevent this code from compiling. So, for now, I've split Vulkan support off into PR #97163 to finish some time later.
Here is a demo project that uses this functionality to show the camera feed on Android.