I have been experimenting with a shader that can draw the lines for both tri and quad edges (a sort of pseudo-wireframe shader) for my trees and other static meshes. Seems to be working decently enough. I'm embarrassed how long it took me to create that tree in Blender. I have no idea how 3D artists are able to put up with that terrible UX 😅

#GameDev #ProcGen #UnrealEngine

@jargon What's your approach to drawing pseudowireframes? I've seen some approaches that use vertex colors to flag each triangle, but I don't know of many!
@danana_dread Yea there's a few different ways. I set the UVs for a given face to be 3 corners of the UV space (0,0 & 1,0 & 0,1) then use the barycentric coordinates to work out how close a pixel is to the edge of the triangle and use that to lerp to a different colour. The terrain procedurally does this on the fly. The static mesh UVs are set in Blender as you need to follow a specific pattern to get quads to work. All nicely explained in this thread: https://forums.unrealengine.com/t/is-it-possible-to-create-a-custom-wireframe-shader-material-in-unreal-5-that-only-mostly-renders-quads-and-not-triangles-like-in-this-unity-engine-shader-example/848990/6
Is it possible to create a custom wireframe shader/material in Unreal 5 that only (mostly) renders quads (and not triangles) like in this Unity engine shader example?

The shader is actually not the important part - the UVs of the mesh are. In order for this to work, the mesh needs each quad occupying a full 0-1 UV space. That looks like this: You’ll notice that while the cube has 6 sides, its UV is just a single box. That’s because each quad is overlapping the entire 0-1 space. On our UV, we have the X and Y axis (R&G respectively) going from (0,0) in the top left corner to (1,1) in the bottom right. Next, let’s alter the coordinates. We don’t really wan...

Epic Developer Community Forums
@danana_dread Oh and a fantastic and extensive resource for writing a shader to do it (in Unity but the logic is transferable): https://catlikecoding.com/unity/tutorials/advanced-rendering/flat-and-wireframe-shading/
Flat and Wireframe Shading

A Unity Advanced Rendering tutorial about flat and wireframe shading, using derivative instructions and a geometry shader.

@jargon Oh, that is really clever! Especially if you don't need texture UVs. And I hadn't considered the quad approach... very neat!
@danana_dread You might be able to get away with textures as well if your material supports multiple UV sets :) I've been trying to encode average triangle face heights into 3 other UV sets to achieve a solid triangle colour sampled from a gradient... I know it's possible but the pattern and maths eludes me atm. The other option is to duplicate the vertices, but I don't want to do that.

@jargon as a non 3D artist, my take is that UX is 10% actual product and 90% the user getting accustomed to it

Also, I do appreciate how the water transparency creates an overlapping grid of edges from the surface and the depth

@brazmogu Hah yea most likely! Although I'm certain I was running into weird UX bugs but it could just be inexperience.

Thanks regarding the water effect. I'm still experimenting with things there. I haven't got the translucency quite right and I'm really struggling with the lighting. I made the bottom of the terrain completely blue as a bit of a cheat :)