Comments (7)
If you want to control the ShaderMaterial uniforms via a specific animation, all you need is a simple function based on animation.time
and clip.duration
.
Example: https://necromanthus.com/Test/html5/Lara_shader_controlled.html
In this case:
function animate() {
uniforms1.time.value = 5 * mixer1.clipAction( clip1 ).time / clip1.duration;
In you case it will be something like
uniforms.res.value = 0.1 - 0.05 * mixer.clipAction( clip ).time / clip.duration;
That's all and nothing more.
from three.js.
If you think a PR for #25028 would be approved, we can close this as duplicate and I'll throw some effort to that battle.
A solution for #25028 would be welcome. We need it anyway if we want to support the glTF extension with core features.
from three.js.
Dug into parseTrackName, bind, and findNode which is where most of the things break magic happens.
I think it's possible, may try to draft something when I get a chance.
from three.js.
I believe this issue is a duplicate of #25028. It is also related to KHR_animation_pointer
, see #24108.
from three.js.
Tried to target arbitrary THREE.ShaderMaterial uniform value with an animation, doesn't work.
Did you try this approach?
https://necromanthus.com/Test/html5/Lara_shader.html
let uniforms1 = {
time: { type: "f", value: 1.0 },
resolution: { type: "v2", value: new THREE.Vector2() }
};
// ...
function animate() {
let delta = clock.getDelta();
uniforms1.time.value += delta * 5;
from three.js.
Thanks Mugen!
I believe this issue is a duplicate of #25028. It is also related to
KHR_animation_pointer
, see #24108.
Yea #25028 would address this. Looking at the code I had lost some of my ambition for fixing every nested property case since it seems easier to address just the case of uniforms.name.value
as a one off. That said I think addressing this as a one-off pushes the can further down the road and could possibly impede future refactors similar to #24108.
If you think a PR for #25028 would be approved, we can close this as duplicate and I'll throw some effort to that battle.
from three.js.
If you want to control the ShaderMaterial uniforms via a specific animation, all you need is a simple function based on
animation.time
andclip.duration
. Example: https://necromanthus.com/Test/html5/Lara_shader_controlled.html In this case:function animate() { uniforms1.time.value = 5 * mixer1.clipAction( clip1 ).time / clip1.duration;
In you case it will be something like
uniforms.res.value = 0.1 - 0.05 * mixer.clipAction( clip ).time / clip.duration;
That's all and nothing more.
Thanks so much @RemusMar that's a really cool approach. Honestly it'd be easiest for me to just use TWEEN and call it a day (more flexibility to cycle through non-linear arbitrary values).
from three.js.
Related Issues (20)
- BufferGeometryUtils.mergeVertices crashes when feeding a geometry with morphAttributes (regression)
- NormalScale in USDZ Exporter HOT 7
- Please add back unit tests for addons HOT 7
- No Pointer Lock HOT 2
- Editor keeps rendering video on background even if users had stopped it HOT 4
- WARN THREE.WebGLRenderer: Image in DataTexture is too big (8192x1024). HOT 1
- copyTextureToTexture using WebGL1 function signature HOT 2
- Chrome Text Distortion When New Elements Are Added HOT 13
- Not displayed after importing 3MF and AMF files HOT 1
- OrbitControls 's change Event dispatch wrong when dampling is true HOT 1
- Documentation for TeapotGeometry (add-on) HOT 2
- Editor: Missing `User Data` input in Geometry tab HOT 1
- readRenderTargetPixels() works for WebGLRenderTarget but is all 0 for WebGL3DRenderTarget HOT 19
- Please allow FBXLoader to use every non native texture that ThreeJS can load
- It seems like there is an issue with outputNode in connection with depthNode HOT 1
- Rendering a scene including points with an override material causes inconsistent behavior HOT 2
- Target is not updated when panning the camera in ArcballControls HOT 1
- [WebGPU] Control Access Barriers HOT 1
- Suggestion of docs improvement. HOT 1
- ShaderMaterial for Hand breaks their motion tracking in WebXR (Quest3 tested) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from three.js.