No video

[Godot] Procedural Planets (E01 the sphere)

  Рет қаралды 23,113

Ombarus

Ombarus

Күн бұрын

Пікірлер: 58
@kingdunnad
@kingdunnad Жыл бұрын
for people using godot 4.1.1 the code changes needed are: (2:37) export is now @export (5:06) use a PackedVector3Array() instead of PoolVector3Array(). The same goes for the other similar ones, just replace each array with the equivalent packed version.
@thinkamake2948
@thinkamake2948 7 ай бұрын
For the PoolIntArray it would be changed to "index_array := PackedInt32Array()" If you use PackedInt64Array() it just won't render, but its likely based on your machine so if 32 doesn't work for you then 64 probably will
@marko7610
@marko7610 2 ай бұрын
And the Spatial class extended in Planet is a Node3D in godot 4
@thinkamake2948
@thinkamake2948 7 ай бұрын
Worked Great with Godot 4.2.1! just make the following changes: @export instead of export PackedVector3Array() instead of PoolVector3Array() PackedInt32Array() instead of PoolIntArray()
@Muttyfut
@Muttyfut Жыл бұрын
For the latest versions the "export var normal:Vector3" at 2:45 needs to be "@export var normal:Vector3"
@mcarthuralford4872
@mcarthuralford4872 3 жыл бұрын
I just started working on something similar yesterday. What a convenient time to upload! Very cool.
@flaringk
@flaringk 2 жыл бұрын
Dude this is amazing! And it actually is possible to automatically generate normals if you generate a mesh using a surface tool, which literally has a “generate_normals” function once you add each vertex
@jRsqILVOY
@jRsqILVOY 3 ай бұрын
One issue I hit is that if you have a very big planet, the forced camera distance culling will always cull (e.g. when the centre of the mesh is over 10 million metres away). AFAIK there is no way to disable it completely either and it seems the max distance you can set is around 10 million units (probably due to it being float32 too).
@Ombarus
@Ombarus 3 ай бұрын
Do not think of it as Meters but 1 Unit in Godot = 1 000Km if you want to get a sense of scale. This simple method won't allow you to walk on it though. If you want to be able to walk on it you will have to consider LOD (Level Of Detail), culling and many other problems related to Floating point precision errors.
@jRsqILVOY
@jRsqILVOY 3 ай бұрын
Yeah exactly, that doesn't work if you use the physics system, since it is only accurate to around 0.01 - 0.001 units or so IIRC. I think the only option is to scale down the planet as you move "away" - so like the camera is tricked with the distance remaining constant but the object getting smaller.
@xoxogamewolf7585
@xoxogamewolf7585 10 ай бұрын
I really wanted to follow his tutorial but unity was getting real bad so I'm glad I can do it in Godot now!
@karelissomoved1505
@karelissomoved1505 2 жыл бұрын
Oh great video. I always like when someone port unity stuff to godot 13:30 the last for loop can be omitted easily
@user-rf2ui6nz5d
@user-rf2ui6nz5d 2 жыл бұрын
Godot is very suitable for making games with high-freedom and randomness
@_mickmccarthy
@_mickmccarthy 3 жыл бұрын
Nice work! Hope you continue the series!
@financeonyt3664
@financeonyt3664 4 ай бұрын
Did anyone fix the seam that is created from the normals not being oriented properly between faces?
@alex197
@alex197 2 жыл бұрын
This is actually awesome. Thank you for making this!
@thanatosor
@thanatosor 4 ай бұрын
Great, now i can sculpt 😂
@shanefoster5305
@shanefoster5305 5 ай бұрын
I'm working in GODOT 4.2.1 and if class_name PlanetMeshFace is giving you trouble, just save it and reopen it. It sometimes has trouble loading the class_name.
@vinnieyang5422
@vinnieyang5422 3 жыл бұрын
Could you please make a tutorial on creating large scale (real world scale) planets with LOD that players can move around on? I'd be curious to see how you handle floating point origins! :)
@Darkest-Kn1ght
@Darkest-Kn1ght 2 жыл бұрын
This right here! The project I'm working on I'd like to be able to use the entire Earth as a game setting! Of course, the terrain would remain the same, but the time setting is far into the future after the planet was made almost uninhabitable! I would love to find out how to create a realistic Earth with real world locations and be able to fill it with a game. I don't even need to see the world from space!!
@allenmitchell3039
@allenmitchell3039 Жыл бұрын
@@Darkest-Kn1ght Google maps has awesome 3rd party software that copies road, buildings, i copied my whole city Adelaide Australia into unity and unreal
@Darkest-Kn1ght
@Darkest-Kn1ght Жыл бұрын
@@allenmitchell3039 Yup, I realize they do, as well as many other free software, but what I'd like to do would be more along the lines of kzbin.info/aero/PLFt_AvWsXl0dT82XMtKATYPcVIhpu2fh6 without the ability to see it from the air unless I implement some type of flight into the game. A city here and there is all good and all, but the game I am hoping to create would be opened up one region at a time, and eventually, the entire planet would be populated within the game, just without the cities that inhabit it currently, instead, replacing them with barren ghost cities.
@zayman40
@zayman40 5 ай бұрын
For some reason I'm not even getting the square when I run the scene
@MrZakrencony
@MrZakrencony 3 жыл бұрын
exactly what I needed, amazing timing, can't wait to see more episodes! will the planets also have collision generated for them?
@Ombarus
@Ombarus 3 жыл бұрын
I'm not planning to talk about it since they won't have any LOD so they're more made to be seen from far away. But you could just assign the array mesh to a collision node.
@Seraph120
@Seraph120 8 ай бұрын
Amazing! Thank You
@darthvader0219
@darthvader0219 10 ай бұрын
Is there a way to generate a single mesh that represents a sphere?
@Ombarus
@Ombarus 10 ай бұрын
If you can find the formula to generate the triangles sure. You can also just generate all 6 faces in one mesh. The idea of generating it in separate mesh is that it (kind of) open the way to having LODs (Level Of Details). You could image that one face would be generated with a higher resolution than the other. You could further break down each faces into more meshes to get finer LODs.
@joaopedrosilva3796
@joaopedrosilva3796 3 жыл бұрын
Excellent work!
@SandSeppel
@SandSeppel 2 жыл бұрын
How can I shade this flat so you can clearly see the faces?
@DArK-xj8lr
@DArK-xj8lr 3 жыл бұрын
That's genius
@FemtoTheGodHand
@FemtoTheGodHand 2 жыл бұрын
Thank you Ombarus, it works very well and it's very instructive. I'm trying to add a dynamic chunk loading system and I can load each face in a thread, but I wonder how I can subdivide them even more, for example the Up face in four chunks, Down face in four chunks...etc ? My goal is to generate huge planet with a maximum of details.
@Ombarus
@Ombarus 2 жыл бұрын
I'm not planning to tackle stuff like LOD systems and collisions. This is more intended to be something like a backdrop in a bigger scene. Though part of the idea in splitting the faces in separate mesh and having a resolution control would be so you could have different resolution for each faces or perhaps even cut the faces in even more meshes. But then you need to figure out how to stitch the corners between the different resolutions. There are some other tutorials out there about this though.
@user-ut4hj7kc1t
@user-ut4hj7kc1t 9 ай бұрын
Why there is no games with it still?
@jeremiahdobes7008
@jeremiahdobes7008 2 жыл бұрын
Hey there! This is super helpful! I'm actually utilizing this to make a sort of gameboard planet, and I was wondering if it's possible to set a 2d texture to each of the generated squares on the faces?
@tsvetomiriliev5804
@tsvetomiriliev5804 4 ай бұрын
7:14 what do you mean by "true" triangle?
@Ombarus
@Ombarus 4 ай бұрын
pronunciation is hard. I was trying to say "TWO triangles". Meaning two triangles are used to make one quad.
@tsvetomiriliev5804
@tsvetomiriliev5804 4 ай бұрын
@@Ombarus Thank you.
@aroyart9491
@aroyart9491 3 жыл бұрын
Thanks, I have tried to port it may self but failed.
@pvini07BR
@pvini07BR Жыл бұрын
great tutorial, i wonder if you're still answering the comments, because i want to know how to generate UVs for the sphere, because i want to apply earth texture to the sphere and the texture doesn't properly appears.
@Ombarus
@Ombarus Жыл бұрын
It's a bit tricky because you'll need to figure out a way to handle the projection (projecting on a sphere is pretty challenging). But if you can map a position on the sphere to a UV coordinate on your map texture it should be doable. I believe Sebastian Lague has a later video series where he discusses this, you might be able to adapt it to Godot.
@HypeLozerInc
@HypeLozerInc 3 жыл бұрын
This is awesome
@absolutelinus8552
@absolutelinus8552 2 жыл бұрын
this is a bit too advanced for me, but I'll come back to this at another point
@KumsalObuz
@KumsalObuz 3 жыл бұрын
Nice!
@oblatornexus5758
@oblatornexus5758 2 жыл бұрын
I just made a similar script, but did it with the ArrayMesh within the MeshInstance, no need for multiple MeshInstances. Currently the script is not so pretty, just me 'bashing it with a hammer until it worked'. It was the UVs part that really annoyed me for the longest time.
@Ombarus
@Ombarus 2 жыл бұрын
The idea is that this could be the basis for a Level of Detail system (LOD). Each MeshInstance could be subdivided a different number of time. That said you would need to implement something to "stitch" the different LODs together to avoid seams.
@Cornell_
@Cornell_ 2 жыл бұрын
Awesome Vid mate, but I tried to follow your thing, and I feel like I have everything like you but I can't get the Cube the render into view when I play the scene, it's just not showing up... very weird
@Ombarus
@Ombarus 2 жыл бұрын
Put a breakpoint and make sure the code is being called.
@Cornell_
@Cornell_ 2 жыл бұрын
@@Ombarus Did that, the compiler spits out 6 errors, for each side, saying " _mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)" "E 0:00:01.465 mesh_add_surface_from_arrays: Invalid array format for surface." So I guess the format is messed up somewhere, but I can't find where I messed up in the code spend 2 hours yesterday looking for it xD
@jaydenduncan5747
@jaydenduncan5747 Жыл бұрын
@@Cornell_ Hey I found you a fix! Resize the uv and normal array to be the same length as the vertex array!
@coolmanthecool603
@coolmanthecool603 5 ай бұрын
I dont like how you did that, but cool tutorial.
@ComplexProgrammer
@ComplexProgrammer 9 ай бұрын
good tutorial but I don't like the fact that every once and a while you speed up the clip because it makes it really hard to keep up
Жыл бұрын
Now I just need to translate all of this across to C# 😭
@williamhutchins479
@williamhutchins479 10 ай бұрын
Don't some programs let you translate? Or is that only translation to C#?
@user-ut4hj7kc1t
@user-ut4hj7kc1t 9 ай бұрын
I completely lost on 10th minute... -_-
@huoqu6059
@huoqu6059 Жыл бұрын
Outdated
@adamboussif8035
@adamboussif8035 Жыл бұрын
Can someone explain why do we set the vector AxisA to have coordinates (localUp.y,localUp.z,localUp.x) ? if we calculate the dot product of Axis A and the normal then it is xy+yz+zx where (x is the localUp.x, and y ,z respectively
@adamboussif8035
@adamboussif8035 Жыл бұрын
Which is obviouslt not always 0
[Godot] Procedural Planets (E02 Editor Settings)
11:05
Ombarus
Рет қаралды 7 М.
Coding Adventure: Procedural Moons and Planets
22:48
Sebastian Lague
Рет қаралды 1,7 МЛН
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 16 МЛН
Пройди игру и получи 5 чупа-чупсов (2024)
00:49
Екатерина Ковалева
Рет қаралды 4,7 МЛН
Glow Stick Secret Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 18 МЛН
Massive Infinite TERRAIN that Generates INSTANTLY: Clipmap & Collisions
9:39
Outerra - Full Scale Procedural Planet Earth
8:23
ObsidianAnt
Рет қаралды 734 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
Freaking Line Rendering!
11:36
Ombarus
Рет қаралды 2,2 М.
Coding Adventure: Solar System
12:12
Sebastian Lague
Рет қаралды 853 М.
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 527 М.
I Made a Multiplayer Space Game
8:41
Barji
Рет қаралды 190 М.
Ship Controls: Coding Adventure in Godot
12:16
Ryan Remer
Рет қаралды 1,8 М.
Realistic Aircraft Physics for Games
11:42
Jump Trajectory
Рет қаралды 81 М.
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 16 МЛН