Working with Godot: Difference between revisions

From XPUB & Lens-Based wiki
 
(7 intermediate revisions by the same user not shown)
Line 6: Line 6:
==Going Online==
==Going Online==
==Tips and Tricks==
==Tips and Tricks==
==Troubleshooting==
===Cross Origin Isolation - SharedArrayBuffer errors===
[https://hub.xpub.nl/chopchop/~aleevadh/godot%20not%20working/index.html The error I am talking about]<br>
[https://hub.xpub.nl/chopchop/~aleevadh/godot/index.html The same project, fixed, you can move the cube wooow]
<br>
<br>
These errors appears directly in the browser, after exporting a scene from Godot (4) to html and trying to run it locally.<br>
Both errors might happen ''when you don't have control over the web server or are unable to add response headers'' (in this case, the second one). <br>
To workaround this issue, as explained in this [https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_web.html documentation page from godot], it is best to involve [https://github.com/gzuidhof/coi-serviceworker coi-serviceworker].<br>
As stated in the github page, these are the steps to follow to make your game work in a self hosted webpage:
*Download coi-serviceworker.js (or coi-serviceworker.min.js).
*Put it in your project folder
*Add to your HTML file:
<script src="coi-serviceworker.js"></script>
Important rules:
It can't be loaded from a CDN: it must be served from your own origin.<br>
Your page will still need to be either served from HTTPS, or served from localhost
p.s. anyway it's not fully showing the textures, but this might be a problem with the blender export??
===Adding a texture to a 3D mesh Blender-Godot===
The texture needs to be baked to function properly, Godot seems to accept easily just the maps, not the complex texture files. Here some useful tutorials:
*to add
*to add
<br>
the normal map is not working as the albedo's one, we might make this more complicated than it actually is. Godot has a node editor and a basic procedural texture can be made into the game engine directly (maybe? or it could be a Non-Color problem)

Latest revision as of 22:50, 9 October 2024

The Turmoil of Blender


Okay so the community has made shaders> [1]

Going Online

Tips and Tricks

Troubleshooting

Cross Origin Isolation - SharedArrayBuffer errors

The error I am talking about
The same project, fixed, you can move the cube wooow

These errors appears directly in the browser, after exporting a scene from Godot (4) to html and trying to run it locally.
Both errors might happen when you don't have control over the web server or are unable to add response headers (in this case, the second one).
To workaround this issue, as explained in this documentation page from godot, it is best to involve coi-serviceworker.
As stated in the github page, these are the steps to follow to make your game work in a self hosted webpage:

  • Download coi-serviceworker.js (or coi-serviceworker.min.js).
  • Put it in your project folder
  • Add to your HTML file:

<script src="coi-serviceworker.js"></script>

Important rules: It can't be loaded from a CDN: it must be served from your own origin.
Your page will still need to be either served from HTTPS, or served from localhost

p.s. anyway it's not fully showing the textures, but this might be a problem with the blender export??


Adding a texture to a 3D mesh Blender-Godot

The texture needs to be baked to function properly, Godot seems to accept easily just the maps, not the complex texture files. Here some useful tutorials:

  • to add
  • to add


the normal map is not working as the albedo's one, we might make this more complicated than it actually is. Godot has a node editor and a basic procedural texture can be made into the game engine directly (maybe? or it could be a Non-Color problem)