I tried to instance some squares with transparent material, but I couldn’t make the material see-through. It seems like TD is redrawing on top of each instance. Can anyone give me some hints on how to make a transparent material properly? (I have tried draw order but it seems don’t work on instances)
NewProject.3.toe (6.5 KB)
Hi there
The way drawing occurs with any geometry in touch opengl/vulkan, instances included, is with a certain order. So with instances the first instance point gets drawn, then the next and so forth. Individual geometries can be ordered with the Draw Priority parameter in the render par page.
In order to get transparency working you need to enable alpha blending and typically make sure you are drawing from “back to front” with respect to the camera’s view, so that farther objects draw before closer objects. This allows alpha blending ( enabled on any mat in the common page) to work properly.
Sometimes order can be tougher with lots of points instancing and the “discard pixels based on alpha” option also on the common Mat page can help by removing pixels with a certain alpha threshold from the draw entirely, but you will typically get a little “edge” around the threshold if the geo is drawn on top of another in the camera space.
I’m attaching an edit to your file where i’ve adjusted the pbr mat to have blending and alpha discard and reversed the order of your line ( which can also be done with a sort sop in various ways, in this case i just changed the values for the two defining points’ Z coordinates to be reversed).
NewProject_ordered_blended.toe (6.5 KB)
Hope that helps.
1 Like
Thank you so much for the solution and explanation! It is really helpful.