Skip to content
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

updating effect data inputs realtime #18

Open
sneha-belkhale opened this issue May 3, 2019 · 0 comments
Open

updating effect data inputs realtime #18

sneha-belkhale opened this issue May 3, 2019 · 0 comments

Comments

@sneha-belkhale
Copy link

hey, thanks for the awesome library. one question -- is there a way to update the uniforms of my custom effects realtime without recompiling the shader?

  <script type="script-effect" id="customBlend" data-diffuse data-defaults="0.1">
    void $main(inout vec4 c, vec4 o, vec2 uv, float d){
      c.rgb = o.rgb;
      c.r = pow(c.r,$0);
    }
  </script>

for example, in this code, I want to change the value of $0 from another component in the scene. I can do so by setting this.el.sceneEl.setAttribute('effects', [newEffectString])
but this causes the shader to recompile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant