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

ShaderFrog specific uniforms do not have a default value when exporting as THREE.js #17

Open
zya opened this issue Jan 12, 2016 · 5 comments

Comments

@zya
Copy link

zya commented Jan 12, 2016

For example:

Exporting this shader: http://shaderfrog.com/view/35
Will result in:

{
  "id": 35,
  "name": "Oil or Fire",
  "fragment": "...",
  "vertex": "...",
  "uniforms": {
    "time": {
      "type": "f",
      "glslType": "float",
      "description": "",
      "textureId": null,
      "runtime": {
        "texture": null
      }
    }
  },
 .....
}

It would be good if it (uniforms.time.value) had a default value of 0.5 for example. So it would work straight away when imported to a THREE.js application.

@AndrewRayCode
Copy link
Owner

Good call! Out of curiosity are you not using this runtime library to load the shaders? The runtime.updateShaders call is what passes the time uniform automatically to all shaders. I still think this would be an improvement either way.

@zya
Copy link
Author

zya commented Jan 13, 2016

@delvarworld No, I am not using the runtime library. Was just trying to load the shader in an existing THREE.js application.

@manthrax
Copy link

manthrax commented Apr 1, 2017

Seeing this as well. Is this project still active?

@AndrewRayCode
Copy link
Owner

I am not actively working on this project, but I have nebulous plans to revisit it and improve everything. I think a clear improvement would be to ditch the runtime all together, and just export runtime code that will properly create the Three shader material

@manthrax
Copy link

manthrax commented Apr 3, 2017

Cool. I think both could be useful. Enable raw shader loading without the runtime, but then use the runtime to expose the shader parameter tweaking, maybe with a UI like the 3js gui stuff. Also, I would change your pricing model. I don't think the monthly subscription model makes sense, but I'd gladly pay/donate ~50-100 bucks outright. That said, I did manage to fix my issue mentioned above with some judicious use of the chrome debugger. This is a cool project and definitely bridges the gap between shadertoy, and less technical programmers doing three.js stuff. I'd be happy to help you out w this if you're interested..
Cheers!

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

3 participants