Skip to content

u/MehowLipa

In this archive from Jun 2023 to Oct 2026

23
posts
42
comments
21
media
4.4k
score
3 saved before deletion

Top posts

Top comments

Hey everyone! 🌟
A bit of background: I initially began developing a Life Sim Survival game in Unity and had about 30-40% of it done. However, after the recent Unity fee changes, I decided to take the plunge and switch over. Now, I've started from scratch in Godot, focusing on a simpler game to really get the hang of it.
I'm thrilled to showcase my first substantial functionality in Godot 4.1 using C#: the character customization! It leverages blend shapes, and for the hair shader, I've implemented the Marschner Hair model for that extra touch of realism.
I'd be super grateful for any feedback, and if you'd like to see more of my journey and progress, do consider following me on Twitter: https://twitter.com/MehowLipa

Thanks for your support!

14 points

Sure, there you go:

From editor view add textures for road and lines. I'm downloaded from https://ambientcg.com or https://cc0-textures.com

I've added also there an option to scale Lines UV to fit road width.

Code:

shader_type spatial;
// Road textures
uniform sampler2D road_color_texture;
uniform sampler2D road_normal_texture;
uniform sampler2D road_roughness_texture;
uniform sampler2D road_displacement_texture; // Displacement texture for road and lines
// Road line textures
uniform sampler2D line_color_texture;
uniform sampler2D line_opacity_texture; // Controls where the road lines appear
// Road lines parameters
uniform float line_intensity : hint_range(0, 1) = 1.0; // Adjust the intensity of the road lines
uniform vec2 line_uv_scale = vec2(1.0, 1.0); // UV scale for road lines
void fragment() {
// Sample the road textures
vec3 road_color = texture(road_color_texture, UV).rgb;
vec3 road_normal = (texture(road_normal_texture, UV).rgb - 0.5) * 2.0;
float road_roughness = texture(road_roughness_texture, UV).r;
// Adjusted UVs for road lines
vec2 line_uv = UV * line_uv_scale;
// Sample the road line textures
vec3 line_color = texture(line_color_texture, line_uv).rgb;
float line_opacity = texture(line_opacity_texture, line_uv).r;
// Blend road lines over the road surface
vec3 final_color = mix(road_color, line_color, line_opacity * line_intensity);
// Output
ALBEDO = final_color;
NORMAL_MAP = road_normal;
ROUGHNESS = road_roughness;
}

8 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.