1234567891011121314151617181920212223242526272829 |
- import * as RE from 'rogue-engine'
- import * as THREE from 'three'
- export default class StarShaderMaterialComponent extends RE.Component {
- material: THREE.ShaderMaterial
- elapsed: number = 0
- awake() {
- this.material = (this.object3d as any).material as THREE.ShaderMaterial
-
- this.material.uniforms = {
- uTime: { type: 'float', value: 0.0 },
- } as any
- this.elapsed = 0
- }
- start() {
- }
- update() {
- console.log("tick")
- this.elapsed += RE.Runtime.deltaTime
- this.material.uniforms["uTime"].value = this.elapsed
- }
- }
- RE.registerComponent(StarShaderMaterialComponent);
-
|