I only want the outline to be highlighted. I found an old forum post about highlight layers here Babylon Highlight layer - Announcements - HTML5 Game Devs Forum and they mentioned using “stencil: true” when creating the engine. I’ve done that but my problem persists.
I’ve tried turning off inner glow. They doesn’t make any difference. However, when I turn off outerglow the highlight disappears altogether.
Hmm…it works perfectly fine in the playground (I don’t even need to mention stencil) so there must be something else in my code that’s breaking the stencil info
I guess my problem is quite specific. I have 2 cameras. One is the main camera that fills up the screen. Another camera is for the mini-map (top-left of the screen). I’m using layer masks so the avatars don’t show up on the mini-map. There’s a map marker for each avatar instead. I’m using rendering group IDs so the map marker is always on top of everything else, even if the avatar walks into a house or under a tree.
When I apply the “scene.setRenderingAutoClearDepthStencil(1, false, true, false)” line it stops the rendering group ID from working and my map marker disappears
Hmm…I think mini-maps like this are a bad idea. Too many draw calls. I’m going to try and pre-render to a texture instead. Then I won’t have to worry about rendergroup IDs either
Thank you for the discussion. I’ve realised simply having a birds-eye view camera is not a good way of making a minimap.
I created a new project for internal use. It loads a city in a birds-eye view camera then exports render target to PNG and I just use that as the minimap in my other project. My cities are not dynamic so its fine if I use a fixed image throughout.
This also means I don’t have to worry about render group IDs since my avatar markers can just be positioned slightly above the minimap and it’ll always appear above. So now I can use highlight layer without any problems