-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add a way to "overlay" different ShaderMaterials on top of each other (e.g. vertex and fragment from different shaders) #2595
Comments
It is not exactly clear to me, what you mean with this. However, I think this feature request is mainly motivated by the desire for code reuse. |
I dont know much about how a gpu works but I was imagining the materials from the mesh resource being passed by reference while the materials from the mesh instance would be local to the instance. It would be as if you did mesh resource material for a surface then the mesh instance override for the same surface on the next pass after that then do the geometry material override as the last pass. Then if the over ride boolean is checked for any material the previous materials are not computed |
I think I understand you a little better now. Solving that cleanly is tricky, indeed. |
well the existing material would be under the one being overlayed. Lets give a practical example: |
Bugsquad edit: Related to #2589.
Describe the project you are working on
I'm trying to do the 1000 fish multimesh demo
Describe the problem or limitation you are having in your project
I'm having trouble putting a vertex shader over the fish while the mesh resource is still able to use the textures from its materials.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Perhaps rather than override it should be overlay.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
you could apply a translucent material over the material from the mesh resource. for example you could just apply a layer of blue over a selected object with an alpha of .5. You could still have a boolean with the option to over ride but I think having the option to overlay would be extremely powerful. Because you aren't getting rid of the previous information I could use the material overlay function inherited from the geometry class to overlay a vertex shader, that way I can still use all the textures from the materials from the mesh resource
If this enhancement will not be used often, can it be worked around with a few lines of script?
You could use a vertex shader for each material in the next pass in the mesh resource. But this has several issues
so long as you have a boolean option to over ride then you retain all advantages of the previous methodology but now with much more flexibility.
Is there a reason why this should be core and not an add-on in the asset library?
I think the ability to fade to an overlayed material would be used very frequently. If my understanding of how materials currently work is correct this seems like a necessary upgrade.
The text was updated successfully, but these errors were encountered: