🎨 💄 Created art template for farm plants and reworked existing plant prefabs and inventory resources

This commit is contained in:
2025-09-27 16:54:17 +02:00
parent 0713e334b3
commit e73f13d7d4
30 changed files with 289 additions and 173 deletions
+15 -3
View File
@@ -35,9 +35,21 @@ float getWind(vec2 vertex, vec2 uv, float time){
return wind;
}
float hash(vec2 p) {
return fract(sin(dot(p, vec2(12.9898,78.233))) * 43758.5453123);
}
float noise(vec2 x) {
vec2 p = floor(x);
vec2 f = fract(x);
f = f * f * (3.0 - 2.0 * f);
vec2 a = vec2(1.0, 0.0);
return mix(mix(hash(p + a.yy), hash(p + a.xy), f.x), mix(hash(p + a.yx), hash(p + a.xx), f.x), f.y);
}
void vertex() {
vec4 pos = MODEL_MATRIX * vec4(0.0, 0.0, 0.0, 1.0);
float time = TIME * speed + sin(float(INSTANCE_ID) * offset);
//float time = TIME * speed + pos.x * pos.y ; not working when moving...
//float time = TIME * speed + sin(VERTEX.x * noise(VERTEX.xy) * offset);
float time = TIME * speed + sin(pos.x * offset) * cos( pos.x * offset) ;
VERTEX.x += getWind(VERTEX.xy, UV, time);
}
}