jeremybyington Posted April 18, 2017 Share Posted April 18, 2017 I read in another topic/question here that you should not freeze materials of instances, and from personal experience I see (or should I say, "do not see") the problem...the instances are transparent. Is it better to give the instances their own material to share and freeze it, or to not freeze the material for that mesh and its instances? Also, what is causing the problem of the instances not being visible when the material is frozen? I have no background in 3d, so it could be something obvious, but I am still curious. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 18, 2017 Share Posted April 18, 2017 Hello first of all instances must share the same material as the source mesh. If this is a problem you can still use clone (but they are less efficient) You cannot freeze the mesh material when instances are used because of how instances are rendered (Let me know if you want me to dig more into details :)) Quote Link to comment Share on other sites More sharing options...
jeremybyington Posted April 19, 2017 Author Share Posted April 19, 2017 Oh, yes, please! I love details. From what I gathered so far I understand that instances are all handled in a single draw call rather than an individual draw call for each one if they were their own unique meshes. Is that the same draw call as their source mesh or an additional draw call? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 19, 2017 Share Posted April 19, 2017 Ok so let's go for gory details - Instances are rendered with only one draw call - The visible instances and the root mesh (if in the frustum) generates a list of matrices (the world matrices) - The geometry (shared by all instances and the root mesh) is then rendered using the list of matrices to compute the various positions - The new material system could probably work even if you freeze the material of instances (but need to be tested) Quote Link to comment Share on other sites More sharing options...
jeremybyington Posted April 20, 2017 Author Share Posted April 20, 2017 By "new material system" do you mean the new standard material being created for the instances or do you mean there is a new material in development? My current project uses an art style that is no lighting and emissive colors only and there is a palette of like 10 colors so I was thinking there must be a way to reduce it down from the 300 materials that currently exists after importing several scenes. Many of them need to be duplicate materials to be controlled separately to change only their color, but around 200 materials are duplicates that should be merged somehow and frozen since there is no lighting or shadows. Is there something in the docs I am missing about merging materials or is there another material I should be using instead of Standard Material for the emissive-only style? Thanks for the help! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 20, 2017 Share Posted April 20, 2017 I changed the material in 3.0 and you can already test it if you pick the latest bits 200 materials duplicated: this is a HUGE idea to merge them into one If they all are the same, then only create one material and affect it to all meshes Regarding options like no emissive or whatever, this is automatic: the shader will always have the right content for you (we strip out everything which is not required) Quote Link to comment Share on other sites More sharing options...
jeremybyington Posted April 21, 2017 Author Share Posted April 21, 2017 I have been using the 2.5 version up on cdnjs, but I will definitely give 3.0 and the new materials a go and see what happens. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.