AndrewRayCode / ShaderFrog-Runtime

Runtime library for ShaderFrog
78 stars 16 forks source link

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

Open zya opened 8 years ago

zya commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

manthrax commented 7 years ago

Seeing this as well. Is this project still active?

AndrewRayCode commented 7 years ago

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 commented 7 years ago

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!