Therefore, what I’d like to do is have the area between the glowing blue lines much darker, instead of transparent. That way, when looking through multiple “folds” of the same mesh, the parts that are farther away are darkened, or almost invisible.
Here you can see that while it is dimming the cube, it is NOT dimming itself. The blue lines, no matter how many times they’re obscured by the mesh, are still just as bright when they’re far away.
With the emission map texture, I’ve tried making it in Gimp to make the space between the lines 50% opacity, however, it seems to have no effect.
What should I do to make the transparent parts of this shader dark?
My guess is if you view your mesh from the other end it’ll work like you want.
The order the triangles are listed in a mesh determines the order they’re rendered in. For transparent surfaces, if objects are rendered “front to back” (closer objects before further objects) than the further objects won’t appear to be affected by the closer objects because GPUs are just rendering transparent objects over whatever else has been rendered before. The same is true for single meshes. If you can make sure the triangles in the mesh are ordered furthest to nearest so that it renders “back to front” than the closer surfaces will render “over” the further ones, dulling them as you would expect.
The other option you might want to look into is to use Shader Graph to fade the brightness by distance from the camera and just using an additive blend rather than alpha blend. That way the “tracks” can fade without darkening the rest of the scene.
That’s a great idea too… for now I’m trying to figure out wheel colliders for the game so I’m not sure what “vision” I have for it yet. I was initially planning to have the whole track visible but kind of transparent, I needed it to darken though so the glowing lines don’t look so messy when looking at them head-on. I also am planning to add ramps and a lot more sideways tilting and curves so the procedurally generated levels are much more interesting and less “vertical” feeling. I think I want the player to be able to see the whole track ahead of them so they can plan accordingly and it looks cooler instead of fading it by distance, but again this might change!