Skip to content

Apply animation and animation curves on texture #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amerkoleci opened this issue Jul 19, 2013 · 1 comment
Closed

Apply animation and animation curves on texture #6

amerkoleci opened this issue Jul 19, 2013 · 1 comment
Labels

Comments

@amerkoleci
Copy link

As I know Texture in babylon has possibility to compute texture matrix and send it to shader, thought uOffset, vOffset, uScale, vScale etc, would be great if its possible to apply animation with wave functions (sine, cosine etc).

// references:
http://www.ogre3d.org/docs/manual/manual_17.html#rotate

@deltakosh
Copy link
Contributor

Hello,
you can attach animations to almost all Babylon.js objects (see http://blogs.msdn.com/b/eternalcoding/archive/2013/06/27/babylon-js-a-complete-javascript-framework-for-building-3d-games-with-html-5-and-webgl.aspx#chap7)

If you want an alternative you can also add a function that will be called before rendering the scene:

var alpha = 0;
scene.registerBeforeRender(function () {
texture.uScale = Math.cos(alpha);
alpha += 0.01;
});

deltakosh pushed a commit that referenced this issue Jan 25, 2021
sebavan pushed a commit that referenced this issue Sep 20, 2022
RaananW pushed a commit that referenced this issue Dec 9, 2022
Former-commit-id: 21b9278b0ae715524e7445eb469c18c1debc2abb
Popov72 pushed a commit to Popov72/Babylon.js that referenced this issue Dec 7, 2023
alexchuber pushed a commit to alexchuber/Babylon.js that referenced this issue Nov 21, 2024
…ex-colors

StandardMaterial vertex color conversion for unshared vertex buffers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants