dioxus-three 0.0.4

A Three.js 3D model viewer for Dioxus - supports Desktop, Web (WASM), and Mobile
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
uniform float u_time;
uniform vec3 u_color;

varying vec2 vUv;
varying vec3 vPosition;

void main() {
    // Create animated gradient based on position and time
    float r = sin(vPosition.x * 2.0 + u_time) * 0.5 + 0.5;
    float g = sin(vPosition.y * 2.0 + u_time * 1.5) * 0.5 + 0.5;
    float b = sin(vPosition.z * 2.0 + u_time * 0.5) * 0.5 + 0.5;
    
    // Mix with base color
    vec3 gradient = vec3(r, g, b);
    vec3 finalColor = mix(u_color, gradient, 0.7);
    
    gl_FragColor = vec4(finalColor, 1.0);
}