-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Line rendering vertex coloring #69
Conversation
Fixed in a commit. I can see that this is easy to overlook. Would be good to hard-set uinform types like this in the renderfunction ... |
I totally overlooked that :) thanks. How would you suggest I clean this PR up (avoid all the copy paste)? |
mmm, pyshader does not have functionality for calling into functions yet. It looks like we need it more and more. For now I'd leave it as-is. One thing that was not yet clear to me is whether we'd need a separate material for this. We could, for instance, let the per-vertex color override the material's color if it is present on the geometry. How does ThreeJS doe this? |
As far as I know, materials in threejs have "optional" uniforms. When you add or remove (not update!) one, you set "needsUpdate=true" on the material and in the next render call the shader is reconstructed (with templating) and recompiled. There's also material "parameters" which do not map directly to uniforms such as "vertexColors=true/false" but also need "needsUpdate=true" to trigger the same shader reconstruction and recompilation process. Play around with this: https://threejs.org/docs/index.html#api/en/materials/MeshBasicMaterial And look at the source to see how that demo scene is implemented: https://github.com/mrdoob/three.js/blob/dev/docs/scenes/material-browser.html So no, you don't need to use separate materials for this. |
Ah, its a boolean on the base |
I guess if we would want to support the same feature, we would need to have a Perhaps I can simply call |
The |
Did that; don't support it on thin lines yet. |
LGTM! |
See comment #69 (comment) for pictures
I also wanted to make sure we have a good testcase for pygfx/pyshader#55 as you can tell by the duplication in the shaders