- Видео 22
- Просмотров 301 122
DitzyNinja's Godojo
Добавлен 13 сен 2020
Godot tutorials
Calculating normals on the GPU for procedural terrain
Only 6 months later...
How to calculate normals on a displaced plane using a spatial shader in Godot 4. This video will show you to do this using the plane's vertices or using pixels from a height map texture.
This video builds on two previous videos, but they are not required to understand what is going in this here.
ruclips.net/video/Hgv9iAdazKg/видео.html
ruclips.net/video/jDM0m4WuBAg/видео.html
Normal Vector to Normalmap pixel function:
vec3 to_normalmap(vec3 n){
n*=vec3(1.0,1.0,-1.0);
n = n/2.0+0.5;
n = vec3(n.x,n.z,n.y);
return n;
}
How to calculate normals on a displaced plane using a spatial shader in Godot 4. This video will show you to do this using the plane's vertices or using pixels from a height map texture.
This video builds on two previous videos, but they are not required to understand what is going in this here.
ruclips.net/video/Hgv9iAdazKg/видео.html
ruclips.net/video/jDM0m4WuBAg/видео.html
Normal Vector to Normalmap pixel function:
vec3 to_normalmap(vec3 n){
n*=vec3(1.0,1.0,-1.0);
n = n/2.0+0.5;
n = vec3(n.x,n.z,n.y);
return n;
}
Просмотров: 7 188
Видео
Massive Infinite Terrain that Generates Instantly Part 2: LOD & Mesh Stitching
Просмотров 8 тыс.2 года назад
0:00 Intro 0:34 Level of Detail 3:00 Stitching Mesh Seams PART 1 ruclips.net/video/Hgv9iAdazKg/видео.html STARTING PROJECT github.com/TheGodojo/Massive-Terrain-LOD-And-Stitching-STARTER.git COMPLETED PROJECT github.com/TheGodojo/Massive-Terrain-LOD-And-Stitching-COMPLETE.git
Massive Infinite TERRAIN that Generates INSTANTLY: Clipmap & Collisions
Просмотров 20 тыс.2 года назад
0:00 Intro 1:03 Clipmap 5:16 Collisons Part 2 ruclips.net/video/Hgv9iAdazKg/видео.html How to create terrain that easily gets over 15km of draw distance using spatial shaders (Collions too!) STARTER PROJECT github.com/TheGodojo/Instant-Massive-Infinite-Terrain-Clipmap-Collisions-STARTER.git github.com/TheGodojo/Instant-Massive-Infinite-Terrain-Clipmap-Collisions-STARTER/archive/refs/heads/main....
Global Shader Uniforms in Godot 4 Real Quick
Просмотров 5 тыс.2 года назад
A quick overview of how to use global uniforms in Godot 4.
Intro to Godot 4's RenderingDevice (Compute Shaders)
Просмотров 6 тыс.2 года назад
An introduction to using compute shaders to run your code on the GPU in Godot 4 with the Rendering Device
Hosting a Godot Server in the Cloud (AWS)
Просмотров 5 тыс.2 года назад
Dependencies Command: sudo yum install -y libXcursor libXinerama libXrandr-devel libXi mesa-libGL Server Project: github.com/TheGodojo/Cloud-Server.git Client Project: github.com/TheGodojo/Cloud-Client.git
Godot 4 Server with No Window/Rendering
Просмотров 10 тыс.2 года назад
How to run a headless server with Godot 4 STARTER PROJECT github.com/TheGodojo/Headless-Server-Starter.git COMPLETED PROJECT github.com/TheGodojo/Headless-Server-Starter.git
Godot 4 Dedicated Servers with Multiplayer Nodes and RPC
Просмотров 29 тыс.2 года назад
ORIGINAL PROJECTS (Clients) RPC Networking Demonstration github.com/TheGodojo/Godot-4-Networking-Demonstration-Complete.git Multiplayer Nodes github.com/TheGodojo/Multiplayer-Nodes-Complete.git STARTER SERVER PROJECTS RPC github.com/TheGodojo/Dedicated-Server-RPC-Server-Starter.git Multiplayer Nodes github.com/TheGodojo/Dedicated-Server-Multiplayer-Nodes-Starter.git
Godot 4 First-Person Controller with 22 Lines of Code
Просмотров 18 тыс.2 года назад
A quick video on how to make a basic first-person character controller with horizontal movement, mouse look, and jumping. CODE: extends CharacterBody3D @export var speed = 10 @export var jump_velocity = 4.5 var look_sensitivity = ProjectSettings.get_setting("player/look_sensitivity") var gravity = ProjectSettings.get_setting("physics/3d/default_gravity") var velocity_y = 0 @onready var camera:C...
Godot 4's New Networking Nodes
Просмотров 21 тыс.2 года назад
A quick demonstration of the MultiplayerSpawner and MultiplayerSynchronizer Nodes. START PROJECT github.com/TheGodojo/Multiplayer-Nodes-Starter.git COMPLETED PROJECT github.com/TheGodojo/Multiplayer-Nodes-Complete.git
Godot Peer-to-Peer over the Internet (The easy way)
Просмотров 25 тыс.2 года назад
How to forward ports and retrieve a router's internet-facing IP address from GDScript
Quick Overview of Navigation in Godot 4 (Part 2)
Просмотров 2,9 тыс.2 года назад
I made a mistake in my last video! :( Bake from code Travel and enter costs Find the closest point on the map
Godot 4 Networking Demonstration
Просмотров 39 тыс.2 года назад
Set up a server and client. See how the @rpc annotation is used in Godot 4. Completed Project github.com/TheGodojo/Godot-4-Networking-Demonstration-Complete/archive/refs/heads/main.zip Starter Project
A Quick Overview of Networking in Godot 4
Просмотров 38 тыс.2 года назад
Learn the new syntax, the RPC implementation, and what parameters are used with @rpc
Quick Overview of Navigation in Godot 4 (Part 1)
Просмотров 13 тыс.2 года назад
Quick Overview of Navigation in Godot 4 (Part 1)
Procedural Terrain - Blend Textures based on Slope and Height
Просмотров 10 тыс.2 года назад
Procedural Terrain - Blend Textures based on Slope and Height
Always Responsive Jumping and No More Sliding on Slopes in Godot 3D
Просмотров 3,7 тыс.2 года назад
Always Responsive Jumping and No More Sliding on Slopes in Godot 3D
Procedural Terrain Generation: Displacement & Collisions
Просмотров 15 тыс.2 года назад
Procedural Terrain Generation: Displacement & Collisions
Create Mesh with Code: ArrayMesh with Multiple Textures/Materials
Просмотров 8 тыс.2 года назад
Create Mesh with Code: ArrayMesh with Multiple Textures/Materials
Create Mesh with Code: ArrayMesh Basics
Просмотров 16 тыс.2 года назад
Create Mesh with Code: ArrayMesh Basics
hate to necro this but the tut is still going strong in 4.3 just in case anyone cant get the project to stitch at all; you have to uncomment the two mix() functionblocks in the shadercode. its the part he refactored in minute 8:45
Hey man! I am looking a suitable engine to create a 2D/2,5D Game with multiplayer functionality, I would love to have access to an engine that provides netcode presets since most of basic netcode is the same (create client/server/connect and sync. In Godot, do i have to do all those manually or does it provide a toolset that makes it somewhat easier? Regards.
Isn't gdscript too slow to this task? It won't take a huge hit in performance? Nice tutorial!
The grass in the start looks pretty different of what I am used to see, how are you achieving this result?
Bruh you saved me, I just subscribed after you saved me three times in a row. Never give up!
Hey, I really enjoyed this guide, it was quick and to the point. I read in another comment that you no longer make tutorials which is really sad but I hope it means you found something more fulfilling to do. Wishing you the best!
Best video! I was dreading trying making normals work in a shader without passing a normal map. Saving VRAM is huge! Thank you so much!
Amazing tutorials, absolute godsend, but I have a couple questions: What’s the advantage of having a separate project for the server, wouldn’t that make adding new networking features an extra hassle? Why not just add - server to the launch flags? Do the multiplayer nodes handle client prediction on their own?
This is what's called rounding bias. Rounding many numbers will not increase overall result. This is useful for statistics and economics. Few programming languages have this feature baked in. But yeah.. it's weird seeing this in shader language
would love if you could do this with GDscript
Sorry if its an obvious question, but do you still need a server to make this work? Or it will be a direct connection between the 2 players?
Thanks for making a video and talking about this issue, sadly not enough people seem to be covering this... For future people coming across this video, you should be able to use `get_overlapping_bodies()` or `has_overlapping_bodies()` instead of appending needing to append items to a new array. However, one reason why you might want to use a new array is if you want to test the normal of the colliding surface as a filter to determine what is "ground". This is really useful in cases where you might have just walked off a ledge and you want to ignore the side of the ledge from being a considieration of being on the ground.
Ive been trying for so long and its that simple? Thanks so much!
i know this video is kinda old, but can you also make it run dedicated? like the host without a client ? e.g. for an simple and smal mmo?
ConfuzzledKatana says hi
can you update the code for 4.3? of maybe redo the tutorial for 4.3? im learning godot and this is super interesting thank you!
i have 0 ideas about gpus and RenderingDevice heck i still don't know how to make a ragdoll but i really want to make some good simulations in godot someday next year
ok . i understand all that .
Can we use delete port mapping in the exit_tree() function? It doesn't print anything for me so I'm worried the ports will stay open
I always find it so wild how in a year or twos time something like this can become entirely irrelevant, theres people in here praising it so obviously it's just the updates.
First, *thank you so much* for making this viewable on mobile. I think a lot of coding videos (especially for older languages) are meant to be watched on a 2nd monitor. Like there's some implicit expectations that programming is done at a desk. Second, this video is going to be so useful in a few weeks when I'm bashing my head into a brickwall trying to implement shaders.
could also be done on a laptop
Thanks, this was great and helped me a lot. If I may suggest an improvement: a link to GitHub to copy the final code would be great.
Really helpful man! Is see the effort and I love that. I really like the Godot community on RUclips!
how did you get grass to generate? i cant find anything on how to instance grass on procedural terrain like this
thank you so much for explaining the map_get_closest_point part and the RID, i was scratching my head for too long trying to figure out how i make my npc go to the closest point to the target if it's outside the navmesh area instead of just banging on the edge like it wants to be let it 🙏
the query_external_address part is kinda a golden egg, usually i have to use an http request to an ip service, this was nice to have as another way to get the external ip, once again godot makes things so simple.
I <3 this series and will immediatly watch the next part in a few minutes. As a sidenote: In godot 4.3 something is off with the stitching but I am not able to explain why and what to do to fix it :D I'm only starting to understand the shading and stitching code itself ( yes I am not as smart to understand it yet lol)
THANKSSSSSSSSSSSSSSSS
bro, you would think this basic stuff would be easyer to find. thanks
Hello, that was very interesting, I like your videos. (I hope the next ones will be posted soon as this one was posted a year ago 😅).
are you sick? you sound like the such
godot en decadenia , antes estaba mejor
Could someone tell me how I make the mesh visible in Editor, it's currently only visible in-game?
Fantastic video. Thanks
Hi, good video, but what are the server.pck and others files? how can i create them?
i have tried to do "hurt damage" animation with animation player to change material color... not work realy, all enemies get the animation, maybe you do a tutorial about this? maybe i didnt have understand how to synchronize correctly... but hp bar own hp and attack and movement worked fine... i am confused
subscribed because of your channel name
In case you are watching this in 2024 or later (godot version 4.X or higher), here is the code updated: @tool extends StaticBody3D @export var SIZE: int = 64 @export var NOISE_AMPLITUDE = 16 @export var noise: FastNoiseLite = FastNoiseLite.new() func _ready(): generate_mesh() func generate_mesh(): print("generating mesh") var plane_mesh = PlaneMesh.new() plane_mesh.size = Vector2(SIZE,SIZE) plane_mesh.subdivide_depth = SIZE-1 plane_mesh.subdivide_width = SIZE-1 var surface_tool = SurfaceTool.new() surface_tool.create_from(plane_mesh, 0) var data = surface_tool.commit_to_arrays() var vertices = data[ArrayMesh.ARRAY_VERTEX] for i in vertices.size(): var vertex = vertices[i] vertices[i].y = noise.get_noise_2d(vertex.x, vertex.z) * NOISE_AMPLITUDE data[ArrayMesh.ARRAY_VERTEX] = vertices var array_mesh = ArrayMesh.new() array_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, data) surface_tool.create_from(array_mesh, 0) surface_tool.generate_normals() $MeshInstance3D.mesh = surface_tool.commit() $CollisionShape3D.shape = array_mesh.create_trimesh_shape()
this line: var image:Image = load(ProjectSettings.get_setting("shader_globals/heightmap").value).get_image() gave me this error: Attempt to call function 'get_image' in base 'null instance' on a null instance. does get_setting work differently now?
This was golden! Been stock on normals the entire day. It didn't make any sense until now. The to_normalmap function solved it all.
godot 4.2? setget doesnt exist anymore
Ikr I just found out😭😭
Its changed in godot 4 break it up into 2 pieces
Set and get are seperate methods now
code updated in my comment
I heard ENetMultiplayer is not valid for WebGL games. Is this relevant when using WebSocketMultiplayerPeer or is that whole different approach and topic?
setting the names in the player script is VERY IMPORTANT. I skipped this and it caused me ~1.5 hrs of debugging
I don't get it
I don't get it
How do you do this if you dont have a heightmap aka if your terrain isnt being generated by a noise texture?
You have to feed in the height value of whatever algorithm is generating your terrain. This means doing the terrain generation calc for each vertex offset, so at least 3 times.
Incredible
If you have a large data object which controls your game.... how big would be too big to synchronise this object directly?
wawwww so much easyer than in unity3D
This litterally made my game possible! Without this tutorial I would be moving on lol.
That's awesome man. I'm really glad this helped out. I don't make tutorials anymore, but I've learned a lot since making this. Let me know if you run into any other hurdles. I might be able to give some tips.
@@ditzyninja For context, Im using this framework as collision for my raycast based driving system. The major hurdle I'm running into currently is whenever the collision plane regenerates the raycast slips through for a frame making the driving feel jittery and unpredictable at times. If you found a fix to that or had a similar problem a general tip would be great. If not that's fine Im still extremely grateful for the tutorial!
God
Really appreciate this