Camera fog with wireframe MAT? or alternative method

Hiya, new to TD and don’t have any background in this stuff so please talk to me like I’m an idiot. I’ve spent a while searching but apolgies if this is already explained elsewhere

I’ve got instances of a rectangle traveling down a long box with the same cross section, away from the camera. I’m using wireframe SOP for a retro sci-fi vibe (green wireframe against black bg). I want the wireframes to fade out beyond a certain distance from the camera. I know the camera COMP has a fog function, and that works fine with e.g. phong MAT, but not with wireframe MAT. I can still see all the wireframes whatever the settings are. Is this to be expected?

I’ve done a hacky workaround by rendering a duplicate box using a phong MAT with an alpha ramp applied to the texture, and then comping that (atop seems to work) with the first render. But this only works when the instanced geometry is the same cross section, and I want to introduce other instances. So it would be really helpful if there was a fog solution!

Any ideas? thank you!

Hi @punkybasil,

alternatively you could try using the Line MAT which has close and far settings not just for color but also line width.

Alternatively the Fog route also works with the Phong MAT and enabling wireframe mode on the MAT’s Common parameter page.

Hope this helps
cheers
Markus

Markus you legend, thank you so much.

I had tried previously with the Line MAT but couldn’t make it work, but the Phong MAT wireframe has done the business. Such a simple fix after days of head-scratching - told you I’m an idiot! Out of curiosity, do you know why the Wireframe MAT isn’t affected by fog? (or was it just user error do you think?)

Thanks again
Herb

Hi @punkybasil,

good question on why the wireframe material doesn’t work with fog. My assumption is that the Wireframe MAT just like the Constant MAT are very simply shaders that do not take into account light and camera settings.

cheers
Markus

Ah yes, that makes sense thanks @snaut !