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

Add Web/WASM Support #23

Merged

Conversation

nicholas-maltbie
Copy link
Contributor

Hey, I'm learning godot and found your repo awesome @DmitriySalnikov

I'm trying to setup gdexport for web and ran across your issue #19 and I have been able to build it locally by adding the PThresds flags to enable shared memory in the export. And updating the version of emsdk to 3.1.46 to be in line with v4.1.1-stable of godot's web export. Thought I should share how I got it to build and export locally on my machine.

I've testing building it with v4.1.1-stable of godot and was able to compile and run on my local machine. Checkout my web build branch to see an example - https://github.com/nicholas-maltbie/godot_debug_draw_3d/tree/nickmaltbie/web-build

image

Also, I only have had it work with chromium-based browsers (Edge in the photo), seems like there is a note about it in the Export for Web pages on the docs.

If you use Linux, due to poor Firefox WebGL performance, it's recommended to play the exported project using a Chromium-based browser instead of Firefox.

If you have any questions or suggestions for the PR let me know.

@nicholas-maltbie nicholas-maltbie changed the title Web Config Support Add Web/WASM Support Sep 20, 2023
@DmitriySalnikov
Copy link
Owner

DmitriySalnikov commented Sep 20, 2023

Awesome!

And updating the version of emsdk to 3.1.46

Ooh, I was slightly wrong with the version. 😅

(Looking at the screenshot, at first I thought that the colors were broken, and then I remembered that I had already reported this bug and it had already been fixed in version 4.2.)

Can you squash your changes?

git rebase -i 027970584ed171343dff55f37a211ed533b0f3ec
git push -f

However, I'm not sure if binaries are needed in this PR, but it's not that important.


It looks like everything is working as intended!
image

But I may have to fix something on the phone, or this is an example project problem.
2023-09-20 07-54-29


And since the changes were made in the patch, it seems to me that they should be duplicated in the godot-cpp itself.

@nicholas-maltbie
Copy link
Contributor Author

Hey, happy to update the project and squash the commits.

However, I'm not sure if binaries are needed in this PR, but it's not that important.

I can revert those changes if you would rather add them in a separate commit or PR. I mostly added them for testing.

I think I only added the wasm files so I can manually remove the other updates as well.

If you have any other suggestions or comments let me know.

And since the changes were made in the patch, it seems to me that they should be duplicated in the godot-cpp itself.

Think it's a good idea to submit it to the godot-cpp repo? Do they have a protocol for contributing or can I open a pull request like here.

@DmitriySalnikov
Copy link
Owner

DmitriySalnikov commented Sep 20, 2023

Think it's a good idea to submit it to the godot-cpp repo? Do they have a protocol for contributing or can I open a pull request like here.

Why not? They have recommendations and you can just do a fork and PR.
I think you may be asked to expose the flag settings in the options method, because I do not know how specific they are for this project.
Only one limitation will be at the first PR, this is that CI/CD will not automatically start for you in their repository.

Everything else is fine. I was able to build locally and run.

Thanks!

@DmitriySalnikov DmitriySalnikov merged commit f2b2957 into DmitriySalnikov:master Sep 20, 2023
@nicholas-maltbie
Copy link
Contributor Author

Sounds good. thanks for reviewing the PR. I'll make a PR to the godot repo after reading over those recommendations.

Oh, I'm also working on adding an automated github pages build for the project (upload the demo project to github pages for the repo). Would you be interested in adding that to this project as well?

@nicholas-maltbie nicholas-maltbie deleted the nickmaltbie/web branch September 20, 2023 07:07
@DmitriySalnikov
Copy link
Owner

Do you mean some kind of documentation generation or just auto-uploading and updating the demo project on github pages?

@nicholas-maltbie
Copy link
Contributor Author

Do you mean some kind of documentation generation or just auto-uploading and updating the demo project on github pages?

Auto generating the site and uploading to GitHub pages. I have it working in my repo right now here - https://nickmaltbie.com/godot_debug_draw_3d/

Auto generating documentation could be added as well but I always like including demos of my libraries that people can checkout from the github page. I want to include these demos for some godot projects I am working on and found your repo while researching.

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

Successfully merging this pull request may close these issues.

2 participants