Make a shader ignore specific objects
- Edited
Devkure It may not be polycount per se but in fact the amount of details in general (i.e. the transparency texture). Hard to tell from your screenshots. It's not really clear what that bush is made of.
In general, you have two options. Either adjust the design/geometry of your meshes so they lend themselves to visually pleasing outline rendering, or render outlined and non-outlined things into separate viewports and do a depth-composite. The former is technically much less troublesome with potentially much better looking end result.
The scene is also populated with grass, a lot of instances. Dont remember the exact number, but perhaps around over 30k (multi-mesh component).
The Bush in itself is, as much as i remember - composed of only quads. I will check the exact count when i lay my hands on pc (sorry and thank you for your patience ) but i'm pretty sure its not a ridiculously huge polycount.
"Amount of details in general" - i understand it as, if i have a ton of objects on the scene, this issue may appear?
I will post more screenshots and info soon
Devkure My point is that it may not be a technical issue, but purely visual. If you have many leaves it the bush, and look at it from the distance, each leaf will be tiny and get a pixel-wide outline, creating a visual mess.
There still may be technical issues with normals though as the outline shader uses them.
So first make sure that your geometry is clean and adequate for this post processing effect.
Devkure Yeah the post processing shader might not play nice with billboards. For debugging, you can try to render the normal texture directly onto the screen to see how billboards appear there. Also try to billboard a simple shape texture, e.g. a single circle, to see if it gets outlined correctly.
- Edited
xyz Okay, so i have recorded how it looks in the engine:
I will further try to fiddle around with the foliage mesh and such, or maybe even try my luck with the outline shader. The current foliage mesh is this blob in the end.
Thats the 3d object as seen in blender:
![
The polycount is a bit high, but as i said - i dont know much about shaders, thats why i dont wanna make any assumptions...
- Edited
xyz Update. I have tried another outline shader, by reducing normal and depth thresholds respectively i was able to replicate the effect. Seems like the best course of actionwould be to separate these effects. You have mentioned previously that it can be achieved with separating it into two different subviewports? Correct? "render outlined and non-outlined things into separate viewports and do a depth-composite". Can you please expand on that idea? As of right now i have everything placed in a subviewport, that is placed in SubViewportContainer with "Stretch" on and "Stretch Shrink" set to three (to imitate pixelart)
![
xyz i tried fiddling around with that, unfortunately with no effect... The outline is messing the bushes up making them look weird, unfortunately - and if i reduce too much, then outline isnt looking too well on objects i actually want outlined. Is rendering in two different viewports so the effects dont overlap too hard to do?
xyz Thing is i dont necessarily want outline to render on everything... Imho the foliage would look far better with no visual border (outline), the same goes for any kind of grass and whatnot. My question is, if its troublesomesome to render it separately. If not viewports - is there any other way to separate the two, for instance - having the outline only attached to the building or any other kind of object (maybe attached to the material of said object?)