Software & Apps

Software und Apps sind aus unserem Alltag nicht mehr wegzudenken; von Musik- und Videobearbeitung, Antiviren-Tools, VPN-Clients bis hin zu Office und gewissen Alternativen - hier dreht sich alles um Software & Apps für Deinen PC.
67.498 Beiträge

Ask Me Anything: Blickwechsel

Du stellst die Fragen, ein außergewöhnlicher Nutzer antwortet! Begegne mit Deinen Fragen anderen Menschen hautnah und persönlich.

Ask Me Anything: Themenspecials

Im gutefrage Themenspecial beantworten Verbände, Organisationen und Personen des öffentlichen Lebens Deine Fragen zu aktuellen Themen.
Ich habe in Godot mithilfe einen Shaders animiert, er nutzt Textur nun nicht mehr richtig?

Hallo miteinander! Ich arbeite grade mit Godot und habe mich am Tutorial von Godot Namens „Animating thousands of fish with MultiMeshInstance3D“ entlang gehangelt.

Soweit hat alles geklappt was die reine Animation angeht. Jedoch läuft die Animation auf einem scheinbar zweiten Objekt, welches aber mit dem texturierten wie eins agiert? Ich sehe überhaupt nicht durch. Ich wollte das sich der texturierte Fisch in Farbe bewegt nicht eine weiße Kopie die praktisch gar nicht da sein sollte.

Wie bekomme ich das gefixt das mein Fisch in Farbe sich bewegt?

Dies ist mein Code:

shader_type spatial;

uniform float time_scale = 1;

uniform float pivot = 1;

uniform float wave = 1;

uniform float twist = 1;

uniform float mask_black = 1;

uniform float mask_white = 1;

uniform sampler2D test_texture;

void vertex() {

float time = TIME * time_scale;

VERTEX.z += cos(time) * 0.5;

float pivot_angle = cos(time) * 0.1 * pivot;

mat2 rotation_matrix = mat2(vec2(cos(pivot_angle), -sin(pivot_angle)), vec2(sin(pivot_angle), cos(pivot_angle)));

VERTEX.yx = rotation_matrix * VERTEX.yx;

float body = (VERTEX.x + 1.0) / -2.0; //for a fish centered at (0, 0) with a length of 2

VERTEX.z += cos(time + body) * wave;

float twist_angle = cos(time + body) * 0.2 * twist;

mat2 twist_matrix = mat2(vec2(cos(twist_angle), -sin(twist_angle)), vec2(sin(twist_angle), cos(twist_angle)));

VERTEX.zy = twist_matrix * VERTEX.zy;

float mask = smoothstep(mask_black, mask_white, -2.0 - body);

VERTEX.z += cos(time + body) * mask * wave;

VERTEX.zy = mix(VERTEX.zy, twist_matrix * VERTEX.zy, mask);

vec4 texture_color = texture(test_texture, UV);

COLOR.rgb = texture_color.rgb;

Bild zum Beitrag